From e276e5a857176de4aed791dcf44e5f0541b22524 Mon Sep 17 00:00:00 2001 From: Tuan Pham Anh Date: Wed, 18 Sep 2024 06:20:04 +0000 Subject: [PATCH] An identifier is ambiguous if it is one of the keywords --- src/Core/SettingsChangesHistory.cpp | 2 +- src/Core/SettingsEnums.cpp | 6 +- src/Parsers/ASTAssignment.h | 2 +- src/Parsers/ASTColumnDeclaration.cpp | 2 +- .../ASTDictionaryAttributeDeclaration.cpp | 2 +- src/Parsers/ASTIdentifier.cpp | 2 +- src/Parsers/ASTIndexDeclaration.cpp | 2 +- src/Parsers/ASTProjectionDeclaration.cpp | 2 +- src/Parsers/ASTSubquery.cpp | 2 +- src/Parsers/ASTWithAlias.cpp | 4 +- src/Parsers/ASTWithElement.cpp | 2 +- src/Parsers/IAST.cpp | 12 +- src/Parsers/IdentifierQuotingStyle.h | 6 +- ..._format_identifier_quoting_style.reference | 76 ++++----- ...output_format_identifier_quoting_style.sql | 158 +++++++++--------- 15 files changed, 147 insertions(+), 133 deletions(-) diff --git a/src/Core/SettingsChangesHistory.cpp b/src/Core/SettingsChangesHistory.cpp index 53d1366e5e9..f5de98f5b46 100644 --- a/src/Core/SettingsChangesHistory.cpp +++ b/src/Core/SettingsChangesHistory.cpp @@ -75,7 +75,7 @@ static std::initializer_listformatImpl(s, state, frame); } diff --git a/src/Parsers/ASTProjectionDeclaration.cpp b/src/Parsers/ASTProjectionDeclaration.cpp index 6ea7eaf0258..21a924c0aff 100644 --- a/src/Parsers/ASTProjectionDeclaration.cpp +++ b/src/Parsers/ASTProjectionDeclaration.cpp @@ -17,7 +17,7 @@ ASTPtr ASTProjectionDeclaration::clone() const void ASTProjectionDeclaration::formatImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const { - settings.writeIdentifier(name, false); + settings.writeIdentifier(name, /*ambiguous=*/false); std::string indent_str = settings.one_line ? "" : std::string(4u * frame.indent, ' '); std::string nl_or_nothing = settings.one_line ? "" : "\n"; settings.ostr << settings.nl_or_ws << indent_str << "(" << nl_or_nothing; diff --git a/src/Parsers/ASTSubquery.cpp b/src/Parsers/ASTSubquery.cpp index d4c18976890..7b4f8d141fd 100644 --- a/src/Parsers/ASTSubquery.cpp +++ b/src/Parsers/ASTSubquery.cpp @@ -35,7 +35,7 @@ void ASTSubquery::formatImplWithoutAlias(const FormatSettings & settings, Format if (!cte_name.empty()) { settings.ostr << (settings.hilite ? hilite_identifier : ""); - settings.writeIdentifier(cte_name, false); + settings.writeIdentifier(cte_name, /*ambiguous=*/false); settings.ostr << (settings.hilite ? hilite_none : ""); return; } diff --git a/src/Parsers/ASTWithAlias.cpp b/src/Parsers/ASTWithAlias.cpp index 64a6a9b5d7e..a5c285f315e 100644 --- a/src/Parsers/ASTWithAlias.cpp +++ b/src/Parsers/ASTWithAlias.cpp @@ -10,7 +10,7 @@ namespace DB static void writeAlias(const String & name, const ASTWithAlias::FormatSettings & settings) { settings.ostr << (settings.hilite ? IAST::hilite_keyword : "") << " AS " << (settings.hilite ? IAST::hilite_alias : ""); - settings.writeIdentifier(name, false); + settings.writeIdentifier(name, /*ambiguous=*/false); settings.ostr << (settings.hilite ? IAST::hilite_none : ""); } @@ -22,7 +22,7 @@ void ASTWithAlias::formatImpl(const FormatSettings & settings, FormatState & sta if (!alias.empty() && !state.printed_asts_with_alias.emplace(frame.current_select, alias, getTreeHash(/*ignore_aliases=*/ true)).second) { settings.ostr << (settings.hilite ? IAST::hilite_identifier : ""); - settings.writeIdentifier(alias, false); + settings.writeIdentifier(alias, /*ambiguous=*/false); settings.ostr << (settings.hilite ? IAST::hilite_none : ""); } else diff --git a/src/Parsers/ASTWithElement.cpp b/src/Parsers/ASTWithElement.cpp index c82f5733b83..a94b0a7062d 100644 --- a/src/Parsers/ASTWithElement.cpp +++ b/src/Parsers/ASTWithElement.cpp @@ -19,7 +19,7 @@ void ASTWithElement::formatImpl(const FormatSettings & settings, FormatState & s std::string indent_str = settings.one_line ? "" : std::string(4 * frame.indent, ' '); settings.ostr << (settings.hilite ? hilite_alias : ""); - settings.writeIdentifier(name, false); + settings.writeIdentifier(name, /*ambiguous=*/false); settings.ostr << (settings.hilite ? hilite_none : ""); settings.ostr << (settings.hilite ? hilite_keyword : "") << " AS" << (settings.hilite ? hilite_none : ""); settings.ostr << settings.nl_or_ws << indent_str; diff --git a/src/Parsers/IAST.cpp b/src/Parsers/IAST.cpp index 12bf31dd033..088af846333 100644 --- a/src/Parsers/IAST.cpp +++ b/src/Parsers/IAST.cpp @@ -3,10 +3,13 @@ #include #include #include +#include +#include +#include #include #include -#include "Parsers/IdentifierQuotingStyle.h" +#include namespace DB { @@ -220,6 +223,13 @@ String IAST::getColumnNameWithoutAlias() const void IAST::FormatSettings::writeIdentifier(const String & name, bool ambiguous) const { + if (!ambiguous) + { + // Identifier is ambiguous if it is one of the defined keywords, set `ambiguous` + const auto & keywords = getAllKeyWords(); + ambiguous = std::find(keywords.begin(), keywords.end(), Poco::toUpper(name)) != keywords.end(); + } + bool must_quote = (identifier_quoting_rule == IdentifierQuotingRule::Always || (ambiguous && identifier_quoting_rule == IdentifierQuotingRule::WhenNecessary)); diff --git a/src/Parsers/IdentifierQuotingStyle.h b/src/Parsers/IdentifierQuotingStyle.h index 3ec804b5ad7..5c9ba9f00ba 100644 --- a/src/Parsers/IdentifierQuotingStyle.h +++ b/src/Parsers/IdentifierQuotingStyle.h @@ -16,8 +16,8 @@ enum class IdentifierQuotingStyle : uint8_t enum class IdentifierQuotingRule : uint8_t { - UserDisplay, /// When the identifiers is one of the certain keywords defined in `writeProbablyQuotedStringImpl` - WhenNecessary, /// When the identifiers is one of the certain keywords defined in `writeProbablyQuotedStringImpl`, and ambiguous identifiers passed to `writeIdentifier` - Always, /// Always quote identifiers + WhenNecessary, /// When the identifiers is one of the certain keywords defined in `writeProbablyQuotedStringImpl`, and ambiguous identifiers passed to `writeIdentifier` + Always, /// Always quote identifiers + UserDisplay, /// When the identifiers is one of the certain keywords defined in `writeProbablyQuotedStringImpl` }; } diff --git a/tests/queries/0_stateless/03230_output_format_identifier_quoting_style.reference b/tests/queries/0_stateless/03230_output_format_identifier_quoting_style.reference index 26fc1099bd6..e1e1cdc98ab 100644 --- a/tests/queries/0_stateless/03230_output_format_identifier_quoting_style.reference +++ b/tests/queries/0_stateless/03230_output_format_identifier_quoting_style.reference @@ -1,67 +1,67 @@ Settings: default -CREATE TABLE default.uk_price_paid\n(\n `price` UInt32,\n `date` Date,\n `postcode1` LowCardinality(String),\n `postcode2` LowCardinality(String),\n `type` Enum8(\'other\' = 0, \'terraced\' = 1, \'semi-detached\' = 2, \'detached\' = 3, \'flat\' = 4),\n `is_new` UInt8,\n `duration` Enum8(\'unknown\' = 0, \'freehold\' = 1, \'leasehold\' = 2),\n `addr1` String,\n `addr2` String,\n `street` LowCardinality(String),\n `locality` LowCardinality(String),\n `town` LowCardinality(String),\n `district` LowCardinality(String),\n `county` LowCardinality(String),\n INDEX county_index county TYPE set(10) GRANULARITY 1,\n PROJECTION town_date_projection\n (\n SELECT \n town,\n date,\n price\n ORDER BY \n town,\n date\n ),\n PROJECTION handy_aggs_projection\n (\n SELECT \n avg(price),\n max(price),\n sum(price)\n GROUP BY town\n )\n)\nENGINE = MergeTree\nORDER BY (postcode1, postcode2, date)\nSETTINGS index_granularity = 8192 -CREATE MATERIALIZED VIEW default.prices_by_year_view TO default.prices_by_year_dest\n(\n `price` UInt32,\n `date` Date,\n `addr1` String,\n `addr2` String,\n `street` LowCardinality(String),\n `town` LowCardinality(String),\n `district` LowCardinality(String),\n `county` LowCardinality(String)\n)\nAS SELECT\n price,\n date,\n addr1,\n addr2,\n street,\n town,\n district,\n county\nFROM default.uk_price_paid -CREATE TABLE default.uk_prices_aggs_dest\n(\n `month` Date,\n `min_price` SimpleAggregateFunction(min, UInt32),\n `max_price` SimpleAggregateFunction(max, UInt32),\n `volume` AggregateFunction(count, UInt32),\n `avg_price` AggregateFunction(avg, UInt32)\n)\nENGINE = AggregatingMergeTree\nPRIMARY KEY month\nORDER BY month\nSETTINGS index_granularity = 8192 -CREATE MATERIALIZED VIEW default.uk_prices_aggs_view TO default.uk_prices_aggs_dest\n(\n `month` Date,\n `min_price` SimpleAggregateFunction(min, UInt32),\n `max_price` SimpleAggregateFunction(max, UInt32),\n `volume` AggregateFunction(count, UInt32),\n `avg_price` AggregateFunction(avg, UInt32)\n)\nAS WITH toStartOfMonth(date) AS month\nSELECT\n month,\n minSimpleState(price) AS min_price,\n maxSimpleState(price) AS max_price,\n countState(price) AS volume,\n avgState(price) AS avg_price\nFROM default.uk_price_paid\nGROUP BY month -CREATE DICTIONARY default.uk_mortgage_rates_dict\n(\n `date` DateTime64,\n `variable` Decimal32(2),\n `fixed` Decimal32(2),\n `bank` Decimal32(2)\n)\nPRIMARY KEY date\nSOURCE(CLICKHOUSE(TABLE \'uk_mortgage_rates\'))\nLIFETIME(MIN 0 MAX 2628000000)\nLAYOUT(COMPLEX_KEY_HASHED()) -Settings: WhenNecessary & None -Settings: UserDisplay & None -CREATE TABLE default.uk_price_paid\n(\n price UInt32,\n date Date,\n postcode1 LowCardinality(String),\n postcode2 LowCardinality(String),\n type Enum8(\'other\' = 0, \'terraced\' = 1, \'semi-detached\' = 2, \'detached\' = 3, \'flat\' = 4),\n is_new UInt8,\n duration Enum8(\'unknown\' = 0, \'freehold\' = 1, \'leasehold\' = 2),\n addr1 String,\n addr2 String,\n street LowCardinality(String),\n locality LowCardinality(String),\n town LowCardinality(String),\n district LowCardinality(String),\n county LowCardinality(String),\n INDEX county_index county TYPE set(10) GRANULARITY 1,\n PROJECTION town_date_projection\n (\n SELECT \n town,\n date,\n price\n ORDER BY \n town,\n date\n ),\n PROJECTION handy_aggs_projection\n (\n SELECT \n avg(price),\n max(price),\n sum(price)\n GROUP BY town\n )\n)\nENGINE = MergeTree\nORDER BY (postcode1, postcode2, date)\nSETTINGS index_granularity = 8192 +CREATE TABLE default.uk_price_paid\n(\n `Table` String,\n `Engine` String,\n `price` UInt32,\n `date` Date,\n `postcode1` LowCardinality(String),\n `postcode2` LowCardinality(String),\n `type` Enum8(\'other\' = 0, \'terraced\' = 1, \'semi-detached\' = 2, \'detached\' = 3, \'flat\' = 4),\n `is_new` UInt8,\n `duration` Enum8(\'unknown\' = 0, \'freehold\' = 1, \'leasehold\' = 2),\n `addr1` String,\n `addr2` String,\n `street` LowCardinality(String),\n `locality` LowCardinality(String),\n `town` LowCardinality(String),\n `district` LowCardinality(String),\n `county` LowCardinality(String),\n INDEX county_index county TYPE set(10) GRANULARITY 1,\n PROJECTION town_date_projection\n (\n SELECT \n town,\n `date`,\n price\n ORDER BY \n town,\n `date`\n ),\n PROJECTION handy_aggs_projection\n (\n SELECT \n avg(price),\n max(price),\n sum(price)\n GROUP BY town\n )\n)\nENGINE = MergeTree\nORDER BY (postcode1, postcode2, `date`)\nSETTINGS index_granularity = 8192 +CREATE MATERIALIZED VIEW default.prices_by_year_view TO default.prices_by_year_dest\n(\n `price` UInt32,\n `date` Date,\n `addr1` String,\n `addr2` String,\n `street` LowCardinality(String),\n `town` LowCardinality(String),\n `district` LowCardinality(String),\n `county` LowCardinality(String)\n)\nAS SELECT\n price,\n `date`,\n addr1,\n addr2,\n street,\n town,\n district,\n county\nFROM default.uk_price_paid +CREATE TABLE default.uk_prices_aggs_dest\n(\n `month` Date,\n `min_price` SimpleAggregateFunction(`min`, UInt32),\n `max_price` SimpleAggregateFunction(`max`, UInt32),\n `volume` AggregateFunction(count, UInt32),\n `avg_price` AggregateFunction(avg, UInt32)\n)\nENGINE = AggregatingMergeTree\nPRIMARY KEY `month`\nORDER BY `month`\nSETTINGS index_granularity = 8192 +CREATE MATERIALIZED VIEW default.uk_prices_aggs_view TO default.uk_prices_aggs_dest\n(\n `month` Date,\n `min_price` SimpleAggregateFunction(`min`, UInt32),\n `max_price` SimpleAggregateFunction(`max`, UInt32),\n `volume` AggregateFunction(count, UInt32),\n `avg_price` AggregateFunction(avg, UInt32)\n)\nAS WITH toStartOfMonth(`date`) AS `month`\nSELECT\n `month`,\n minSimpleState(price) AS min_price,\n maxSimpleState(price) AS max_price,\n countState(price) AS volume,\n avgState(price) AS avg_price\nFROM default.uk_price_paid\nGROUP BY `month` +CREATE DICTIONARY default.uk_mortgage_rates_dict\n(\n `date` DateTime64,\n `variable` Decimal32(2),\n `fixed` Decimal32(2),\n `bank` Decimal32(2)\n)\nPRIMARY KEY `date`\nSOURCE(CLICKHOUSE(TABLE \'uk_mortgage_rates\'))\nLIFETIME(MIN 0 MAX 2628000000)\nLAYOUT(COMPLEX_KEY_HASHED()) +Settings: when_necessary & None +Settings: user_display & None +CREATE TABLE default.uk_price_paid\n(\n Table String,\n Engine String,\n price UInt32,\n date Date,\n postcode1 LowCardinality(String),\n postcode2 LowCardinality(String),\n type Enum8(\'other\' = 0, \'terraced\' = 1, \'semi-detached\' = 2, \'detached\' = 3, \'flat\' = 4),\n is_new UInt8,\n duration Enum8(\'unknown\' = 0, \'freehold\' = 1, \'leasehold\' = 2),\n addr1 String,\n addr2 String,\n street LowCardinality(String),\n locality LowCardinality(String),\n town LowCardinality(String),\n district LowCardinality(String),\n county LowCardinality(String),\n INDEX county_index county TYPE set(10) GRANULARITY 1,\n PROJECTION town_date_projection\n (\n SELECT \n town,\n date,\n price\n ORDER BY \n town,\n date\n ),\n PROJECTION handy_aggs_projection\n (\n SELECT \n avg(price),\n max(price),\n sum(price)\n GROUP BY town\n )\n)\nENGINE = MergeTree\nORDER BY (postcode1, postcode2, date)\nSETTINGS index_granularity = 8192 CREATE MATERIALIZED VIEW default.prices_by_year_view TO default.prices_by_year_dest\n(\n price UInt32,\n date Date,\n addr1 String,\n addr2 String,\n street LowCardinality(String),\n town LowCardinality(String),\n district LowCardinality(String),\n county LowCardinality(String)\n)\nAS SELECT\n price,\n date,\n addr1,\n addr2,\n street,\n town,\n district,\n county\nFROM default.uk_price_paid CREATE TABLE default.uk_prices_aggs_dest\n(\n month Date,\n min_price SimpleAggregateFunction(min, UInt32),\n max_price SimpleAggregateFunction(max, UInt32),\n volume AggregateFunction(count, UInt32),\n avg_price AggregateFunction(avg, UInt32)\n)\nENGINE = AggregatingMergeTree\nPRIMARY KEY month\nORDER BY month\nSETTINGS index_granularity = 8192 CREATE MATERIALIZED VIEW default.uk_prices_aggs_view TO default.uk_prices_aggs_dest\n(\n month Date,\n min_price SimpleAggregateFunction(min, UInt32),\n max_price SimpleAggregateFunction(max, UInt32),\n volume AggregateFunction(count, UInt32),\n avg_price AggregateFunction(avg, UInt32)\n)\nAS WITH toStartOfMonth(date) AS month\nSELECT\n month,\n minSimpleState(price) AS min_price,\n maxSimpleState(price) AS max_price,\n countState(price) AS volume,\n avgState(price) AS avg_price\nFROM default.uk_price_paid\nGROUP BY month CREATE DICTIONARY default.uk_mortgage_rates_dict\n(\n date DateTime64,\n variable Decimal32(2),\n fixed Decimal32(2),\n bank Decimal32(2)\n)\nPRIMARY KEY date\nSOURCE(CLICKHOUSE(TABLE \'uk_mortgage_rates\'))\nLIFETIME(MIN 0 MAX 2628000000)\nLAYOUT(COMPLEX_KEY_HASHED()) -Settings: Always & Backticks -CREATE TABLE `default`.`uk_price_paid`\n(\n `price` UInt32,\n `date` Date,\n `postcode1` LowCardinality(String),\n `postcode2` LowCardinality(String),\n `type` Enum8(\'other\' = 0, \'terraced\' = 1, \'semi-detached\' = 2, \'detached\' = 3, \'flat\' = 4),\n `is_new` UInt8,\n `duration` Enum8(\'unknown\' = 0, \'freehold\' = 1, \'leasehold\' = 2),\n `addr1` String,\n `addr2` String,\n `street` LowCardinality(String),\n `locality` LowCardinality(String),\n `town` LowCardinality(String),\n `district` LowCardinality(String),\n `county` LowCardinality(String),\n INDEX `county_index` `county` TYPE set(10) GRANULARITY 1,\n PROJECTION `town_date_projection`\n (\n SELECT \n `town`,\n `date`,\n `price`\n ORDER BY \n `town`,\n `date`\n ),\n PROJECTION `handy_aggs_projection`\n (\n SELECT \n avg(`price`),\n max(`price`),\n sum(`price`)\n GROUP BY `town`\n )\n)\nENGINE = MergeTree\nORDER BY (`postcode1`, `postcode2`, `date`)\nSETTINGS index_granularity = 8192 +Settings: always & Backticks +CREATE TABLE `default`.`uk_price_paid`\n(\n `Table` String,\n `Engine` String,\n `price` UInt32,\n `date` Date,\n `postcode1` LowCardinality(String),\n `postcode2` LowCardinality(String),\n `type` Enum8(\'other\' = 0, \'terraced\' = 1, \'semi-detached\' = 2, \'detached\' = 3, \'flat\' = 4),\n `is_new` UInt8,\n `duration` Enum8(\'unknown\' = 0, \'freehold\' = 1, \'leasehold\' = 2),\n `addr1` String,\n `addr2` String,\n `street` LowCardinality(String),\n `locality` LowCardinality(String),\n `town` LowCardinality(String),\n `district` LowCardinality(String),\n `county` LowCardinality(String),\n INDEX `county_index` `county` TYPE set(10) GRANULARITY 1,\n PROJECTION `town_date_projection`\n (\n SELECT \n `town`,\n `date`,\n `price`\n ORDER BY \n `town`,\n `date`\n ),\n PROJECTION `handy_aggs_projection`\n (\n SELECT \n avg(`price`),\n max(`price`),\n sum(`price`)\n GROUP BY `town`\n )\n)\nENGINE = MergeTree\nORDER BY (`postcode1`, `postcode2`, `date`)\nSETTINGS index_granularity = 8192 CREATE MATERIALIZED VIEW `default`.`prices_by_year_view` TO default.prices_by_year_dest\n(\n `price` UInt32,\n `date` Date,\n `addr1` String,\n `addr2` String,\n `street` LowCardinality(String),\n `town` LowCardinality(String),\n `district` LowCardinality(String),\n `county` LowCardinality(String)\n)\nAS SELECT\n `price`,\n `date`,\n `addr1`,\n `addr2`,\n `street`,\n `town`,\n `district`,\n `county`\nFROM `default`.`uk_price_paid` CREATE TABLE `default`.`uk_prices_aggs_dest`\n(\n `month` Date,\n `min_price` SimpleAggregateFunction(`min`, UInt32),\n `max_price` SimpleAggregateFunction(`max`, UInt32),\n `volume` AggregateFunction(`count`, UInt32),\n `avg_price` AggregateFunction(`avg`, UInt32)\n)\nENGINE = AggregatingMergeTree\nPRIMARY KEY `month`\nORDER BY `month`\nSETTINGS index_granularity = 8192 CREATE MATERIALIZED VIEW `default`.`uk_prices_aggs_view` TO default.uk_prices_aggs_dest\n(\n `month` Date,\n `min_price` SimpleAggregateFunction(`min`, UInt32),\n `max_price` SimpleAggregateFunction(`max`, UInt32),\n `volume` AggregateFunction(`count`, UInt32),\n `avg_price` AggregateFunction(`avg`, UInt32)\n)\nAS WITH toStartOfMonth(`date`) AS `month`\nSELECT\n `month`,\n minSimpleState(`price`) AS `min_price`,\n maxSimpleState(`price`) AS `max_price`,\n countState(`price`) AS `volume`,\n avgState(`price`) AS `avg_price`\nFROM `default`.`uk_price_paid`\nGROUP BY `month` CREATE DICTIONARY `default`.`uk_mortgage_rates_dict`\n(\n `date` DateTime64,\n `variable` Decimal32(2),\n `fixed` Decimal32(2),\n `bank` Decimal32(2)\n)\nPRIMARY KEY `date`\nSOURCE(CLICKHOUSE(TABLE \'uk_mortgage_rates\'))\nLIFETIME(MIN 0 MAX 2628000000)\nLAYOUT(COMPLEX_KEY_HASHED()) -Settings: UserDisplay & Backticks -CREATE TABLE default.uk_price_paid\n(\n price UInt32,\n date Date,\n postcode1 LowCardinality(String),\n postcode2 LowCardinality(String),\n type Enum8(\'other\' = 0, \'terraced\' = 1, \'semi-detached\' = 2, \'detached\' = 3, \'flat\' = 4),\n is_new UInt8,\n duration Enum8(\'unknown\' = 0, \'freehold\' = 1, \'leasehold\' = 2),\n addr1 String,\n addr2 String,\n street LowCardinality(String),\n locality LowCardinality(String),\n town LowCardinality(String),\n district LowCardinality(String),\n county LowCardinality(String),\n INDEX county_index county TYPE set(10) GRANULARITY 1,\n PROJECTION town_date_projection\n (\n SELECT \n town,\n date,\n price\n ORDER BY \n town,\n date\n ),\n PROJECTION handy_aggs_projection\n (\n SELECT \n avg(price),\n max(price),\n sum(price)\n GROUP BY town\n )\n)\nENGINE = MergeTree\nORDER BY (postcode1, postcode2, date)\nSETTINGS index_granularity = 8192 +Settings: user_display & Backticks +CREATE TABLE default.uk_price_paid\n(\n `Table` String,\n Engine String,\n price UInt32,\n date Date,\n postcode1 LowCardinality(String),\n postcode2 LowCardinality(String),\n type Enum8(\'other\' = 0, \'terraced\' = 1, \'semi-detached\' = 2, \'detached\' = 3, \'flat\' = 4),\n is_new UInt8,\n duration Enum8(\'unknown\' = 0, \'freehold\' = 1, \'leasehold\' = 2),\n addr1 String,\n addr2 String,\n street LowCardinality(String),\n locality LowCardinality(String),\n town LowCardinality(String),\n district LowCardinality(String),\n county LowCardinality(String),\n INDEX county_index county TYPE set(10) GRANULARITY 1,\n PROJECTION town_date_projection\n (\n SELECT \n town,\n date,\n price\n ORDER BY \n town,\n date\n ),\n PROJECTION handy_aggs_projection\n (\n SELECT \n avg(price),\n max(price),\n sum(price)\n GROUP BY town\n )\n)\nENGINE = MergeTree\nORDER BY (postcode1, postcode2, date)\nSETTINGS index_granularity = 8192 CREATE MATERIALIZED VIEW default.prices_by_year_view TO default.prices_by_year_dest\n(\n price UInt32,\n date Date,\n addr1 String,\n addr2 String,\n street LowCardinality(String),\n town LowCardinality(String),\n district LowCardinality(String),\n county LowCardinality(String)\n)\nAS SELECT\n price,\n date,\n addr1,\n addr2,\n street,\n town,\n district,\n county\nFROM default.uk_price_paid CREATE TABLE default.uk_prices_aggs_dest\n(\n month Date,\n min_price SimpleAggregateFunction(min, UInt32),\n max_price SimpleAggregateFunction(max, UInt32),\n volume AggregateFunction(count, UInt32),\n avg_price AggregateFunction(avg, UInt32)\n)\nENGINE = AggregatingMergeTree\nPRIMARY KEY month\nORDER BY month\nSETTINGS index_granularity = 8192 CREATE MATERIALIZED VIEW default.uk_prices_aggs_view TO default.uk_prices_aggs_dest\n(\n month Date,\n min_price SimpleAggregateFunction(min, UInt32),\n max_price SimpleAggregateFunction(max, UInt32),\n volume AggregateFunction(count, UInt32),\n avg_price AggregateFunction(avg, UInt32)\n)\nAS WITH toStartOfMonth(date) AS month\nSELECT\n month,\n minSimpleState(price) AS min_price,\n maxSimpleState(price) AS max_price,\n countState(price) AS volume,\n avgState(price) AS avg_price\nFROM default.uk_price_paid\nGROUP BY month CREATE DICTIONARY default.uk_mortgage_rates_dict\n(\n date DateTime64,\n variable Decimal32(2),\n fixed Decimal32(2),\n bank Decimal32(2)\n)\nPRIMARY KEY date\nSOURCE(CLICKHOUSE(TABLE \'uk_mortgage_rates\'))\nLIFETIME(MIN 0 MAX 2628000000)\nLAYOUT(COMPLEX_KEY_HASHED()) -Settings: WhenNecessary & Backticks -CREATE TABLE default.uk_price_paid\n(\n `price` UInt32,\n `date` Date,\n `postcode1` LowCardinality(String),\n `postcode2` LowCardinality(String),\n `type` Enum8(\'other\' = 0, \'terraced\' = 1, \'semi-detached\' = 2, \'detached\' = 3, \'flat\' = 4),\n `is_new` UInt8,\n `duration` Enum8(\'unknown\' = 0, \'freehold\' = 1, \'leasehold\' = 2),\n `addr1` String,\n `addr2` String,\n `street` LowCardinality(String),\n `locality` LowCardinality(String),\n `town` LowCardinality(String),\n `district` LowCardinality(String),\n `county` LowCardinality(String),\n INDEX county_index county TYPE set(10) GRANULARITY 1,\n PROJECTION town_date_projection\n (\n SELECT \n town,\n date,\n price\n ORDER BY \n town,\n date\n ),\n PROJECTION handy_aggs_projection\n (\n SELECT \n avg(price),\n max(price),\n sum(price)\n GROUP BY town\n )\n)\nENGINE = MergeTree\nORDER BY (postcode1, postcode2, date)\nSETTINGS index_granularity = 8192 -CREATE MATERIALIZED VIEW default.prices_by_year_view TO default.prices_by_year_dest\n(\n `price` UInt32,\n `date` Date,\n `addr1` String,\n `addr2` String,\n `street` LowCardinality(String),\n `town` LowCardinality(String),\n `district` LowCardinality(String),\n `county` LowCardinality(String)\n)\nAS SELECT\n price,\n date,\n addr1,\n addr2,\n street,\n town,\n district,\n county\nFROM default.uk_price_paid -CREATE TABLE default.uk_prices_aggs_dest\n(\n `month` Date,\n `min_price` SimpleAggregateFunction(min, UInt32),\n `max_price` SimpleAggregateFunction(max, UInt32),\n `volume` AggregateFunction(count, UInt32),\n `avg_price` AggregateFunction(avg, UInt32)\n)\nENGINE = AggregatingMergeTree\nPRIMARY KEY month\nORDER BY month\nSETTINGS index_granularity = 8192 -CREATE MATERIALIZED VIEW default.uk_prices_aggs_view TO default.uk_prices_aggs_dest\n(\n `month` Date,\n `min_price` SimpleAggregateFunction(min, UInt32),\n `max_price` SimpleAggregateFunction(max, UInt32),\n `volume` AggregateFunction(count, UInt32),\n `avg_price` AggregateFunction(avg, UInt32)\n)\nAS WITH toStartOfMonth(date) AS month\nSELECT\n month,\n minSimpleState(price) AS min_price,\n maxSimpleState(price) AS max_price,\n countState(price) AS volume,\n avgState(price) AS avg_price\nFROM default.uk_price_paid\nGROUP BY month -CREATE DICTIONARY default.uk_mortgage_rates_dict\n(\n `date` DateTime64,\n `variable` Decimal32(2),\n `fixed` Decimal32(2),\n `bank` Decimal32(2)\n)\nPRIMARY KEY date\nSOURCE(CLICKHOUSE(TABLE \'uk_mortgage_rates\'))\nLIFETIME(MIN 0 MAX 2628000000)\nLAYOUT(COMPLEX_KEY_HASHED()) -Settings: Always & DoubleQuotes -CREATE TABLE "default"."uk_price_paid"\n(\n "price" UInt32,\n "date" Date,\n "postcode1" LowCardinality(String),\n "postcode2" LowCardinality(String),\n "type" Enum8(\'other\' = 0, \'terraced\' = 1, \'semi-detached\' = 2, \'detached\' = 3, \'flat\' = 4),\n "is_new" UInt8,\n "duration" Enum8(\'unknown\' = 0, \'freehold\' = 1, \'leasehold\' = 2),\n "addr1" String,\n "addr2" String,\n "street" LowCardinality(String),\n "locality" LowCardinality(String),\n "town" LowCardinality(String),\n "district" LowCardinality(String),\n "county" LowCardinality(String),\n INDEX "county_index" "county" TYPE set(10) GRANULARITY 1,\n PROJECTION "town_date_projection"\n (\n SELECT \n "town",\n "date",\n "price"\n ORDER BY \n "town",\n "date"\n ),\n PROJECTION "handy_aggs_projection"\n (\n SELECT \n avg("price"),\n max("price"),\n sum("price")\n GROUP BY "town"\n )\n)\nENGINE = MergeTree\nORDER BY ("postcode1", "postcode2", "date")\nSETTINGS index_granularity = 8192 +Settings: when_necessary & Backticks +CREATE TABLE default.uk_price_paid\n(\n `Table` String,\n `Engine` String,\n `price` UInt32,\n `date` Date,\n `postcode1` LowCardinality(String),\n `postcode2` LowCardinality(String),\n `type` Enum8(\'other\' = 0, \'terraced\' = 1, \'semi-detached\' = 2, \'detached\' = 3, \'flat\' = 4),\n `is_new` UInt8,\n `duration` Enum8(\'unknown\' = 0, \'freehold\' = 1, \'leasehold\' = 2),\n `addr1` String,\n `addr2` String,\n `street` LowCardinality(String),\n `locality` LowCardinality(String),\n `town` LowCardinality(String),\n `district` LowCardinality(String),\n `county` LowCardinality(String),\n INDEX county_index county TYPE set(10) GRANULARITY 1,\n PROJECTION town_date_projection\n (\n SELECT \n town,\n `date`,\n price\n ORDER BY \n town,\n `date`\n ),\n PROJECTION handy_aggs_projection\n (\n SELECT \n avg(price),\n max(price),\n sum(price)\n GROUP BY town\n )\n)\nENGINE = MergeTree\nORDER BY (postcode1, postcode2, `date`)\nSETTINGS index_granularity = 8192 +CREATE MATERIALIZED VIEW default.prices_by_year_view TO default.prices_by_year_dest\n(\n `price` UInt32,\n `date` Date,\n `addr1` String,\n `addr2` String,\n `street` LowCardinality(String),\n `town` LowCardinality(String),\n `district` LowCardinality(String),\n `county` LowCardinality(String)\n)\nAS SELECT\n price,\n `date`,\n addr1,\n addr2,\n street,\n town,\n district,\n county\nFROM default.uk_price_paid +CREATE TABLE default.uk_prices_aggs_dest\n(\n `month` Date,\n `min_price` SimpleAggregateFunction(`min`, UInt32),\n `max_price` SimpleAggregateFunction(`max`, UInt32),\n `volume` AggregateFunction(count, UInt32),\n `avg_price` AggregateFunction(avg, UInt32)\n)\nENGINE = AggregatingMergeTree\nPRIMARY KEY `month`\nORDER BY `month`\nSETTINGS index_granularity = 8192 +CREATE MATERIALIZED VIEW default.uk_prices_aggs_view TO default.uk_prices_aggs_dest\n(\n `month` Date,\n `min_price` SimpleAggregateFunction(`min`, UInt32),\n `max_price` SimpleAggregateFunction(`max`, UInt32),\n `volume` AggregateFunction(count, UInt32),\n `avg_price` AggregateFunction(avg, UInt32)\n)\nAS WITH toStartOfMonth(`date`) AS `month`\nSELECT\n `month`,\n minSimpleState(price) AS min_price,\n maxSimpleState(price) AS max_price,\n countState(price) AS volume,\n avgState(price) AS avg_price\nFROM default.uk_price_paid\nGROUP BY `month` +CREATE DICTIONARY default.uk_mortgage_rates_dict\n(\n `date` DateTime64,\n `variable` Decimal32(2),\n `fixed` Decimal32(2),\n `bank` Decimal32(2)\n)\nPRIMARY KEY `date`\nSOURCE(CLICKHOUSE(TABLE \'uk_mortgage_rates\'))\nLIFETIME(MIN 0 MAX 2628000000)\nLAYOUT(COMPLEX_KEY_HASHED()) +Settings: always & DoubleQuotes +CREATE TABLE "default"."uk_price_paid"\n(\n "Table" String,\n "Engine" String,\n "price" UInt32,\n "date" Date,\n "postcode1" LowCardinality(String),\n "postcode2" LowCardinality(String),\n "type" Enum8(\'other\' = 0, \'terraced\' = 1, \'semi-detached\' = 2, \'detached\' = 3, \'flat\' = 4),\n "is_new" UInt8,\n "duration" Enum8(\'unknown\' = 0, \'freehold\' = 1, \'leasehold\' = 2),\n "addr1" String,\n "addr2" String,\n "street" LowCardinality(String),\n "locality" LowCardinality(String),\n "town" LowCardinality(String),\n "district" LowCardinality(String),\n "county" LowCardinality(String),\n INDEX "county_index" "county" TYPE set(10) GRANULARITY 1,\n PROJECTION "town_date_projection"\n (\n SELECT \n "town",\n "date",\n "price"\n ORDER BY \n "town",\n "date"\n ),\n PROJECTION "handy_aggs_projection"\n (\n SELECT \n avg("price"),\n max("price"),\n sum("price")\n GROUP BY "town"\n )\n)\nENGINE = MergeTree\nORDER BY ("postcode1", "postcode2", "date")\nSETTINGS index_granularity = 8192 CREATE MATERIALIZED VIEW "default"."prices_by_year_view" TO default.prices_by_year_dest\n(\n "price" UInt32,\n "date" Date,\n "addr1" String,\n "addr2" String,\n "street" LowCardinality(String),\n "town" LowCardinality(String),\n "district" LowCardinality(String),\n "county" LowCardinality(String)\n)\nAS SELECT\n "price",\n "date",\n "addr1",\n "addr2",\n "street",\n "town",\n "district",\n "county"\nFROM "default"."uk_price_paid" CREATE TABLE "default"."uk_prices_aggs_dest"\n(\n "month" Date,\n "min_price" SimpleAggregateFunction("min", UInt32),\n "max_price" SimpleAggregateFunction("max", UInt32),\n "volume" AggregateFunction("count", UInt32),\n "avg_price" AggregateFunction("avg", UInt32)\n)\nENGINE = AggregatingMergeTree\nPRIMARY KEY "month"\nORDER BY "month"\nSETTINGS index_granularity = 8192 CREATE MATERIALIZED VIEW "default"."uk_prices_aggs_view" TO default.uk_prices_aggs_dest\n(\n "month" Date,\n "min_price" SimpleAggregateFunction("min", UInt32),\n "max_price" SimpleAggregateFunction("max", UInt32),\n "volume" AggregateFunction("count", UInt32),\n "avg_price" AggregateFunction("avg", UInt32)\n)\nAS WITH toStartOfMonth("date") AS "month"\nSELECT\n "month",\n minSimpleState("price") AS "min_price",\n maxSimpleState("price") AS "max_price",\n countState("price") AS "volume",\n avgState("price") AS "avg_price"\nFROM "default"."uk_price_paid"\nGROUP BY "month" CREATE DICTIONARY "default"."uk_mortgage_rates_dict"\n(\n "date" DateTime64,\n "variable" Decimal32(2),\n "fixed" Decimal32(2),\n "bank" Decimal32(2)\n)\nPRIMARY KEY "date"\nSOURCE(CLICKHOUSE(TABLE \'uk_mortgage_rates\'))\nLIFETIME(MIN 0 MAX 2628000000)\nLAYOUT(COMPLEX_KEY_HASHED()) -Settings: UserDisplay & DoubleQuotes -CREATE TABLE default.uk_price_paid\n(\n price UInt32,\n date Date,\n postcode1 LowCardinality(String),\n postcode2 LowCardinality(String),\n type Enum8(\'other\' = 0, \'terraced\' = 1, \'semi-detached\' = 2, \'detached\' = 3, \'flat\' = 4),\n is_new UInt8,\n duration Enum8(\'unknown\' = 0, \'freehold\' = 1, \'leasehold\' = 2),\n addr1 String,\n addr2 String,\n street LowCardinality(String),\n locality LowCardinality(String),\n town LowCardinality(String),\n district LowCardinality(String),\n county LowCardinality(String),\n INDEX county_index county TYPE set(10) GRANULARITY 1,\n PROJECTION town_date_projection\n (\n SELECT \n town,\n date,\n price\n ORDER BY \n town,\n date\n ),\n PROJECTION handy_aggs_projection\n (\n SELECT \n avg(price),\n max(price),\n sum(price)\n GROUP BY town\n )\n)\nENGINE = MergeTree\nORDER BY (postcode1, postcode2, date)\nSETTINGS index_granularity = 8192 +Settings: user_display & DoubleQuotes +CREATE TABLE default.uk_price_paid\n(\n "Table" String,\n Engine String,\n price UInt32,\n date Date,\n postcode1 LowCardinality(String),\n postcode2 LowCardinality(String),\n type Enum8(\'other\' = 0, \'terraced\' = 1, \'semi-detached\' = 2, \'detached\' = 3, \'flat\' = 4),\n is_new UInt8,\n duration Enum8(\'unknown\' = 0, \'freehold\' = 1, \'leasehold\' = 2),\n addr1 String,\n addr2 String,\n street LowCardinality(String),\n locality LowCardinality(String),\n town LowCardinality(String),\n district LowCardinality(String),\n county LowCardinality(String),\n INDEX county_index county TYPE set(10) GRANULARITY 1,\n PROJECTION town_date_projection\n (\n SELECT \n town,\n date,\n price\n ORDER BY \n town,\n date\n ),\n PROJECTION handy_aggs_projection\n (\n SELECT \n avg(price),\n max(price),\n sum(price)\n GROUP BY town\n )\n)\nENGINE = MergeTree\nORDER BY (postcode1, postcode2, date)\nSETTINGS index_granularity = 8192 CREATE MATERIALIZED VIEW default.prices_by_year_view TO default.prices_by_year_dest\n(\n price UInt32,\n date Date,\n addr1 String,\n addr2 String,\n street LowCardinality(String),\n town LowCardinality(String),\n district LowCardinality(String),\n county LowCardinality(String)\n)\nAS SELECT\n price,\n date,\n addr1,\n addr2,\n street,\n town,\n district,\n county\nFROM default.uk_price_paid CREATE TABLE default.uk_prices_aggs_dest\n(\n month Date,\n min_price SimpleAggregateFunction(min, UInt32),\n max_price SimpleAggregateFunction(max, UInt32),\n volume AggregateFunction(count, UInt32),\n avg_price AggregateFunction(avg, UInt32)\n)\nENGINE = AggregatingMergeTree\nPRIMARY KEY month\nORDER BY month\nSETTINGS index_granularity = 8192 CREATE MATERIALIZED VIEW default.uk_prices_aggs_view TO default.uk_prices_aggs_dest\n(\n month Date,\n min_price SimpleAggregateFunction(min, UInt32),\n max_price SimpleAggregateFunction(max, UInt32),\n volume AggregateFunction(count, UInt32),\n avg_price AggregateFunction(avg, UInt32)\n)\nAS WITH toStartOfMonth(date) AS month\nSELECT\n month,\n minSimpleState(price) AS min_price,\n maxSimpleState(price) AS max_price,\n countState(price) AS volume,\n avgState(price) AS avg_price\nFROM default.uk_price_paid\nGROUP BY month CREATE DICTIONARY default.uk_mortgage_rates_dict\n(\n date DateTime64,\n variable Decimal32(2),\n fixed Decimal32(2),\n bank Decimal32(2)\n)\nPRIMARY KEY date\nSOURCE(CLICKHOUSE(TABLE \'uk_mortgage_rates\'))\nLIFETIME(MIN 0 MAX 2628000000)\nLAYOUT(COMPLEX_KEY_HASHED()) -Settings: WhenNecessary & DoubleQuotes -CREATE TABLE default.uk_price_paid\n(\n "price" UInt32,\n "date" Date,\n "postcode1" LowCardinality(String),\n "postcode2" LowCardinality(String),\n "type" Enum8(\'other\' = 0, \'terraced\' = 1, \'semi-detached\' = 2, \'detached\' = 3, \'flat\' = 4),\n "is_new" UInt8,\n "duration" Enum8(\'unknown\' = 0, \'freehold\' = 1, \'leasehold\' = 2),\n "addr1" String,\n "addr2" String,\n "street" LowCardinality(String),\n "locality" LowCardinality(String),\n "town" LowCardinality(String),\n "district" LowCardinality(String),\n "county" LowCardinality(String),\n INDEX county_index county TYPE set(10) GRANULARITY 1,\n PROJECTION town_date_projection\n (\n SELECT \n town,\n date,\n price\n ORDER BY \n town,\n date\n ),\n PROJECTION handy_aggs_projection\n (\n SELECT \n avg(price),\n max(price),\n sum(price)\n GROUP BY town\n )\n)\nENGINE = MergeTree\nORDER BY (postcode1, postcode2, date)\nSETTINGS index_granularity = 8192 -CREATE MATERIALIZED VIEW default.prices_by_year_view TO default.prices_by_year_dest\n(\n "price" UInt32,\n "date" Date,\n "addr1" String,\n "addr2" String,\n "street" LowCardinality(String),\n "town" LowCardinality(String),\n "district" LowCardinality(String),\n "county" LowCardinality(String)\n)\nAS SELECT\n price,\n date,\n addr1,\n addr2,\n street,\n town,\n district,\n county\nFROM default.uk_price_paid -CREATE TABLE default.uk_prices_aggs_dest\n(\n "month" Date,\n "min_price" SimpleAggregateFunction(min, UInt32),\n "max_price" SimpleAggregateFunction(max, UInt32),\n "volume" AggregateFunction(count, UInt32),\n "avg_price" AggregateFunction(avg, UInt32)\n)\nENGINE = AggregatingMergeTree\nPRIMARY KEY month\nORDER BY month\nSETTINGS index_granularity = 8192 -CREATE MATERIALIZED VIEW default.uk_prices_aggs_view TO default.uk_prices_aggs_dest\n(\n "month" Date,\n "min_price" SimpleAggregateFunction(min, UInt32),\n "max_price" SimpleAggregateFunction(max, UInt32),\n "volume" AggregateFunction(count, UInt32),\n "avg_price" AggregateFunction(avg, UInt32)\n)\nAS WITH toStartOfMonth(date) AS month\nSELECT\n month,\n minSimpleState(price) AS min_price,\n maxSimpleState(price) AS max_price,\n countState(price) AS volume,\n avgState(price) AS avg_price\nFROM default.uk_price_paid\nGROUP BY month -CREATE DICTIONARY default.uk_mortgage_rates_dict\n(\n "date" DateTime64,\n "variable" Decimal32(2),\n "fixed" Decimal32(2),\n "bank" Decimal32(2)\n)\nPRIMARY KEY date\nSOURCE(CLICKHOUSE(TABLE \'uk_mortgage_rates\'))\nLIFETIME(MIN 0 MAX 2628000000)\nLAYOUT(COMPLEX_KEY_HASHED()) -Settings: Always & BackticksMySQL -CREATE TABLE `default`.`uk_price_paid`\n(\n `price` UInt32,\n `date` Date,\n `postcode1` LowCardinality(String),\n `postcode2` LowCardinality(String),\n `type` Enum8(\'other\' = 0, \'terraced\' = 1, \'semi-detached\' = 2, \'detached\' = 3, \'flat\' = 4),\n `is_new` UInt8,\n `duration` Enum8(\'unknown\' = 0, \'freehold\' = 1, \'leasehold\' = 2),\n `addr1` String,\n `addr2` String,\n `street` LowCardinality(String),\n `locality` LowCardinality(String),\n `town` LowCardinality(String),\n `district` LowCardinality(String),\n `county` LowCardinality(String),\n INDEX `county_index` `county` TYPE set(10) GRANULARITY 1,\n PROJECTION `town_date_projection`\n (\n SELECT \n `town`,\n `date`,\n `price`\n ORDER BY \n `town`,\n `date`\n ),\n PROJECTION `handy_aggs_projection`\n (\n SELECT \n avg(`price`),\n max(`price`),\n sum(`price`)\n GROUP BY `town`\n )\n)\nENGINE = MergeTree\nORDER BY (`postcode1`, `postcode2`, `date`)\nSETTINGS index_granularity = 8192 +Settings: when_necessary & DoubleQuotes +CREATE TABLE default.uk_price_paid\n(\n "Table" String,\n "Engine" String,\n "price" UInt32,\n "date" Date,\n "postcode1" LowCardinality(String),\n "postcode2" LowCardinality(String),\n "type" Enum8(\'other\' = 0, \'terraced\' = 1, \'semi-detached\' = 2, \'detached\' = 3, \'flat\' = 4),\n "is_new" UInt8,\n "duration" Enum8(\'unknown\' = 0, \'freehold\' = 1, \'leasehold\' = 2),\n "addr1" String,\n "addr2" String,\n "street" LowCardinality(String),\n "locality" LowCardinality(String),\n "town" LowCardinality(String),\n "district" LowCardinality(String),\n "county" LowCardinality(String),\n INDEX county_index county TYPE set(10) GRANULARITY 1,\n PROJECTION town_date_projection\n (\n SELECT \n town,\n "date",\n price\n ORDER BY \n town,\n "date"\n ),\n PROJECTION handy_aggs_projection\n (\n SELECT \n avg(price),\n max(price),\n sum(price)\n GROUP BY town\n )\n)\nENGINE = MergeTree\nORDER BY (postcode1, postcode2, "date")\nSETTINGS index_granularity = 8192 +CREATE MATERIALIZED VIEW default.prices_by_year_view TO default.prices_by_year_dest\n(\n "price" UInt32,\n "date" Date,\n "addr1" String,\n "addr2" String,\n "street" LowCardinality(String),\n "town" LowCardinality(String),\n "district" LowCardinality(String),\n "county" LowCardinality(String)\n)\nAS SELECT\n price,\n "date",\n addr1,\n addr2,\n street,\n town,\n district,\n county\nFROM default.uk_price_paid +CREATE TABLE default.uk_prices_aggs_dest\n(\n "month" Date,\n "min_price" SimpleAggregateFunction("min", UInt32),\n "max_price" SimpleAggregateFunction("max", UInt32),\n "volume" AggregateFunction(count, UInt32),\n "avg_price" AggregateFunction(avg, UInt32)\n)\nENGINE = AggregatingMergeTree\nPRIMARY KEY "month"\nORDER BY "month"\nSETTINGS index_granularity = 8192 +CREATE MATERIALIZED VIEW default.uk_prices_aggs_view TO default.uk_prices_aggs_dest\n(\n "month" Date,\n "min_price" SimpleAggregateFunction("min", UInt32),\n "max_price" SimpleAggregateFunction("max", UInt32),\n "volume" AggregateFunction(count, UInt32),\n "avg_price" AggregateFunction(avg, UInt32)\n)\nAS WITH toStartOfMonth("date") AS "month"\nSELECT\n "month",\n minSimpleState(price) AS min_price,\n maxSimpleState(price) AS max_price,\n countState(price) AS volume,\n avgState(price) AS avg_price\nFROM default.uk_price_paid\nGROUP BY "month" +CREATE DICTIONARY default.uk_mortgage_rates_dict\n(\n "date" DateTime64,\n "variable" Decimal32(2),\n "fixed" Decimal32(2),\n "bank" Decimal32(2)\n)\nPRIMARY KEY "date"\nSOURCE(CLICKHOUSE(TABLE \'uk_mortgage_rates\'))\nLIFETIME(MIN 0 MAX 2628000000)\nLAYOUT(COMPLEX_KEY_HASHED()) +Settings: always & BackticksMySQL +CREATE TABLE `default`.`uk_price_paid`\n(\n `Table` String,\n `Engine` String,\n `price` UInt32,\n `date` Date,\n `postcode1` LowCardinality(String),\n `postcode2` LowCardinality(String),\n `type` Enum8(\'other\' = 0, \'terraced\' = 1, \'semi-detached\' = 2, \'detached\' = 3, \'flat\' = 4),\n `is_new` UInt8,\n `duration` Enum8(\'unknown\' = 0, \'freehold\' = 1, \'leasehold\' = 2),\n `addr1` String,\n `addr2` String,\n `street` LowCardinality(String),\n `locality` LowCardinality(String),\n `town` LowCardinality(String),\n `district` LowCardinality(String),\n `county` LowCardinality(String),\n INDEX `county_index` `county` TYPE set(10) GRANULARITY 1,\n PROJECTION `town_date_projection`\n (\n SELECT \n `town`,\n `date`,\n `price`\n ORDER BY \n `town`,\n `date`\n ),\n PROJECTION `handy_aggs_projection`\n (\n SELECT \n avg(`price`),\n max(`price`),\n sum(`price`)\n GROUP BY `town`\n )\n)\nENGINE = MergeTree\nORDER BY (`postcode1`, `postcode2`, `date`)\nSETTINGS index_granularity = 8192 CREATE MATERIALIZED VIEW `default`.`prices_by_year_view` TO default.prices_by_year_dest\n(\n `price` UInt32,\n `date` Date,\n `addr1` String,\n `addr2` String,\n `street` LowCardinality(String),\n `town` LowCardinality(String),\n `district` LowCardinality(String),\n `county` LowCardinality(String)\n)\nAS SELECT\n `price`,\n `date`,\n `addr1`,\n `addr2`,\n `street`,\n `town`,\n `district`,\n `county`\nFROM `default`.`uk_price_paid` CREATE TABLE `default`.`uk_prices_aggs_dest`\n(\n `month` Date,\n `min_price` SimpleAggregateFunction(`min`, UInt32),\n `max_price` SimpleAggregateFunction(`max`, UInt32),\n `volume` AggregateFunction(`count`, UInt32),\n `avg_price` AggregateFunction(`avg`, UInt32)\n)\nENGINE = AggregatingMergeTree\nPRIMARY KEY `month`\nORDER BY `month`\nSETTINGS index_granularity = 8192 CREATE MATERIALIZED VIEW `default`.`uk_prices_aggs_view` TO default.uk_prices_aggs_dest\n(\n `month` Date,\n `min_price` SimpleAggregateFunction(`min`, UInt32),\n `max_price` SimpleAggregateFunction(`max`, UInt32),\n `volume` AggregateFunction(`count`, UInt32),\n `avg_price` AggregateFunction(`avg`, UInt32)\n)\nAS WITH toStartOfMonth(`date`) AS `month`\nSELECT\n `month`,\n minSimpleState(`price`) AS `min_price`,\n maxSimpleState(`price`) AS `max_price`,\n countState(`price`) AS `volume`,\n avgState(`price`) AS `avg_price`\nFROM `default`.`uk_price_paid`\nGROUP BY `month` CREATE DICTIONARY `default`.`uk_mortgage_rates_dict`\n(\n `date` DateTime64,\n `variable` Decimal32(2),\n `fixed` Decimal32(2),\n `bank` Decimal32(2)\n)\nPRIMARY KEY `date`\nSOURCE(CLICKHOUSE(TABLE \'uk_mortgage_rates\'))\nLIFETIME(MIN 0 MAX 2628000000)\nLAYOUT(COMPLEX_KEY_HASHED()) -Settings: UserDisplay & BackticksMySQL -CREATE TABLE default.uk_price_paid\n(\n price UInt32,\n date Date,\n postcode1 LowCardinality(String),\n postcode2 LowCardinality(String),\n type Enum8(\'other\' = 0, \'terraced\' = 1, \'semi-detached\' = 2, \'detached\' = 3, \'flat\' = 4),\n is_new UInt8,\n duration Enum8(\'unknown\' = 0, \'freehold\' = 1, \'leasehold\' = 2),\n addr1 String,\n addr2 String,\n street LowCardinality(String),\n locality LowCardinality(String),\n town LowCardinality(String),\n district LowCardinality(String),\n county LowCardinality(String),\n INDEX county_index county TYPE set(10) GRANULARITY 1,\n PROJECTION town_date_projection\n (\n SELECT \n town,\n date,\n price\n ORDER BY \n town,\n date\n ),\n PROJECTION handy_aggs_projection\n (\n SELECT \n avg(price),\n max(price),\n sum(price)\n GROUP BY town\n )\n)\nENGINE = MergeTree\nORDER BY (postcode1, postcode2, date)\nSETTINGS index_granularity = 8192 +Settings: user_display & BackticksMySQL +CREATE TABLE default.uk_price_paid\n(\n `Table` String,\n Engine String,\n price UInt32,\n date Date,\n postcode1 LowCardinality(String),\n postcode2 LowCardinality(String),\n type Enum8(\'other\' = 0, \'terraced\' = 1, \'semi-detached\' = 2, \'detached\' = 3, \'flat\' = 4),\n is_new UInt8,\n duration Enum8(\'unknown\' = 0, \'freehold\' = 1, \'leasehold\' = 2),\n addr1 String,\n addr2 String,\n street LowCardinality(String),\n locality LowCardinality(String),\n town LowCardinality(String),\n district LowCardinality(String),\n county LowCardinality(String),\n INDEX county_index county TYPE set(10) GRANULARITY 1,\n PROJECTION town_date_projection\n (\n SELECT \n town,\n date,\n price\n ORDER BY \n town,\n date\n ),\n PROJECTION handy_aggs_projection\n (\n SELECT \n avg(price),\n max(price),\n sum(price)\n GROUP BY town\n )\n)\nENGINE = MergeTree\nORDER BY (postcode1, postcode2, date)\nSETTINGS index_granularity = 8192 CREATE MATERIALIZED VIEW default.prices_by_year_view TO default.prices_by_year_dest\n(\n price UInt32,\n date Date,\n addr1 String,\n addr2 String,\n street LowCardinality(String),\n town LowCardinality(String),\n district LowCardinality(String),\n county LowCardinality(String)\n)\nAS SELECT\n price,\n date,\n addr1,\n addr2,\n street,\n town,\n district,\n county\nFROM default.uk_price_paid CREATE TABLE default.uk_prices_aggs_dest\n(\n month Date,\n min_price SimpleAggregateFunction(min, UInt32),\n max_price SimpleAggregateFunction(max, UInt32),\n volume AggregateFunction(count, UInt32),\n avg_price AggregateFunction(avg, UInt32)\n)\nENGINE = AggregatingMergeTree\nPRIMARY KEY month\nORDER BY month\nSETTINGS index_granularity = 8192 CREATE MATERIALIZED VIEW default.uk_prices_aggs_view TO default.uk_prices_aggs_dest\n(\n month Date,\n min_price SimpleAggregateFunction(min, UInt32),\n max_price SimpleAggregateFunction(max, UInt32),\n volume AggregateFunction(count, UInt32),\n avg_price AggregateFunction(avg, UInt32)\n)\nAS WITH toStartOfMonth(date) AS month\nSELECT\n month,\n minSimpleState(price) AS min_price,\n maxSimpleState(price) AS max_price,\n countState(price) AS volume,\n avgState(price) AS avg_price\nFROM default.uk_price_paid\nGROUP BY month CREATE DICTIONARY default.uk_mortgage_rates_dict\n(\n date DateTime64,\n variable Decimal32(2),\n fixed Decimal32(2),\n bank Decimal32(2)\n)\nPRIMARY KEY date\nSOURCE(CLICKHOUSE(TABLE \'uk_mortgage_rates\'))\nLIFETIME(MIN 0 MAX 2628000000)\nLAYOUT(COMPLEX_KEY_HASHED()) -Settings: WhenNecessary & BackticksMySQL -CREATE TABLE default.uk_price_paid\n(\n `price` UInt32,\n `date` Date,\n `postcode1` LowCardinality(String),\n `postcode2` LowCardinality(String),\n `type` Enum8(\'other\' = 0, \'terraced\' = 1, \'semi-detached\' = 2, \'detached\' = 3, \'flat\' = 4),\n `is_new` UInt8,\n `duration` Enum8(\'unknown\' = 0, \'freehold\' = 1, \'leasehold\' = 2),\n `addr1` String,\n `addr2` String,\n `street` LowCardinality(String),\n `locality` LowCardinality(String),\n `town` LowCardinality(String),\n `district` LowCardinality(String),\n `county` LowCardinality(String),\n INDEX county_index county TYPE set(10) GRANULARITY 1,\n PROJECTION town_date_projection\n (\n SELECT \n town,\n date,\n price\n ORDER BY \n town,\n date\n ),\n PROJECTION handy_aggs_projection\n (\n SELECT \n avg(price),\n max(price),\n sum(price)\n GROUP BY town\n )\n)\nENGINE = MergeTree\nORDER BY (postcode1, postcode2, date)\nSETTINGS index_granularity = 8192 -CREATE MATERIALIZED VIEW default.prices_by_year_view TO default.prices_by_year_dest\n(\n `price` UInt32,\n `date` Date,\n `addr1` String,\n `addr2` String,\n `street` LowCardinality(String),\n `town` LowCardinality(String),\n `district` LowCardinality(String),\n `county` LowCardinality(String)\n)\nAS SELECT\n price,\n date,\n addr1,\n addr2,\n street,\n town,\n district,\n county\nFROM default.uk_price_paid -CREATE TABLE default.uk_prices_aggs_dest\n(\n `month` Date,\n `min_price` SimpleAggregateFunction(min, UInt32),\n `max_price` SimpleAggregateFunction(max, UInt32),\n `volume` AggregateFunction(count, UInt32),\n `avg_price` AggregateFunction(avg, UInt32)\n)\nENGINE = AggregatingMergeTree\nPRIMARY KEY month\nORDER BY month\nSETTINGS index_granularity = 8192 -CREATE MATERIALIZED VIEW default.uk_prices_aggs_view TO default.uk_prices_aggs_dest\n(\n `month` Date,\n `min_price` SimpleAggregateFunction(min, UInt32),\n `max_price` SimpleAggregateFunction(max, UInt32),\n `volume` AggregateFunction(count, UInt32),\n `avg_price` AggregateFunction(avg, UInt32)\n)\nAS WITH toStartOfMonth(date) AS month\nSELECT\n month,\n minSimpleState(price) AS min_price,\n maxSimpleState(price) AS max_price,\n countState(price) AS volume,\n avgState(price) AS avg_price\nFROM default.uk_price_paid\nGROUP BY month -CREATE DICTIONARY default.uk_mortgage_rates_dict\n(\n `date` DateTime64,\n `variable` Decimal32(2),\n `fixed` Decimal32(2),\n `bank` Decimal32(2)\n)\nPRIMARY KEY date\nSOURCE(CLICKHOUSE(TABLE \'uk_mortgage_rates\'))\nLIFETIME(MIN 0 MAX 2628000000)\nLAYOUT(COMPLEX_KEY_HASHED()) +Settings: when_necessary & BackticksMySQL +CREATE TABLE default.uk_price_paid\n(\n `Table` String,\n `Engine` String,\n `price` UInt32,\n `date` Date,\n `postcode1` LowCardinality(String),\n `postcode2` LowCardinality(String),\n `type` Enum8(\'other\' = 0, \'terraced\' = 1, \'semi-detached\' = 2, \'detached\' = 3, \'flat\' = 4),\n `is_new` UInt8,\n `duration` Enum8(\'unknown\' = 0, \'freehold\' = 1, \'leasehold\' = 2),\n `addr1` String,\n `addr2` String,\n `street` LowCardinality(String),\n `locality` LowCardinality(String),\n `town` LowCardinality(String),\n `district` LowCardinality(String),\n `county` LowCardinality(String),\n INDEX county_index county TYPE set(10) GRANULARITY 1,\n PROJECTION town_date_projection\n (\n SELECT \n town,\n `date`,\n price\n ORDER BY \n town,\n `date`\n ),\n PROJECTION handy_aggs_projection\n (\n SELECT \n avg(price),\n max(price),\n sum(price)\n GROUP BY town\n )\n)\nENGINE = MergeTree\nORDER BY (postcode1, postcode2, `date`)\nSETTINGS index_granularity = 8192 +CREATE MATERIALIZED VIEW default.prices_by_year_view TO default.prices_by_year_dest\n(\n `price` UInt32,\n `date` Date,\n `addr1` String,\n `addr2` String,\n `street` LowCardinality(String),\n `town` LowCardinality(String),\n `district` LowCardinality(String),\n `county` LowCardinality(String)\n)\nAS SELECT\n price,\n `date`,\n addr1,\n addr2,\n street,\n town,\n district,\n county\nFROM default.uk_price_paid +CREATE TABLE default.uk_prices_aggs_dest\n(\n `month` Date,\n `min_price` SimpleAggregateFunction(`min`, UInt32),\n `max_price` SimpleAggregateFunction(`max`, UInt32),\n `volume` AggregateFunction(count, UInt32),\n `avg_price` AggregateFunction(avg, UInt32)\n)\nENGINE = AggregatingMergeTree\nPRIMARY KEY `month`\nORDER BY `month`\nSETTINGS index_granularity = 8192 +CREATE MATERIALIZED VIEW default.uk_prices_aggs_view TO default.uk_prices_aggs_dest\n(\n `month` Date,\n `min_price` SimpleAggregateFunction(`min`, UInt32),\n `max_price` SimpleAggregateFunction(`max`, UInt32),\n `volume` AggregateFunction(count, UInt32),\n `avg_price` AggregateFunction(avg, UInt32)\n)\nAS WITH toStartOfMonth(`date`) AS `month`\nSELECT\n `month`,\n minSimpleState(price) AS min_price,\n maxSimpleState(price) AS max_price,\n countState(price) AS volume,\n avgState(price) AS avg_price\nFROM default.uk_price_paid\nGROUP BY `month` +CREATE DICTIONARY default.uk_mortgage_rates_dict\n(\n `date` DateTime64,\n `variable` Decimal32(2),\n `fixed` Decimal32(2),\n `bank` Decimal32(2)\n)\nPRIMARY KEY `date`\nSOURCE(CLICKHOUSE(TABLE \'uk_mortgage_rates\'))\nLIFETIME(MIN 0 MAX 2628000000)\nLAYOUT(COMPLEX_KEY_HASHED()) diff --git a/tests/queries/0_stateless/03230_output_format_identifier_quoting_style.sql b/tests/queries/0_stateless/03230_output_format_identifier_quoting_style.sql index ccec5b2b1bb..daf4027537f 100644 --- a/tests/queries/0_stateless/03230_output_format_identifier_quoting_style.sql +++ b/tests/queries/0_stateless/03230_output_format_identifier_quoting_style.sql @@ -10,6 +10,8 @@ DROP TABLE IF EXISTS uk_price_paid; CREATE TABLE uk_price_paid ( + Table String, -- column name is a keyword `table` + Engine String, -- column name is a keyword `ENGINE` price UInt32, date Date, postcode1 LowCardinality(String), @@ -48,6 +50,8 @@ ENGINE = MergeTree ORDER BY (postcode1, postcode2, date); CREATE TABLE prices_by_year_dest ( + Table String, -- column name is a keyword `table` + Engine String, -- column name is a keyword `ENGINE` price UInt32, date Date, addr1 String, @@ -133,301 +137,301 @@ SHOW CREATE VIEW uk_prices_aggs_view; SHOW CREATE DICTIONARY uk_mortgage_rates_dict; --- Show tables, views, dictionaries with output_format_identifier_quoting_rule='WhenNecessary', output_format_identifier_quoting_style='None' -SELECT('Settings: WhenNecessary & None'); +-- Show tables, views, dictionaries with output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='None' +SELECT('Settings: when_necessary & None'); SHOW CREATE TABLE uk_price_paid SETTINGS - output_format_identifier_quoting_rule='WhenNecessary', + output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='None'; -- { serverError BAD_ARGUMENTS} SHOW CREATE VIEW prices_by_year_view SETTINGS - output_format_identifier_quoting_rule='WhenNecessary', + output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='None'; -- { serverError BAD_ARGUMENTS} SHOW CREATE uk_prices_aggs_dest SETTINGS - output_format_identifier_quoting_rule='WhenNecessary', + output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='None'; -- { serverError BAD_ARGUMENTS} SHOW CREATE VIEW uk_prices_aggs_view SETTINGS - output_format_identifier_quoting_rule='WhenNecessary', + output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='None'; -- { serverError BAD_ARGUMENTS} SHOW CREATE DICTIONARY uk_mortgage_rates_dict SETTINGS - output_format_identifier_quoting_rule='WhenNecessary', + output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='None'; -- { serverError BAD_ARGUMENTS} --- Show tables, views, dictionaries with output_format_identifier_quoting_rule='UserDisplay', output_format_identifier_quoting_style='None' -SELECT('Settings: UserDisplay & None'); +-- Show tables, views, dictionaries with output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='None' +SELECT('Settings: user_display & None'); SHOW CREATE TABLE uk_price_paid SETTINGS - output_format_identifier_quoting_rule='UserDisplay', + output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='None'; SHOW CREATE VIEW prices_by_year_view SETTINGS - output_format_identifier_quoting_rule='UserDisplay', + output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='None'; SHOW CREATE uk_prices_aggs_dest SETTINGS - output_format_identifier_quoting_rule='UserDisplay', + output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='None'; SHOW CREATE VIEW uk_prices_aggs_view SETTINGS - output_format_identifier_quoting_rule='UserDisplay', + output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='None'; SHOW CREATE DICTIONARY uk_mortgage_rates_dict SETTINGS - output_format_identifier_quoting_rule='UserDisplay', + output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='None'; --- Show tables, views, dictionaries with output_format_identifier_quoting_rule='Always', output_format_identifier_quoting_style='Backticks' -SELECT('Settings: Always & Backticks'); +-- Show tables, views, dictionaries with output_format_identifier_quoting_rule='always', output_format_identifier_quoting_style='Backticks' +SELECT('Settings: always & Backticks'); SHOW CREATE TABLE uk_price_paid SETTINGS - output_format_identifier_quoting_rule='Always', + output_format_identifier_quoting_rule='always', output_format_identifier_quoting_style='Backticks'; SHOW CREATE VIEW prices_by_year_view SETTINGS - output_format_identifier_quoting_rule='Always', + output_format_identifier_quoting_rule='always', output_format_identifier_quoting_style='Backticks'; SHOW CREATE uk_prices_aggs_dest SETTINGS - output_format_identifier_quoting_rule='Always', + output_format_identifier_quoting_rule='always', output_format_identifier_quoting_style='Backticks'; SHOW CREATE VIEW uk_prices_aggs_view SETTINGS - output_format_identifier_quoting_rule='Always', + output_format_identifier_quoting_rule='always', output_format_identifier_quoting_style='Backticks'; SHOW CREATE DICTIONARY uk_mortgage_rates_dict SETTINGS - output_format_identifier_quoting_rule='Always', + output_format_identifier_quoting_rule='always', output_format_identifier_quoting_style='Backticks'; --- Show tables, views, dictionaries with output_format_identifier_quoting_rule='UserDisplay', output_format_identifier_quoting_style='Backticks' -SELECT('Settings: UserDisplay & Backticks'); +-- Show tables, views, dictionaries with output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='Backticks' +SELECT('Settings: user_display & Backticks'); SHOW CREATE TABLE uk_price_paid SETTINGS - output_format_identifier_quoting_rule='UserDisplay', + output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='Backticks'; SHOW CREATE VIEW prices_by_year_view SETTINGS - output_format_identifier_quoting_rule='UserDisplay', + output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='Backticks'; SHOW CREATE uk_prices_aggs_dest SETTINGS - output_format_identifier_quoting_rule='UserDisplay', + output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='Backticks'; SHOW CREATE VIEW uk_prices_aggs_view SETTINGS - output_format_identifier_quoting_rule='UserDisplay', + output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='Backticks'; SHOW CREATE DICTIONARY uk_mortgage_rates_dict SETTINGS - output_format_identifier_quoting_rule='UserDisplay', + output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='Backticks'; --- Show tables, views, dictionaries with output_format_identifier_quoting_rule='WhenNecessary', output_format_identifier_quoting_style='Backticks' -SELECT('Settings: WhenNecessary & Backticks'); +-- Show tables, views, dictionaries with output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='Backticks' +SELECT('Settings: when_necessary & Backticks'); SHOW CREATE TABLE uk_price_paid SETTINGS - output_format_identifier_quoting_rule='WhenNecessary', + output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='Backticks'; SHOW CREATE VIEW prices_by_year_view SETTINGS - output_format_identifier_quoting_rule='WhenNecessary', + output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='Backticks'; SHOW CREATE uk_prices_aggs_dest SETTINGS - output_format_identifier_quoting_rule='WhenNecessary', + output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='Backticks'; SHOW CREATE VIEW uk_prices_aggs_view SETTINGS - output_format_identifier_quoting_rule='WhenNecessary', + output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='Backticks'; SHOW CREATE DICTIONARY uk_mortgage_rates_dict SETTINGS - output_format_identifier_quoting_rule='WhenNecessary', + output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='Backticks'; --- Show tables, views, dictionaries with output_format_identifier_quoting_rule='Always', output_format_identifier_quoting_style='DoubleQuotes' -SELECT('Settings: Always & DoubleQuotes'); +-- Show tables, views, dictionaries with output_format_identifier_quoting_rule='always', output_format_identifier_quoting_style='DoubleQuotes' +SELECT('Settings: always & DoubleQuotes'); SHOW CREATE TABLE uk_price_paid SETTINGS - output_format_identifier_quoting_rule='Always', + output_format_identifier_quoting_rule='always', output_format_identifier_quoting_style='DoubleQuotes'; SHOW CREATE VIEW prices_by_year_view SETTINGS - output_format_identifier_quoting_rule='Always', + output_format_identifier_quoting_rule='always', output_format_identifier_quoting_style='DoubleQuotes'; SHOW CREATE uk_prices_aggs_dest SETTINGS - output_format_identifier_quoting_rule='Always', + output_format_identifier_quoting_rule='always', output_format_identifier_quoting_style='DoubleQuotes'; SHOW CREATE VIEW uk_prices_aggs_view SETTINGS - output_format_identifier_quoting_rule='Always', + output_format_identifier_quoting_rule='always', output_format_identifier_quoting_style='DoubleQuotes'; SHOW CREATE DICTIONARY uk_mortgage_rates_dict SETTINGS - output_format_identifier_quoting_rule='Always', + output_format_identifier_quoting_rule='always', output_format_identifier_quoting_style='DoubleQuotes'; --- Show tables, views, dictionaries with output_format_identifier_quoting_rule='UserDisplay', output_format_identifier_quoting_style='DoubleQuotes' -SELECT('Settings: UserDisplay & DoubleQuotes'); +-- Show tables, views, dictionaries with output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='DoubleQuotes' +SELECT('Settings: user_display & DoubleQuotes'); SHOW CREATE TABLE uk_price_paid SETTINGS - output_format_identifier_quoting_rule='UserDisplay', + output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='DoubleQuotes'; SHOW CREATE VIEW prices_by_year_view SETTINGS - output_format_identifier_quoting_rule='UserDisplay', + output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='DoubleQuotes'; SHOW CREATE uk_prices_aggs_dest SETTINGS - output_format_identifier_quoting_rule='UserDisplay', + output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='DoubleQuotes'; SHOW CREATE VIEW uk_prices_aggs_view SETTINGS - output_format_identifier_quoting_rule='UserDisplay', + output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='DoubleQuotes'; SHOW CREATE DICTIONARY uk_mortgage_rates_dict SETTINGS - output_format_identifier_quoting_rule='UserDisplay', + output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='DoubleQuotes'; --- Show tables, views, dictionaries with output_format_identifier_quoting_rule='WhenNecessary', output_format_identifier_quoting_style='DoubleQuotes' -SELECT('Settings: WhenNecessary & DoubleQuotes'); +-- Show tables, views, dictionaries with output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='DoubleQuotes' +SELECT('Settings: when_necessary & DoubleQuotes'); SHOW CREATE TABLE uk_price_paid SETTINGS - output_format_identifier_quoting_rule='WhenNecessary', + output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='DoubleQuotes'; SHOW CREATE VIEW prices_by_year_view SETTINGS - output_format_identifier_quoting_rule='WhenNecessary', + output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='DoubleQuotes'; SHOW CREATE uk_prices_aggs_dest SETTINGS - output_format_identifier_quoting_rule='WhenNecessary', + output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='DoubleQuotes'; SHOW CREATE VIEW uk_prices_aggs_view SETTINGS - output_format_identifier_quoting_rule='WhenNecessary', + output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='DoubleQuotes'; SHOW CREATE DICTIONARY uk_mortgage_rates_dict SETTINGS - output_format_identifier_quoting_rule='WhenNecessary', + output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='DoubleQuotes'; --- Show tables, views, dictionaries with output_format_identifier_quoting_rule='Always', output_format_identifier_quoting_style='BackticksMySQL' -SELECT('Settings: Always & BackticksMySQL'); +-- Show tables, views, dictionaries with output_format_identifier_quoting_rule='always', output_format_identifier_quoting_style='BackticksMySQL' +SELECT('Settings: always & BackticksMySQL'); SHOW CREATE TABLE uk_price_paid SETTINGS - output_format_identifier_quoting_rule='Always', + output_format_identifier_quoting_rule='always', output_format_identifier_quoting_style='BackticksMySQL'; SHOW CREATE VIEW prices_by_year_view SETTINGS - output_format_identifier_quoting_rule='Always', + output_format_identifier_quoting_rule='always', output_format_identifier_quoting_style='BackticksMySQL'; SHOW CREATE uk_prices_aggs_dest SETTINGS - output_format_identifier_quoting_rule='Always', + output_format_identifier_quoting_rule='always', output_format_identifier_quoting_style='BackticksMySQL'; SHOW CREATE VIEW uk_prices_aggs_view SETTINGS - output_format_identifier_quoting_rule='Always', + output_format_identifier_quoting_rule='always', output_format_identifier_quoting_style='BackticksMySQL'; SHOW CREATE DICTIONARY uk_mortgage_rates_dict SETTINGS - output_format_identifier_quoting_rule='Always', + output_format_identifier_quoting_rule='always', output_format_identifier_quoting_style='BackticksMySQL'; --- Show tables, views, dictionaries with output_format_identifier_quoting_rule='UserDisplay', output_format_identifier_quoting_style='BackticksMySQL' -SELECT('Settings: UserDisplay & BackticksMySQL'); +-- Show tables, views, dictionaries with output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='BackticksMySQL' +SELECT('Settings: user_display & BackticksMySQL'); SHOW CREATE TABLE uk_price_paid SETTINGS - output_format_identifier_quoting_rule='UserDisplay', + output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='BackticksMySQL'; SHOW CREATE VIEW prices_by_year_view SETTINGS - output_format_identifier_quoting_rule='UserDisplay', + output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='BackticksMySQL'; SHOW CREATE uk_prices_aggs_dest SETTINGS - output_format_identifier_quoting_rule='UserDisplay', + output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='BackticksMySQL'; SHOW CREATE VIEW uk_prices_aggs_view SETTINGS - output_format_identifier_quoting_rule='UserDisplay', + output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='BackticksMySQL'; SHOW CREATE DICTIONARY uk_mortgage_rates_dict SETTINGS - output_format_identifier_quoting_rule='UserDisplay', + output_format_identifier_quoting_rule='user_display', output_format_identifier_quoting_style='BackticksMySQL'; --- Show tables, views, dictionaries with output_format_identifier_quoting_rule='WhenNecessary', output_format_identifier_quoting_style='BackticksMySQL' -SELECT('Settings: WhenNecessary & BackticksMySQL'); +-- Show tables, views, dictionaries with output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='BackticksMySQL' +SELECT('Settings: when_necessary & BackticksMySQL'); SHOW CREATE TABLE uk_price_paid SETTINGS - output_format_identifier_quoting_rule='WhenNecessary', + output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='BackticksMySQL'; SHOW CREATE VIEW prices_by_year_view SETTINGS - output_format_identifier_quoting_rule='WhenNecessary', + output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='BackticksMySQL'; SHOW CREATE uk_prices_aggs_dest SETTINGS - output_format_identifier_quoting_rule='WhenNecessary', + output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='BackticksMySQL'; SHOW CREATE VIEW uk_prices_aggs_view SETTINGS - output_format_identifier_quoting_rule='WhenNecessary', + output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='BackticksMySQL'; SHOW CREATE DICTIONARY uk_mortgage_rates_dict SETTINGS - output_format_identifier_quoting_rule='WhenNecessary', + output_format_identifier_quoting_rule='when_necessary', output_format_identifier_quoting_style='BackticksMySQL'; DROP DICTIONARY uk_mortgage_rates_dict;