From 37d188912409d1ffdd47ce4f9ecbaf30ff425e6e Mon Sep 17 00:00:00 2001 From: robot-clickhouse Date: Sat, 28 Sep 2024 01:33:17 +0000 Subject: [PATCH] Backport #69448 to 24.9: Add show_create_query_identifier_quoting_rule setting --- docs/en/operations/settings/settings.md | 26 ++ programs/odbc-bridge/MainHandler.cpp | 2 +- programs/odbc-bridge/getIdentifierQuote.cpp | 2 +- src/BridgeHelper/XDBCBridgeHelper.h | 2 +- src/Core/ExternalTable.cpp | 4 +- src/Core/FormatFactorySettingsDeclaration.h | 4 +- src/Core/Settings.h | 1 + src/Core/SettingsChangesHistory.cpp | 7 +- src/Core/SettingsEnums.cpp | 14 +- src/Core/SettingsEnums.h | 1 + src/Dictionaries/ExternalQueryBuilder.cpp | 4 - src/Interpreters/executeQuery.cpp | 16 +- .../formatWithPossiblyHidingSecrets.cpp | 8 +- src/Parsers/ASTAssignment.h | 2 +- src/Parsers/ASTColumnDeclaration.cpp | 3 +- .../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/CommonParsers.cpp | 16 +- src/Parsers/CommonParsers.h | 3 + src/Parsers/IAST.cpp | 67 +-- src/Parsers/IAST.h | 31 +- src/Parsers/IdentifierQuotingStyle.h | 17 +- src/Parsers/getInsertQuery.cpp | 7 +- src/Processors/QueryPlan/ReadFromRemote.cpp | 3 +- src/Storages/StorageDistributed.cpp | 17 +- src/Storages/StorageReplicatedMergeTree.cpp | 3 +- .../transformQueryForExternalDatabase.cpp | 13 +- tests/integration/test_storage_kafka/test.py | 10 +- ..._format_identifier_quoting_style.reference | 40 -- ...output_format_identifier_quoting_style.sql | 328 --------------- ...e_query_identifier_quoting_style.reference | 60 +++ ..._create_query_identifier_quoting_style.sql | 388 ++++++++++++++++++ .../aspell-ignore/en/aspell-dict.txt | 1 + 38 files changed, 634 insertions(+), 482 deletions(-) delete mode 100644 tests/queries/0_stateless/03230_output_format_identifier_quoting_style.reference delete mode 100644 tests/queries/0_stateless/03230_output_format_identifier_quoting_style.sql create mode 100644 tests/queries/0_stateless/03230_show_create_query_identifier_quoting_style.reference create mode 100644 tests/queries/0_stateless/03230_show_create_query_identifier_quoting_style.sql diff --git a/docs/en/operations/settings/settings.md b/docs/en/operations/settings/settings.md index e826bb457c2..0cfa0cff2b9 100644 --- a/docs/en/operations/settings/settings.md +++ b/docs/en/operations/settings/settings.md @@ -5682,3 +5682,29 @@ Default value: `0`. Enable `IF NOT EXISTS` for `CREATE` statement by default. If either this setting or `IF NOT EXISTS` is specified and a table with the provided name already exists, no exception will be thrown. Default value: `false`. + +## show_create_query_identifier_quoting_rule + +Define identifier quoting behavior of the show create query result: +- `when_necessary`: When the identifiers is one of `{"distinct", "all", "table"}`, or it can cause ambiguity: column names, dictionary attribute names. +- `always`: Always quote identifiers. +- `user_display`: When the identifiers is a keyword. + +Default value: `when_necessary`. + +## show_create_query_identifier_quoting_style + +Define identifier quoting style of the show create query result: +- `Backticks`: \`clickhouse\` style. +- `DoubleQuotes`: "postgres" style. +- `BackticksMySQL`: \`mysql\` style, most same as `Backticks`, but it uses '``' to escape '`'. + +Default value: `Backticks`. + +## mongodb_throw_on_unsupported_query + +If enabled, MongoDB tables will return an error when a MongoDB query can't be built. + +Not applied for the legacy implementation, or when 'allow_experimental_analyzer=0`. + +Default value: `true`. diff --git a/programs/odbc-bridge/MainHandler.cpp b/programs/odbc-bridge/MainHandler.cpp index 04c02288858..82ebcc3340a 100644 --- a/programs/odbc-bridge/MainHandler.cpp +++ b/programs/odbc-bridge/MainHandler.cpp @@ -164,7 +164,7 @@ void ODBCHandler::handleRequest(HTTPServerRequest & request, HTTPServerResponse std::string table_name = params.get("table_name"); LOG_TRACE(log, "DB name: '{}', table name: '{}'", db_name, table_name); - auto quoting_style = IdentifierQuotingStyle::None; + auto quoting_style = IdentifierQuotingStyle::Backticks; #if USE_ODBC quoting_style = getQuotingStyle(connection_handler); #endif diff --git a/programs/odbc-bridge/getIdentifierQuote.cpp b/programs/odbc-bridge/getIdentifierQuote.cpp index c0c833e5b8c..e96da91ecb9 100644 --- a/programs/odbc-bridge/getIdentifierQuote.cpp +++ b/programs/odbc-bridge/getIdentifierQuote.cpp @@ -38,7 +38,7 @@ IdentifierQuotingStyle getQuotingStyle(nanodbc::ConnectionHolderPtr connection) { auto identifier_quote = getIdentifierQuote(connection); if (identifier_quote.empty()) - return IdentifierQuotingStyle::None; + return IdentifierQuotingStyle::Backticks; else if (identifier_quote[0] == '`') return IdentifierQuotingStyle::Backticks; else if (identifier_quote[0] == '"') diff --git a/src/BridgeHelper/XDBCBridgeHelper.h b/src/BridgeHelper/XDBCBridgeHelper.h index 0630a0f24e3..b75ccbeedc9 100644 --- a/src/BridgeHelper/XDBCBridgeHelper.h +++ b/src/BridgeHelper/XDBCBridgeHelper.h @@ -243,7 +243,7 @@ protected: throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "Failed to parse quoting style from '{}' for service {}", character, BridgeHelperMixin::serviceAlias()); else if (character.empty()) - quote_style = IdentifierQuotingStyle::None; + quote_style = IdentifierQuotingStyle::Backticks; else if (character[0] == '`') quote_style = IdentifierQuotingStyle::Backticks; else if (character[0] == '"') diff --git a/src/Core/ExternalTable.cpp b/src/Core/ExternalTable.cpp index 4d33633b29d..07250a83236 100644 --- a/src/Core/ExternalTable.cpp +++ b/src/Core/ExternalTable.cpp @@ -97,7 +97,7 @@ void BaseExternalTable::parseStructureFromStructureField(const std::string & arg /*one_line=*/true, /*show_secrets=*/true, /*print_pretty_type_names=*/false, - /*always_quote_identifiers=*/false, + /*identifier_quoting_rule=*/IdentifierQuotingRule::WhenNecessary, /*identifier_quoting_style=*/IdentifierQuotingStyle::Backticks)); else throw Exception(ErrorCodes::BAD_ARGUMENTS, "Error while parsing table structure: expected column definition, got {}", child->formatForErrorMessage()); @@ -122,7 +122,7 @@ void BaseExternalTable::parseStructureFromTypesField(const std::string & argumen /*one_line=*/true, /*show_secrets=*/true, /*print_pretty_type_names=*/false, - /*always_quote_identifiers=*/false, + /*identifier_quoting_rule=*/IdentifierQuotingRule::WhenNecessary, /*identifier_quoting_style=*/IdentifierQuotingStyle::Backticks)); } diff --git a/src/Core/FormatFactorySettingsDeclaration.h b/src/Core/FormatFactorySettingsDeclaration.h index 3ef2e174cbe..35f77d059db 100644 --- a/src/Core/FormatFactorySettingsDeclaration.h +++ b/src/Core/FormatFactorySettingsDeclaration.h @@ -257,8 +257,8 @@ M(DateTimeOverflowBehavior, date_time_overflow_behavior, "ignore", "Overflow mode for Date, Date32, DateTime, DateTime64 types. Possible values: 'ignore', 'throw', 'saturate'.", 0) \ M(Bool, validate_experimental_and_suspicious_types_inside_nested_types, true, "Validate usage of experimental and suspicious types inside nested types like Array/Map/Tuple", 0) \ \ - M(Bool, output_format_always_quote_identifiers, false, "Always quote identifiers", 0) \ - M(IdentifierQuotingStyle, output_format_identifier_quoting_style, IdentifierQuotingStyle::Backticks, "Set the quoting style for identifiers", 0) \ + M(IdentifierQuotingRule, show_create_query_identifier_quoting_rule, IdentifierQuotingRule::WhenNecessary, "Set the quoting rule for identifiers in SHOW CREATE query", 0) \ + M(IdentifierQuotingStyle, show_create_query_identifier_quoting_style, IdentifierQuotingStyle::Backticks, "Set the quoting style for identifiers in SHOW CREATE query", 0) \ // End of FORMAT_FACTORY_SETTINGS diff --git a/src/Core/Settings.h b/src/Core/Settings.h index ddc18624e87..d1e43752e11 100644 --- a/src/Core/Settings.h +++ b/src/Core/Settings.h @@ -58,6 +58,7 @@ class WriteBuffer; M(CLASS_NAME, Double) \ M(CLASS_NAME, EscapingRule) \ M(CLASS_NAME, Float) \ + M(CLASS_NAME, IdentifierQuotingRule) \ M(CLASS_NAME, IdentifierQuotingStyle) \ M(CLASS_NAME, Int32) \ M(CLASS_NAME, Int64) \ diff --git a/src/Core/SettingsChangesHistory.cpp b/src/Core/SettingsChangesHistory.cpp index 560f144866b..8b2c91c9f84 100644 --- a/src/Core/SettingsChangesHistory.cpp +++ b/src/Core/SettingsChangesHistory.cpp @@ -67,6 +67,11 @@ static std::initializer_list executeQueryImpl( /// Verify that AST formatting is consistent: /// If you format AST, parse it back, and format it again, you get the same string. - String formatted1 = ast->formatWithPossiblyHidingSensitiveData(0, true, true, false, false, IdentifierQuotingStyle::Backticks); + String formatted1 = ast->formatWithPossiblyHidingSensitiveData( + /*max_length=*/0, + /*one_line=*/true, + /*show_secrets=*/true, + /*print_pretty_type_names=*/false, + /*identifier_quoting_rule=*/IdentifierQuotingRule::WhenNecessary, + /*identifier_quoting_style=*/IdentifierQuotingStyle::Backticks); /// The query can become more verbose after formatting, so: size_t new_max_query_size = max_query_size > 0 ? (1000 + 2 * max_query_size) : 0; @@ -876,7 +882,13 @@ static std::tuple executeQueryImpl( chassert(ast2); - String formatted2 = ast2->formatWithPossiblyHidingSensitiveData(0, true, true, false, false, IdentifierQuotingStyle::Backticks); + String formatted2 = ast2->formatWithPossiblyHidingSensitiveData( + /*max_length=*/0, + /*one_line=*/true, + /*show_secrets=*/true, + /*print_pretty_type_names=*/false, + /*identifier_quoting_rule=*/IdentifierQuotingRule::WhenNecessary, + /*identifier_quoting_style=*/IdentifierQuotingStyle::Backticks); if (formatted1 != formatted2) throw Exception(ErrorCodes::LOGICAL_ERROR, diff --git a/src/Interpreters/formatWithPossiblyHidingSecrets.cpp b/src/Interpreters/formatWithPossiblyHidingSecrets.cpp index ba02a9f164b..9b7a58332a2 100644 --- a/src/Interpreters/formatWithPossiblyHidingSecrets.cpp +++ b/src/Interpreters/formatWithPossiblyHidingSecrets.cpp @@ -8,8 +8,8 @@ namespace DB namespace Setting { extern const SettingsBool format_display_secrets_in_show_and_select; - extern const SettingsBool output_format_always_quote_identifiers; - extern const SettingsIdentifierQuotingStyle output_format_identifier_quoting_style; + extern const SettingsIdentifierQuotingRule show_create_query_identifier_quoting_rule; + extern const SettingsIdentifierQuotingStyle show_create_query_identifier_quoting_style; extern const SettingsBool print_pretty_type_names; } @@ -24,8 +24,8 @@ String format(const SecretHidingFormatSettings & settings) settings.one_line, show_secrets, settings.ctx->getSettingsRef()[Setting::print_pretty_type_names], - settings.ctx->getSettingsRef()[Setting::output_format_always_quote_identifiers], - settings.ctx->getSettingsRef()[Setting::output_format_identifier_quoting_style]); + settings.ctx->getSettingsRef()[Setting::show_create_query_identifier_quoting_rule], + settings.ctx->getSettingsRef()[Setting::show_create_query_identifier_quoting_style]); } } diff --git a/src/Parsers/ASTAssignment.h b/src/Parsers/ASTAssignment.h index a37a31ae38e..2b1391b5812 100644 --- a/src/Parsers/ASTAssignment.h +++ b/src/Parsers/ASTAssignment.h @@ -30,7 +30,7 @@ protected: { settings.ostr << (settings.hilite ? hilite_identifier : ""); - settings.writeIdentifier(column_name); + settings.writeIdentifier(column_name, /*ambiguous=*/false); settings.ostr << (settings.hilite ? hilite_none : ""); settings.ostr << (settings.hilite ? hilite_operator : "") << " = " << (settings.hilite ? hilite_none : ""); diff --git a/src/Parsers/ASTColumnDeclaration.cpp b/src/Parsers/ASTColumnDeclaration.cpp index d7728462df3..e7c3fdbb548 100644 --- a/src/Parsers/ASTColumnDeclaration.cpp +++ b/src/Parsers/ASTColumnDeclaration.cpp @@ -66,8 +66,7 @@ void ASTColumnDeclaration::formatImpl(const FormatSettings & format_settings, Fo { frame.need_parens = false; - /// We have to always quote column names to avoid ambiguity with INDEX and other declarations in CREATE query. - format_settings.quoteIdentifier(name); + format_settings.writeIdentifier(name, /*ambiguous=*/true); if (type) { diff --git a/src/Parsers/ASTDictionaryAttributeDeclaration.cpp b/src/Parsers/ASTDictionaryAttributeDeclaration.cpp index a600987dc45..43fef42be4f 100644 --- a/src/Parsers/ASTDictionaryAttributeDeclaration.cpp +++ b/src/Parsers/ASTDictionaryAttributeDeclaration.cpp @@ -35,7 +35,7 @@ void ASTDictionaryAttributeDeclaration::formatImpl(const FormatSettings & settin { frame.need_parens = false; - settings.quoteIdentifier(name); + settings.writeIdentifier(name, /*ambiguous=*/true); if (type) { diff --git a/src/Parsers/ASTIdentifier.cpp b/src/Parsers/ASTIdentifier.cpp index 80a618170c6..f466e10d7d8 100644 --- a/src/Parsers/ASTIdentifier.cpp +++ b/src/Parsers/ASTIdentifier.cpp @@ -108,7 +108,7 @@ void ASTIdentifier::formatImplWithoutAlias(const FormatSettings & settings, Form auto format_element = [&](const String & elem_name) { settings.ostr << (settings.hilite ? hilite_identifier : ""); - settings.writeIdentifier(elem_name); + settings.writeIdentifier(elem_name, /*ambiguous=*/false); settings.ostr << (settings.hilite ? hilite_none : ""); }; diff --git a/src/Parsers/ASTIndexDeclaration.cpp b/src/Parsers/ASTIndexDeclaration.cpp index 1e39eacaac7..80102479cb9 100644 --- a/src/Parsers/ASTIndexDeclaration.cpp +++ b/src/Parsers/ASTIndexDeclaration.cpp @@ -79,7 +79,7 @@ void ASTIndexDeclaration::formatImpl(const FormatSettings & s, FormatState & sta } else { - s.writeIdentifier(name); + s.writeIdentifier(name, /*ambiguous=*/false); s.ostr << " "; expr->formatImpl(s, state, frame); } diff --git a/src/Parsers/ASTProjectionDeclaration.cpp b/src/Parsers/ASTProjectionDeclaration.cpp index af79745a88e..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); + 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 844520b2f64..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); + 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 6f64e33d33d..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); + 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); + 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 c2cb1177c17..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); + 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/CommonParsers.cpp b/src/Parsers/CommonParsers.cpp index ed8d58d5a68..f07a0e8d319 100644 --- a/src/Parsers/CommonParsers.cpp +++ b/src/Parsers/CommonParsers.cpp @@ -1,9 +1,8 @@ -#include -#include -#include #include #include - +#include +#include +#include namespace DB { @@ -35,6 +34,8 @@ public: return mapping; } + const std::unordered_set & getSet() const { return set; } + private: KeyWordToStringConverter() { @@ -63,6 +64,7 @@ private: size_t index = static_cast(identifier); mapping.resize(std::max(index + 1, mapping.size())); mapping[index] = value; + set.emplace(value); } void checkUnderscore(std::string_view value) @@ -94,6 +96,7 @@ private: } Strings mapping; + std::unordered_set set; }; } @@ -108,6 +111,11 @@ const std::vector & getAllKeyWords() return KeyWordToStringConverter::instance().getMapping(); } +const std::unordered_set & getKeyWordSet() +{ + return KeyWordToStringConverter::instance().getSet(); +} + ParserKeyword::ParserKeyword(Keyword keyword) : s(toStringView(keyword)) {} diff --git a/src/Parsers/CommonParsers.h b/src/Parsers/CommonParsers.h index 46e08cf3f7e..ac455bd1c06 100644 --- a/src/Parsers/CommonParsers.h +++ b/src/Parsers/CommonParsers.h @@ -4,6 +4,7 @@ #include #include +#include namespace DB { @@ -588,6 +589,8 @@ std::string_view toStringView(Keyword type); const std::vector & getAllKeyWords(); +const std::unordered_set & getKeyWordSet(); + /** Parse specified keyword such as SELECT or compound keyword such as ORDER BY. * All case insensitive. Requires word boundary. diff --git a/src/Parsers/IAST.cpp b/src/Parsers/IAST.cpp index 54b11f2888e..d6daf9bd78b 100644 --- a/src/Parsers/IAST.cpp +++ b/src/Parsers/IAST.cpp @@ -1,12 +1,14 @@ #include +#include #include #include -#include +#include +#include +#include #include #include - namespace DB { @@ -14,7 +16,6 @@ namespace ErrorCodes { extern const int TOO_BIG_AST; extern const int TOO_DEEP_AST; - extern const int BAD_ARGUMENTS; extern const int UNKNOWN_ELEMENT_IN_AST; } @@ -170,7 +171,7 @@ String IAST::formatWithPossiblyHidingSensitiveData( bool one_line, bool show_secrets, bool print_pretty_type_names, - bool always_quote_identifiers, + IdentifierQuotingRule identifier_quoting_rule, IdentifierQuotingStyle identifier_quoting_style) const { @@ -178,7 +179,7 @@ String IAST::formatWithPossiblyHidingSensitiveData( FormatSettings settings(buf, one_line); settings.show_secrets = show_secrets; settings.print_pretty_type_names = print_pretty_type_names; - settings.always_quote_identifiers = always_quote_identifiers; + settings.identifier_quoting_rule = identifier_quoting_rule; settings.identifier_quoting_style = identifier_quoting_style; format(settings); return wipeSensitiveDataAndCutToLength(buf.str(), max_length); @@ -217,22 +218,24 @@ String IAST::getColumnNameWithoutAlias() const } -void IAST::FormatSettings::writeIdentifier(const String & name) const +void IAST::FormatSettings::writeIdentifier(const String & name, bool ambiguous) const { + bool must_quote + = (identifier_quoting_rule == IdentifierQuotingRule::Always + || (ambiguous && identifier_quoting_rule == IdentifierQuotingRule::WhenNecessary)); + + if (identifier_quoting_rule == IdentifierQuotingRule::UserDisplay && !must_quote) + { + // Quote `name` if it is one of the keywords when `identifier_quoting_rule` is `IdentifierQuotingRule::UserDisplay` + const auto & keyword_set = getKeyWordSet(); + must_quote = keyword_set.contains(Poco::toUpper(name)); + } + switch (identifier_quoting_style) { - case IdentifierQuotingStyle::None: - { - if (always_quote_identifiers) - throw Exception(ErrorCodes::BAD_ARGUMENTS, - "Incompatible arguments: always_quote_identifiers = true && " - "identifier_quoting_style == IdentifierQuotingStyle::None"); - writeString(name, ostr); - break; - } case IdentifierQuotingStyle::Backticks: { - if (always_quote_identifiers) + if (must_quote) writeBackQuotedString(name, ostr); else writeProbablyBackQuotedString(name, ostr); @@ -240,7 +243,7 @@ void IAST::FormatSettings::writeIdentifier(const String & name) const } case IdentifierQuotingStyle::DoubleQuotes: { - if (always_quote_identifiers) + if (must_quote) writeDoubleQuotedString(name, ostr); else writeProbablyDoubleQuotedString(name, ostr); @@ -248,7 +251,7 @@ void IAST::FormatSettings::writeIdentifier(const String & name) const } case IdentifierQuotingStyle::BackticksMySQL: { - if (always_quote_identifiers) + if (must_quote) writeBackQuotedStringMySQL(name, ostr); else writeProbablyBackQuotedStringMySQL(name, ostr); @@ -257,34 +260,6 @@ void IAST::FormatSettings::writeIdentifier(const String & name) const } } - -void IAST::FormatSettings::quoteIdentifier(const String & name) const -{ - switch (identifier_quoting_style) - { - case IdentifierQuotingStyle::None: - { - writeBackQuotedString(name, ostr); - break; - } - case IdentifierQuotingStyle::Backticks: - { - writeBackQuotedString(name, ostr); - break; - } - case IdentifierQuotingStyle::DoubleQuotes: - { - writeDoubleQuotedString(name, ostr); - break; - } - case IdentifierQuotingStyle::BackticksMySQL: - { - writeBackQuotedStringMySQL(name, ostr); - break; - } - } -} - void IAST::dumpTree(WriteBuffer & ostr, size_t indent) const { String indent_str(indent, '-'); diff --git a/src/Parsers/IAST.h b/src/Parsers/IAST.h index dfb6a6cbeba..8bf20c40b70 100644 --- a/src/Parsers/IAST.h +++ b/src/Parsers/IAST.h @@ -196,7 +196,7 @@ public: WriteBuffer & ostr; bool one_line; bool hilite; - bool always_quote_identifiers; + IdentifierQuotingRule identifier_quoting_rule; IdentifierQuotingStyle identifier_quoting_style; bool show_secrets; /// Show secret parts of the AST (e.g. passwords, encryption keys). char nl_or_ws; /// Newline or whitespace. @@ -207,7 +207,7 @@ public: WriteBuffer & ostr_, bool one_line_, bool hilite_ = false, - bool always_quote_identifiers_ = false, + IdentifierQuotingRule identifier_quoting_rule_ = IdentifierQuotingRule::WhenNecessary, IdentifierQuotingStyle identifier_quoting_style_ = IdentifierQuotingStyle::Backticks, bool show_secrets_ = true, LiteralEscapingStyle literal_escaping_style_ = LiteralEscapingStyle::Regular, @@ -215,7 +215,7 @@ public: : ostr(ostr_) , one_line(one_line_) , hilite(hilite_) - , always_quote_identifiers(always_quote_identifiers_) + , identifier_quoting_rule(identifier_quoting_rule_) , identifier_quoting_style(identifier_quoting_style_) , show_secrets(show_secrets_) , nl_or_ws(one_line ? ' ' : '\n') @@ -228,7 +228,7 @@ public: : ostr(ostr_) , one_line(other.one_line) , hilite(other.hilite) - , always_quote_identifiers(other.always_quote_identifiers) + , identifier_quoting_rule(other.identifier_quoting_rule) , identifier_quoting_style(other.identifier_quoting_style) , show_secrets(other.show_secrets) , nl_or_ws(other.nl_or_ws) @@ -237,10 +237,7 @@ public: { } - void writeIdentifier(const String & name) const; - // Quote identifier `name` even when `always_quote_identifiers` is false. - // If `identifier_quoting_style` is `IdentifierQuotingStyle::None`, quote it with `IdentifierQuotingStyle::Backticks` - void quoteIdentifier(const String & name) const; + void writeIdentifier(const String & name, bool ambiguous) const; }; /// State. For example, a set of nodes can be remembered, which we already walk through. @@ -286,7 +283,7 @@ public: bool one_line, bool show_secrets, bool print_pretty_type_names, - bool always_quote_identifiers, + IdentifierQuotingRule identifier_quoting_rule, IdentifierQuotingStyle identifier_quoting_style) const; /** formatForLogging and formatForErrorMessage always hide secrets. This inconsistent @@ -296,12 +293,24 @@ public: */ String formatForLogging(size_t max_length = 0) const { - return formatWithPossiblyHidingSensitiveData(max_length, true, false, false, false, IdentifierQuotingStyle::Backticks); + return formatWithPossiblyHidingSensitiveData( + /*max_length=*/max_length, + /*one_line=*/true, + /*show_secrets=*/false, + /*print_pretty_type_names=*/false, + /*identifier_quoting_rule=*/IdentifierQuotingRule::WhenNecessary, + /*identifier_quoting_style=*/IdentifierQuotingStyle::Backticks); } String formatForErrorMessage() const { - return formatWithPossiblyHidingSensitiveData(0, true, false, false, false, IdentifierQuotingStyle::Backticks); + return formatWithPossiblyHidingSensitiveData( + /*max_length=*/0, + /*one_line=*/true, + /*show_secrets=*/false, + /*print_pretty_type_names=*/false, + /*identifier_quoting_rule=*/IdentifierQuotingRule::WhenNecessary, + /*identifier_quoting_style=*/IdentifierQuotingStyle::Backticks); } virtual bool hasSecretParts() const { return childrenHaveSecretParts(); } diff --git a/src/Parsers/IdentifierQuotingStyle.h b/src/Parsers/IdentifierQuotingStyle.h index 48be809fc8f..b62c9fbe97d 100644 --- a/src/Parsers/IdentifierQuotingStyle.h +++ b/src/Parsers/IdentifierQuotingStyle.h @@ -8,10 +8,19 @@ namespace DB /// NOTE There could be differences in escaping rules inside quotes. Escaping rules may not match that required by specific external DBMS. enum class IdentifierQuotingStyle : uint8_t { - None, /// Write as-is, without quotes. - Backticks, /// `clickhouse` style - DoubleQuotes, /// "postgres" style - BackticksMySQL, /// `mysql` style, most same as Backticks, but it uses '``' to escape '`' + Backticks, /// `clickhouse` style + DoubleQuotes, /// "postgres" style + BackticksMySQL, /// `mysql` style, most same as Backticks, but it uses '``' to escape '`' }; +enum class IdentifierQuotingRule : uint8_t +{ + /// When the identifiers is one of {"distinct", "all", "table"} (defined in `DB::writeProbablyQuotedStringImpl`), + /// or it can cause ambiguity: column names, dictionary attribute names (passed to `DB::FormatSettings::writeIdentifier` with `ambiguous=true`) + WhenNecessary, + /// Always quote identifiers + Always, + /// When the identifiers is a keyword (defined in `DB::Keyword`) + UserDisplay, +}; } diff --git a/src/Parsers/getInsertQuery.cpp b/src/Parsers/getInsertQuery.cpp index 9d111b147bd..398d4fc6b5d 100644 --- a/src/Parsers/getInsertQuery.cpp +++ b/src/Parsers/getInsertQuery.cpp @@ -19,7 +19,12 @@ std::string getInsertQuery(const std::string & db_name, const std::string & tabl query.columns->children.emplace_back(std::make_shared(column.name)); WriteBufferFromOwnString buf; - IAST::FormatSettings settings(buf, /*one_line*/ true, /*hilite*/ false, /*always_quote_identifiers*/ true, /*identifier_quoting_style*/ quoting); + IAST::FormatSettings settings( + /*ostr_=*/buf, + /*one_line=*/true, + /*hilite=*/false, + /*identifier_quoting_rule=*/IdentifierQuotingRule::WhenNecessary, + /*identifier_quoting_style=*/quoting); query.IAST::format(settings); return buf.str(); } diff --git a/src/Processors/QueryPlan/ReadFromRemote.cpp b/src/Processors/QueryPlan/ReadFromRemote.cpp index 7a216ab5716..864bf4d92fc 100644 --- a/src/Processors/QueryPlan/ReadFromRemote.cpp +++ b/src/Processors/QueryPlan/ReadFromRemote.cpp @@ -104,7 +104,8 @@ static String formattedAST(const ASTPtr & ast) return {}; WriteBufferFromOwnString buf; - IAST::FormatSettings ast_format_settings(buf, /*one_line*/ true, /*hilite*/ false, /*always_quote_identifiers*/ true); + IAST::FormatSettings ast_format_settings( + /*ostr_=*/buf, /*one_line=*/true, /*hilite=*/false, /*identifier_quoting_rule=*/IdentifierQuotingRule::Always); ast->format(ast_format_settings); return buf.str(); } diff --git a/src/Storages/StorageDistributed.cpp b/src/Storages/StorageDistributed.cpp index 438c31b5cc3..e90fa32879f 100644 --- a/src/Storages/StorageDistributed.cpp +++ b/src/Storages/StorageDistributed.cpp @@ -23,15 +23,15 @@ #include -#include +#include #include #include #include -#include +#include #include #include -#include -#include +#include +#include #include #include @@ -40,8 +40,9 @@ #include #include #include -#include #include +#include +#include #include #include @@ -1003,7 +1004,8 @@ std::optional StorageDistributed::distributedWriteBetweenDistribu String new_query_str; { WriteBufferFromOwnString buf; - IAST::FormatSettings ast_format_settings(buf, /*one_line*/ true, /*hilite*/ false, /*always_quote_identifiers_=*/ true); + IAST::FormatSettings ast_format_settings( + /*ostr_=*/buf, /*one_line*/ true, /*hilite*/ false, /*identifier_quoting_rule_=*/IdentifierQuotingRule::Always); new_query->IAST::format(ast_format_settings); new_query_str = buf.str(); } @@ -1123,7 +1125,8 @@ std::optional StorageDistributed::distributedWriteFromClusterStor String new_query_str; { WriteBufferFromOwnString buf; - IAST::FormatSettings ast_format_settings(buf, /*one_line*/ true, /*hilite*/ false, /*always_quote_identifiers*/ true); + IAST::FormatSettings ast_format_settings( + /*ostr_=*/buf, /*one_line=*/true, /*hilite=*/false, /*identifier_quoting_rule=*/IdentifierQuotingRule::Always); new_query->IAST::format(ast_format_settings); new_query_str = buf.str(); } diff --git a/src/Storages/StorageReplicatedMergeTree.cpp b/src/Storages/StorageReplicatedMergeTree.cpp index 44bd6ba87f0..ec90aba6430 100644 --- a/src/Storages/StorageReplicatedMergeTree.cpp +++ b/src/Storages/StorageReplicatedMergeTree.cpp @@ -5720,7 +5720,8 @@ std::optional StorageReplicatedMergeTree::distributedWriteFromClu String query_str; { WriteBufferFromOwnString buf; - IAST::FormatSettings ast_format_settings(buf, /*one_line*/ true, /*hilite*/ false, /*always_quote_identifiers*/ true); + IAST::FormatSettings ast_format_settings( + /*ostr_=*/buf, /*one_line=*/true, /*hilite=*/false, /*identifier_quoting_rule=*/IdentifierQuotingRule::Always); query.IAST::format(ast_format_settings); query_str = buf.str(); } diff --git a/src/Storages/transformQueryForExternalDatabase.cpp b/src/Storages/transformQueryForExternalDatabase.cpp index 0cf4f706b9c..fa98dfe036f 100644 --- a/src/Storages/transformQueryForExternalDatabase.cpp +++ b/src/Storages/transformQueryForExternalDatabase.cpp @@ -386,13 +386,16 @@ String transformQueryForExternalDatabaseImpl( ASTPtr select_ptr = select; dropAliases(select_ptr); - + IdentifierQuotingRule identifier_quoting_rule = IdentifierQuotingRule::Always; WriteBufferFromOwnString out; IAST::FormatSettings settings( - out, /*one_line*/ true, /*hilite*/ false, - /*always_quote_identifiers*/ identifier_quoting_style != IdentifierQuotingStyle::None, - /*identifier_quoting_style*/ identifier_quoting_style, /*show_secrets_*/ true, - /*literal_escaping_style*/ literal_escaping_style); + /*ostr_=*/out, + /*one_line=*/true, + /*hilite=*/false, + /*identifier_quoting_rule=*/identifier_quoting_rule, + /*identifier_quoting_style=*/identifier_quoting_style, + /*show_secrets_=*/true, + /*literal_escaping_style=*/literal_escaping_style); select->format(settings); diff --git a/tests/integration/test_storage_kafka/test.py b/tests/integration/test_storage_kafka/test.py index bef90e1b9d3..e4589618863 100644 --- a/tests/integration/test_storage_kafka/test.py +++ b/tests/integration/test_storage_kafka/test.py @@ -1890,7 +1890,15 @@ def test_kafka_recreate_kafka_table(kafka_cluster, create_query_generator, log_l ) # data was not flushed yet (it will be flushed 7.5 sec after creating MV) - assert int(instance.query("SELECT count() FROM test.view")) == 240 + assert ( + int( + instance.query_with_retry( + sql="SELECT count() FROM test.view", + check_callback=lambda x: x == 240, + ) + ) + == 240 + ) instance.query( """ 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 deleted file mode 100644 index c563617a01c..00000000000 --- a/tests/queries/0_stateless/03230_output_format_identifier_quoting_style.reference +++ /dev/null @@ -1,40 +0,0 @@ -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()) -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()) -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()) -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()) -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()) -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()) -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()) -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()) 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 deleted file mode 100644 index c500dd4e4c6..00000000000 --- a/tests/queries/0_stateless/03230_output_format_identifier_quoting_style.sql +++ /dev/null @@ -1,328 +0,0 @@ -DROP DICTIONARY IF EXISTS uk_mortgage_rates_dict; -DROP TABLE IF EXISTS uk_mortgage_rates; -DROP VIEW IF EXISTS uk_prices_aggs_view; -DROP TABLE IF EXISTS uk_prices_aggs_dest; -DROP VIEW IF EXISTS prices_by_year_view; -DROP TABLE IF EXISTS prices_by_year_dest; -DROP TABLE IF EXISTS uk_price_paid; - --- Create tables, views, dictionaries - -CREATE TABLE uk_price_paid -( - price UInt32, - date Date, - postcode1 LowCardinality(String), - postcode2 LowCardinality(String), - type Enum('terraced' = 1, 'semi-detached' = 2, 'detached' = 3, 'flat' = 4, 'other' = 0), - is_new UInt8, - duration Enum('freehold' = 1, 'leasehold' = 2, 'unknown' = 0), - addr1 String, - addr2 String, - street LowCardinality(String), - locality LowCardinality(String), - town LowCardinality(String), - district LowCardinality(String), - county LowCardinality(String), - INDEX county_index county TYPE set(10) GRANULARITY 1, - PROJECTION town_date_projection - ( - SELECT - town, - date, - price - ORDER BY - town, - date - ), - PROJECTION handy_aggs_projection - ( - SELECT - avg(price), - max(price), - sum(price) - GROUP BY town - ) -) -ENGINE = MergeTree -ORDER BY (postcode1, postcode2, date); - -CREATE TABLE prices_by_year_dest ( - price UInt32, - date Date, - addr1 String, - addr2 String, - street LowCardinality(String), - town LowCardinality(String), - district LowCardinality(String), - county LowCardinality(String) -) -ENGINE = MergeTree -PRIMARY KEY (town, date) -PARTITION BY toYear(date); - -CREATE MATERIALIZED VIEW prices_by_year_view -TO prices_by_year_dest -AS - SELECT - price, - date, - addr1, - addr2, - street, - town, - district, - county - FROM uk_price_paid; - -CREATE TABLE uk_prices_aggs_dest ( - month Date, - min_price SimpleAggregateFunction(min, UInt32), - max_price SimpleAggregateFunction(max, UInt32), - volume AggregateFunction(count, UInt32), - avg_price AggregateFunction(avg, UInt32) -) -ENGINE = AggregatingMergeTree -PRIMARY KEY month; - -CREATE MATERIALIZED VIEW uk_prices_aggs_view -TO uk_prices_aggs_dest -AS - WITH - toStartOfMonth(date) AS month - SELECT - month, - minSimpleState(price) AS min_price, - maxSimpleState(price) AS max_price, - countState(price) AS volume, - avgState(price) AS avg_price - FROM uk_price_paid - GROUP BY month; - -CREATE TABLE uk_mortgage_rates ( - date DateTime64, - variable Decimal32(2), - fixed Decimal32(2), - bank Decimal32(2) -) -ENGINE Memory(); - -INSERT INTO uk_mortgage_rates VALUES ('2004-02-29', 5.02, 4.9, 4); -INSERT INTO uk_mortgage_rates VALUES ('2004-03-31', 5.11, 4.91, 4); - -CREATE DICTIONARY uk_mortgage_rates_dict ( - date DateTime64, - variable Decimal32(2), - fixed Decimal32(2), - bank Decimal32(2) -) -PRIMARY KEY date -SOURCE( - CLICKHOUSE(TABLE 'uk_mortgage_rates') -) -LAYOUT(COMPLEX_KEY_HASHED()) -LIFETIME(2628000000); - - --- Show tables, views, dictionaries with default settings -SHOW CREATE TABLE uk_price_paid; - -SHOW CREATE VIEW prices_by_year_view; - -SHOW CREATE uk_prices_aggs_dest; - -SHOW CREATE VIEW uk_prices_aggs_view; - -SHOW CREATE DICTIONARY uk_mortgage_rates_dict; - - --- Show tables, views, dictionaries with output_format_always_quote_identifiers=false, output_format_identifier_quoting_style='None' -SHOW CREATE TABLE uk_price_paid -SETTINGS - output_format_always_quote_identifiers=false, - output_format_identifier_quoting_style='None'; - -SHOW CREATE VIEW prices_by_year_view -SETTINGS - output_format_always_quote_identifiers=false, - output_format_identifier_quoting_style='None'; - -SHOW CREATE uk_prices_aggs_dest -SETTINGS - output_format_always_quote_identifiers=false, - output_format_identifier_quoting_style='None'; - -SHOW CREATE VIEW uk_prices_aggs_view -SETTINGS - output_format_always_quote_identifiers=false, - output_format_identifier_quoting_style='None'; - -SHOW CREATE DICTIONARY uk_mortgage_rates_dict -SETTINGS - output_format_always_quote_identifiers=false, - output_format_identifier_quoting_style='None'; - --- Show tables, views, dictionaries with output_format_always_quote_identifiers=true, output_format_identifier_quoting_style='Backticks' -SHOW CREATE TABLE uk_price_paid -SETTINGS - output_format_always_quote_identifiers=true, - output_format_identifier_quoting_style='Backticks'; - -SHOW CREATE VIEW prices_by_year_view -SETTINGS - output_format_always_quote_identifiers=true, - output_format_identifier_quoting_style='Backticks'; - -SHOW CREATE uk_prices_aggs_dest -SETTINGS - output_format_always_quote_identifiers=true, - output_format_identifier_quoting_style='Backticks'; - -SHOW CREATE VIEW uk_prices_aggs_view -SETTINGS - output_format_always_quote_identifiers=true, - output_format_identifier_quoting_style='Backticks'; - -SHOW CREATE DICTIONARY uk_mortgage_rates_dict -SETTINGS - output_format_always_quote_identifiers=true, - output_format_identifier_quoting_style='Backticks'; - --- Show tables, views, dictionaries with output_format_always_quote_identifiers=false, output_format_identifier_quoting_style='Backticks' -SHOW CREATE TABLE uk_price_paid -SETTINGS - output_format_always_quote_identifiers=false, - output_format_identifier_quoting_style='Backticks'; - -SHOW CREATE VIEW prices_by_year_view -SETTINGS - output_format_always_quote_identifiers=false, - output_format_identifier_quoting_style='Backticks'; - -SHOW CREATE uk_prices_aggs_dest -SETTINGS - output_format_always_quote_identifiers=false, - output_format_identifier_quoting_style='Backticks'; - -SHOW CREATE VIEW uk_prices_aggs_view -SETTINGS - output_format_always_quote_identifiers=false, - output_format_identifier_quoting_style='Backticks'; - -SHOW CREATE DICTIONARY uk_mortgage_rates_dict -SETTINGS - output_format_always_quote_identifiers=false, - output_format_identifier_quoting_style='Backticks'; - --- Show tables, views, dictionaries with output_format_always_quote_identifiers=true, output_format_identifier_quoting_style='DoubleQuotes' -SHOW CREATE TABLE uk_price_paid -SETTINGS - output_format_always_quote_identifiers=true, - output_format_identifier_quoting_style='DoubleQuotes'; - -SHOW CREATE VIEW prices_by_year_view -SETTINGS - output_format_always_quote_identifiers=true, - output_format_identifier_quoting_style='DoubleQuotes'; - -SHOW CREATE uk_prices_aggs_dest -SETTINGS - output_format_always_quote_identifiers=true, - output_format_identifier_quoting_style='DoubleQuotes'; - -SHOW CREATE VIEW uk_prices_aggs_view -SETTINGS - output_format_always_quote_identifiers=true, - output_format_identifier_quoting_style='DoubleQuotes'; - -SHOW CREATE DICTIONARY uk_mortgage_rates_dict -SETTINGS - output_format_always_quote_identifiers=true, - output_format_identifier_quoting_style='DoubleQuotes'; - --- Show tables, views, dictionaries with output_format_always_quote_identifiers=false, output_format_identifier_quoting_style='DoubleQuotes' -SHOW CREATE TABLE uk_price_paid -SETTINGS - output_format_always_quote_identifiers=false, - output_format_identifier_quoting_style='DoubleQuotes'; - -SHOW CREATE VIEW prices_by_year_view -SETTINGS - output_format_always_quote_identifiers=false, - output_format_identifier_quoting_style='DoubleQuotes'; - -SHOW CREATE uk_prices_aggs_dest -SETTINGS - output_format_always_quote_identifiers=false, - output_format_identifier_quoting_style='DoubleQuotes'; - -SHOW CREATE VIEW uk_prices_aggs_view -SETTINGS - output_format_always_quote_identifiers=false, - output_format_identifier_quoting_style='DoubleQuotes'; - -SHOW CREATE DICTIONARY uk_mortgage_rates_dict -SETTINGS - output_format_always_quote_identifiers=false, - output_format_identifier_quoting_style='DoubleQuotes'; - - --- Show tables, views, dictionaries with output_format_always_quote_identifiers=true, output_format_identifier_quoting_style='BackticksMySQL' -SHOW CREATE TABLE uk_price_paid -SETTINGS - output_format_always_quote_identifiers=true, - output_format_identifier_quoting_style='BackticksMySQL'; - -SHOW CREATE VIEW prices_by_year_view -SETTINGS - output_format_always_quote_identifiers=true, - output_format_identifier_quoting_style='BackticksMySQL'; - -SHOW CREATE uk_prices_aggs_dest -SETTINGS - output_format_always_quote_identifiers=true, - output_format_identifier_quoting_style='BackticksMySQL'; - -SHOW CREATE VIEW uk_prices_aggs_view -SETTINGS - output_format_always_quote_identifiers=true, - output_format_identifier_quoting_style='BackticksMySQL'; - -SHOW CREATE DICTIONARY uk_mortgage_rates_dict -SETTINGS - output_format_always_quote_identifiers=true, - output_format_identifier_quoting_style='BackticksMySQL'; - --- Show tables, views, dictionaries with output_format_always_quote_identifiers=false, output_format_identifier_quoting_style='BackticksMySQL' -SHOW CREATE TABLE uk_price_paid -SETTINGS - output_format_always_quote_identifiers=false, - output_format_identifier_quoting_style='BackticksMySQL'; - -SHOW CREATE VIEW prices_by_year_view -SETTINGS - output_format_always_quote_identifiers=false, - output_format_identifier_quoting_style='BackticksMySQL'; - -SHOW CREATE uk_prices_aggs_dest -SETTINGS - output_format_always_quote_identifiers=false, - output_format_identifier_quoting_style='BackticksMySQL'; - -SHOW CREATE VIEW uk_prices_aggs_view -SETTINGS - output_format_always_quote_identifiers=false, - output_format_identifier_quoting_style='BackticksMySQL'; - -SHOW CREATE DICTIONARY uk_mortgage_rates_dict -SETTINGS - output_format_always_quote_identifiers=false, - output_format_identifier_quoting_style='BackticksMySQL'; - -DROP DICTIONARY uk_mortgage_rates_dict; -DROP TABLE uk_mortgage_rates; -DROP VIEW uk_prices_aggs_view; -DROP TABLE uk_prices_aggs_dest; -DROP VIEW prices_by_year_view; -DROP TABLE prices_by_year_dest; -DROP TABLE uk_price_paid; diff --git a/tests/queries/0_stateless/03230_show_create_query_identifier_quoting_style.reference b/tests/queries/0_stateless/03230_show_create_query_identifier_quoting_style.reference new file mode 100644 index 00000000000..c0e3dc474d8 --- /dev/null +++ b/tests/queries/0_stateless/03230_show_create_query_identifier_quoting_style.reference @@ -0,0 +1,60 @@ +Settings: default +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 `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: 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: 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: 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: 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: 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: 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_show_create_query_identifier_quoting_style.sql b/tests/queries/0_stateless/03230_show_create_query_identifier_quoting_style.sql new file mode 100644 index 00000000000..044b3a41f48 --- /dev/null +++ b/tests/queries/0_stateless/03230_show_create_query_identifier_quoting_style.sql @@ -0,0 +1,388 @@ +DROP DICTIONARY IF EXISTS uk_mortgage_rates_dict; +DROP TABLE IF EXISTS uk_mortgage_rates; +DROP VIEW IF EXISTS uk_prices_aggs_view; +DROP TABLE IF EXISTS uk_prices_aggs_dest; +DROP VIEW IF EXISTS prices_by_year_view; +DROP TABLE IF EXISTS prices_by_year_dest; +DROP TABLE IF EXISTS uk_price_paid; + +-- Create tables, views, dictionaries + +CREATE TABLE uk_price_paid +( + Table String, + Engine String, + price UInt32, + date Date, + postcode1 LowCardinality(String), + postcode2 LowCardinality(String), + type Enum('terraced' = 1, 'semi-detached' = 2, 'detached' = 3, 'flat' = 4, 'other' = 0), + is_new UInt8, + duration Enum('freehold' = 1, 'leasehold' = 2, 'unknown' = 0), + addr1 String, + addr2 String, + street LowCardinality(String), + locality LowCardinality(String), + town LowCardinality(String), + district LowCardinality(String), + county LowCardinality(String), + INDEX county_index county TYPE set(10) GRANULARITY 1, + PROJECTION town_date_projection + ( + SELECT + town, + date, + price + ORDER BY + town, + date + ), + PROJECTION handy_aggs_projection + ( + SELECT + avg(price), + max(price), + sum(price) + GROUP BY town + ) +) +ENGINE = MergeTree +ORDER BY (postcode1, postcode2, date); + +CREATE TABLE prices_by_year_dest ( + Table String, + Engine String, + price UInt32, + date Date, + addr1 String, + addr2 String, + street LowCardinality(String), + town LowCardinality(String), + district LowCardinality(String), + county LowCardinality(String) +) +ENGINE = MergeTree +PRIMARY KEY (town, date) +PARTITION BY toYear(date); + +CREATE MATERIALIZED VIEW prices_by_year_view +TO prices_by_year_dest +AS + SELECT + price, + date, + addr1, + addr2, + street, + town, + district, + county + FROM uk_price_paid; + +CREATE TABLE uk_prices_aggs_dest ( + month Date, + min_price SimpleAggregateFunction(min, UInt32), + max_price SimpleAggregateFunction(max, UInt32), + volume AggregateFunction(count, UInt32), + avg_price AggregateFunction(avg, UInt32) +) +ENGINE = AggregatingMergeTree +PRIMARY KEY month; + +CREATE MATERIALIZED VIEW uk_prices_aggs_view +TO uk_prices_aggs_dest +AS + WITH + toStartOfMonth(date) AS month + SELECT + month, + minSimpleState(price) AS min_price, + maxSimpleState(price) AS max_price, + countState(price) AS volume, + avgState(price) AS avg_price + FROM uk_price_paid + GROUP BY month; + +CREATE TABLE uk_mortgage_rates ( + date DateTime64, + variable Decimal32(2), + fixed Decimal32(2), + bank Decimal32(2) +) +ENGINE Memory(); + +INSERT INTO uk_mortgage_rates VALUES ('2004-02-29', 5.02, 4.9, 4); +INSERT INTO uk_mortgage_rates VALUES ('2004-03-31', 5.11, 4.91, 4); + +CREATE DICTIONARY uk_mortgage_rates_dict ( + date DateTime64, + variable Decimal32(2), + fixed Decimal32(2), + bank Decimal32(2) +) +PRIMARY KEY date +SOURCE( + CLICKHOUSE(TABLE 'uk_mortgage_rates') +) +LAYOUT(COMPLEX_KEY_HASHED()) +LIFETIME(2628000000); + + +-- Show tables, views, dictionaries with default settings +SELECT('Settings: default'); +SHOW CREATE TABLE uk_price_paid; +SHOW CREATE VIEW prices_by_year_view; +SHOW CREATE uk_prices_aggs_dest; +SHOW CREATE VIEW uk_prices_aggs_view; +SHOW CREATE DICTIONARY uk_mortgage_rates_dict; + +-- Show tables, views, dictionaries with show_create_query_identifier_quoting_rule='always', show_create_query_identifier_quoting_style='Backticks' +SELECT('Settings: always & Backticks'); +SHOW CREATE TABLE uk_price_paid +SETTINGS + show_create_query_identifier_quoting_rule='always', + show_create_query_identifier_quoting_style='Backticks'; + +SHOW CREATE VIEW prices_by_year_view +SETTINGS + show_create_query_identifier_quoting_rule='always', + show_create_query_identifier_quoting_style='Backticks'; + +SHOW CREATE uk_prices_aggs_dest +SETTINGS + show_create_query_identifier_quoting_rule='always', + show_create_query_identifier_quoting_style='Backticks'; + +SHOW CREATE VIEW uk_prices_aggs_view +SETTINGS + show_create_query_identifier_quoting_rule='always', + show_create_query_identifier_quoting_style='Backticks'; + +SHOW CREATE DICTIONARY uk_mortgage_rates_dict +SETTINGS + show_create_query_identifier_quoting_rule='always', + show_create_query_identifier_quoting_style='Backticks'; + +-- Show tables, views, dictionaries with show_create_query_identifier_quoting_rule='user_display', show_create_query_identifier_quoting_style='Backticks' +SELECT('Settings: user_display & Backticks'); +SHOW CREATE TABLE uk_price_paid +SETTINGS + show_create_query_identifier_quoting_rule='user_display', + show_create_query_identifier_quoting_style='Backticks'; + +SHOW CREATE VIEW prices_by_year_view +SETTINGS + show_create_query_identifier_quoting_rule='user_display', + show_create_query_identifier_quoting_style='Backticks'; + +SHOW CREATE uk_prices_aggs_dest +SETTINGS + show_create_query_identifier_quoting_rule='user_display', + show_create_query_identifier_quoting_style='Backticks'; + +SHOW CREATE VIEW uk_prices_aggs_view +SETTINGS + show_create_query_identifier_quoting_rule='user_display', + show_create_query_identifier_quoting_style='Backticks'; + +SHOW CREATE DICTIONARY uk_mortgage_rates_dict +SETTINGS + show_create_query_identifier_quoting_rule='user_display', + show_create_query_identifier_quoting_style='Backticks'; + +-- Show tables, views, dictionaries with show_create_query_identifier_quoting_rule='when_necessary', show_create_query_identifier_quoting_style='Backticks' +SELECT('Settings: when_necessary & Backticks'); +SHOW CREATE TABLE uk_price_paid +SETTINGS + show_create_query_identifier_quoting_rule='when_necessary', + show_create_query_identifier_quoting_style='Backticks'; + +SHOW CREATE VIEW prices_by_year_view +SETTINGS + show_create_query_identifier_quoting_rule='when_necessary', + show_create_query_identifier_quoting_style='Backticks'; + +SHOW CREATE uk_prices_aggs_dest +SETTINGS + show_create_query_identifier_quoting_rule='when_necessary', + show_create_query_identifier_quoting_style='Backticks'; + +SHOW CREATE VIEW uk_prices_aggs_view +SETTINGS + show_create_query_identifier_quoting_rule='when_necessary', + show_create_query_identifier_quoting_style='Backticks'; + +SHOW CREATE DICTIONARY uk_mortgage_rates_dict +SETTINGS + show_create_query_identifier_quoting_rule='when_necessary', + show_create_query_identifier_quoting_style='Backticks'; + +-- Show tables, views, dictionaries with show_create_query_identifier_quoting_rule='always', show_create_query_identifier_quoting_style='DoubleQuotes' +SELECT('Settings: always & DoubleQuotes'); +SHOW CREATE TABLE uk_price_paid +SETTINGS + show_create_query_identifier_quoting_rule='always', + show_create_query_identifier_quoting_style='DoubleQuotes'; + +SHOW CREATE VIEW prices_by_year_view +SETTINGS + show_create_query_identifier_quoting_rule='always', + show_create_query_identifier_quoting_style='DoubleQuotes'; + +SHOW CREATE uk_prices_aggs_dest +SETTINGS + show_create_query_identifier_quoting_rule='always', + show_create_query_identifier_quoting_style='DoubleQuotes'; + +SHOW CREATE VIEW uk_prices_aggs_view +SETTINGS + show_create_query_identifier_quoting_rule='always', + show_create_query_identifier_quoting_style='DoubleQuotes'; + +SHOW CREATE DICTIONARY uk_mortgage_rates_dict +SETTINGS + show_create_query_identifier_quoting_rule='always', + show_create_query_identifier_quoting_style='DoubleQuotes'; + +-- Show tables, views, dictionaries with show_create_query_identifier_quoting_rule='user_display', show_create_query_identifier_quoting_style='DoubleQuotes' +SELECT('Settings: user_display & DoubleQuotes'); +SHOW CREATE TABLE uk_price_paid +SETTINGS + show_create_query_identifier_quoting_rule='user_display', + show_create_query_identifier_quoting_style='DoubleQuotes'; + +SHOW CREATE VIEW prices_by_year_view +SETTINGS + show_create_query_identifier_quoting_rule='user_display', + show_create_query_identifier_quoting_style='DoubleQuotes'; + +SHOW CREATE uk_prices_aggs_dest +SETTINGS + show_create_query_identifier_quoting_rule='user_display', + show_create_query_identifier_quoting_style='DoubleQuotes'; + +SHOW CREATE VIEW uk_prices_aggs_view +SETTINGS + show_create_query_identifier_quoting_rule='user_display', + show_create_query_identifier_quoting_style='DoubleQuotes'; + +SHOW CREATE DICTIONARY uk_mortgage_rates_dict +SETTINGS + show_create_query_identifier_quoting_rule='user_display', + show_create_query_identifier_quoting_style='DoubleQuotes'; + +-- Show tables, views, dictionaries with show_create_query_identifier_quoting_rule='when_necessary', show_create_query_identifier_quoting_style='DoubleQuotes' +SELECT('Settings: when_necessary & DoubleQuotes'); +SHOW CREATE TABLE uk_price_paid +SETTINGS + show_create_query_identifier_quoting_rule='when_necessary', + show_create_query_identifier_quoting_style='DoubleQuotes'; + +SHOW CREATE VIEW prices_by_year_view +SETTINGS + show_create_query_identifier_quoting_rule='when_necessary', + show_create_query_identifier_quoting_style='DoubleQuotes'; + +SHOW CREATE uk_prices_aggs_dest +SETTINGS + show_create_query_identifier_quoting_rule='when_necessary', + show_create_query_identifier_quoting_style='DoubleQuotes'; + +SHOW CREATE VIEW uk_prices_aggs_view +SETTINGS + show_create_query_identifier_quoting_rule='when_necessary', + show_create_query_identifier_quoting_style='DoubleQuotes'; + +SHOW CREATE DICTIONARY uk_mortgage_rates_dict +SETTINGS + show_create_query_identifier_quoting_rule='when_necessary', + show_create_query_identifier_quoting_style='DoubleQuotes'; + +-- Show tables, views, dictionaries with show_create_query_identifier_quoting_rule='always', show_create_query_identifier_quoting_style='BackticksMySQL' +SELECT('Settings: always & BackticksMySQL'); +SHOW CREATE TABLE uk_price_paid +SETTINGS + show_create_query_identifier_quoting_rule='always', + show_create_query_identifier_quoting_style='BackticksMySQL'; + +SHOW CREATE VIEW prices_by_year_view +SETTINGS + show_create_query_identifier_quoting_rule='always', + show_create_query_identifier_quoting_style='BackticksMySQL'; + +SHOW CREATE uk_prices_aggs_dest +SETTINGS + show_create_query_identifier_quoting_rule='always', + show_create_query_identifier_quoting_style='BackticksMySQL'; + +SHOW CREATE VIEW uk_prices_aggs_view +SETTINGS + show_create_query_identifier_quoting_rule='always', + show_create_query_identifier_quoting_style='BackticksMySQL'; + +SHOW CREATE DICTIONARY uk_mortgage_rates_dict +SETTINGS + show_create_query_identifier_quoting_rule='always', + show_create_query_identifier_quoting_style='BackticksMySQL'; + +-- Show tables, views, dictionaries with show_create_query_identifier_quoting_rule='user_display', show_create_query_identifier_quoting_style='BackticksMySQL' +SELECT('Settings: user_display & BackticksMySQL'); +SHOW CREATE TABLE uk_price_paid +SETTINGS + show_create_query_identifier_quoting_rule='user_display', + show_create_query_identifier_quoting_style='BackticksMySQL'; + +SHOW CREATE VIEW prices_by_year_view +SETTINGS + show_create_query_identifier_quoting_rule='user_display', + show_create_query_identifier_quoting_style='BackticksMySQL'; + +SHOW CREATE uk_prices_aggs_dest +SETTINGS + show_create_query_identifier_quoting_rule='user_display', + show_create_query_identifier_quoting_style='BackticksMySQL'; + +SHOW CREATE VIEW uk_prices_aggs_view +SETTINGS + show_create_query_identifier_quoting_rule='user_display', + show_create_query_identifier_quoting_style='BackticksMySQL'; + +SHOW CREATE DICTIONARY uk_mortgage_rates_dict +SETTINGS + show_create_query_identifier_quoting_rule='user_display', + show_create_query_identifier_quoting_style='BackticksMySQL'; + +-- Show tables, views, dictionaries with show_create_query_identifier_quoting_rule='when_necessary', show_create_query_identifier_quoting_style='BackticksMySQL' +SELECT('Settings: when_necessary & BackticksMySQL'); +SHOW CREATE TABLE uk_price_paid +SETTINGS + show_create_query_identifier_quoting_rule='when_necessary', + show_create_query_identifier_quoting_style='BackticksMySQL'; + +SHOW CREATE VIEW prices_by_year_view +SETTINGS + show_create_query_identifier_quoting_rule='when_necessary', + show_create_query_identifier_quoting_style='BackticksMySQL'; + +SHOW CREATE uk_prices_aggs_dest +SETTINGS + show_create_query_identifier_quoting_rule='when_necessary', + show_create_query_identifier_quoting_style='BackticksMySQL'; + +SHOW CREATE VIEW uk_prices_aggs_view +SETTINGS + show_create_query_identifier_quoting_rule='when_necessary', + show_create_query_identifier_quoting_style='BackticksMySQL'; + +SHOW CREATE DICTIONARY uk_mortgage_rates_dict +SETTINGS + show_create_query_identifier_quoting_rule='when_necessary', + show_create_query_identifier_quoting_style='BackticksMySQL'; + +DROP DICTIONARY uk_mortgage_rates_dict; +DROP TABLE uk_mortgage_rates; +DROP VIEW uk_prices_aggs_view; +DROP TABLE uk_prices_aggs_dest; +DROP VIEW prices_by_year_view; +DROP TABLE prices_by_year_dest; +DROP TABLE uk_price_paid; diff --git a/utils/check-style/aspell-ignore/en/aspell-dict.txt b/utils/check-style/aspell-ignore/en/aspell-dict.txt index 982b7f8e60b..ed258f94c29 100644 --- a/utils/check-style/aspell-ignore/en/aspell-dict.txt +++ b/utils/check-style/aspell-ignore/en/aspell-dict.txt @@ -3036,3 +3036,4 @@ znode znodes zookeeperSessionUptime zstd +postgres \ No newline at end of file