mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-17 11:52:27 +00:00
Merge branch 'master' into morton-utils
This commit is contained in:
commit
007da39bbf
@ -61,17 +61,17 @@ FROM table
|
||||
SETTINGS use_query_cache = true, enable_writes_to_query_cache = false;
|
||||
```
|
||||
|
||||
For maximum control, it is generally recommended to provide settings "use_query_cache", "enable_writes_to_query_cache" and
|
||||
"enable_reads_from_query_cache" only with specific queries. It is also possible to enable caching at user or profile level (e.g. via `SET
|
||||
For maximum control, it is generally recommended to provide settings `use_query_cache`, `enable_writes_to_query_cache` and
|
||||
`enable_reads_from_query_cache` only with specific queries. It is also possible to enable caching at user or profile level (e.g. via `SET
|
||||
use_query_cache = true`) but one should keep in mind that all `SELECT` queries including monitoring or debugging queries to system tables
|
||||
may return cached results then.
|
||||
|
||||
The query cache can be cleared using statement `SYSTEM DROP QUERY CACHE`. The content of the query cache is displayed in system table
|
||||
`system.query_cache`. The number of query cache hits and misses since database start are shown as events "QueryCacheHits" and
|
||||
"QueryCacheMisses" in system table [system.events](system-tables/events.md). Both counters are only updated for `SELECT` queries which run
|
||||
with setting `use_query_cache = true`, other queries do not affect "QueryCacheMisses". Field `query_cache_usage` in system table
|
||||
[system.query_log](system-tables/query_log.md) shows for each executed query whether the query result was written into or read from the
|
||||
query cache. Asynchronous metrics "QueryCacheEntries" and "QueryCacheBytes" in system table
|
||||
[system.query_cache](system-tables/query_cache.md). The number of query cache hits and misses since database start are shown as events
|
||||
"QueryCacheHits" and "QueryCacheMisses" in system table [system.events](system-tables/events.md). Both counters are only updated for
|
||||
`SELECT` queries which run with setting `use_query_cache = true`, other queries do not affect "QueryCacheMisses". Field `query_cache_usage`
|
||||
in system table [system.query_log](system-tables/query_log.md) shows for each executed query whether the query result was written into or
|
||||
read from the query cache. Asynchronous metrics "QueryCacheEntries" and "QueryCacheBytes" in system table
|
||||
[system.asynchronous_metrics](system-tables/asynchronous_metrics.md) show how many entries / bytes the query cache currently contains.
|
||||
|
||||
The query cache exists once per ClickHouse server process. However, cache results are by default not shared between users. This can be
|
||||
@ -86,9 +86,18 @@ If the query was aborted due to an exception or user cancellation, no entry is w
|
||||
The size of the query cache in bytes, the maximum number of cache entries and the maximum size of individual cache entries (in bytes and in
|
||||
records) can be configured using different [server configuration options](server-configuration-parameters/settings.md#server_configuration_parameters_query-cache).
|
||||
|
||||
```xml
|
||||
<query_cache>
|
||||
<max_size_in_bytes>1073741824</max_size_in_bytes>
|
||||
<max_entries>1024</max_entries>
|
||||
<max_entry_size_in_bytes>1048576</max_entry_size_in_bytes>
|
||||
<max_entry_size_in_rows>30000000</max_entry_size_in_rows>
|
||||
</query_cache>
|
||||
```
|
||||
|
||||
It is also possible to limit the cache usage of individual users using [settings profiles](settings/settings-profiles.md) and [settings
|
||||
constraints](settings/constraints-on-settings.md). More specifically, you can restrict the maximum amount of memory (in bytes) a user may
|
||||
allocate in the query cache and the the maximum number of stored query results. For that, first provide configurations
|
||||
allocate in the query cache and the maximum number of stored query results. For that, first provide configurations
|
||||
[query_cache_max_size_in_bytes](settings/settings.md#query-cache-max-size-in-bytes) and
|
||||
[query_cache_max_entries](settings/settings.md#query-cache-size-max-entries) in a user profile in `users.xml`, then make both settings
|
||||
readonly:
|
||||
@ -158,6 +167,7 @@ Also, results of queries with non-deterministic functions are not cached by defa
|
||||
- functions which depend on the environment: [`currentUser()`](../sql-reference/functions/other-functions.md#currentUser),
|
||||
[`queryID()`](../sql-reference/functions/other-functions.md#queryID),
|
||||
[`getMacro()`](../sql-reference/functions/other-functions.md#getMacro) etc.
|
||||
|
||||
To force caching of results of queries with non-deterministic functions regardless, use setting
|
||||
[query_cache_store_results_of_queries_with_nondeterministic_functions](settings/settings.md#query-cache-store-results-of-queries-with-nondeterministic-functions).
|
||||
|
||||
|
@ -1396,23 +1396,6 @@ For more information, see the section [Creating replicated tables](../../engines
|
||||
<macros incl="macros" optional="true" />
|
||||
```
|
||||
|
||||
## replica_group_name {#replica_group_name}
|
||||
|
||||
Replica group name for database Replicated.
|
||||
|
||||
The cluster created by Replicated database will consist of replicas in the same group.
|
||||
DDL queries will only wail for the replicas in the same group.
|
||||
|
||||
Empty by default.
|
||||
|
||||
**Example**
|
||||
|
||||
``` xml
|
||||
<replica_group_name>backups</replica_group_name>
|
||||
```
|
||||
|
||||
Default value: ``.
|
||||
|
||||
## max_open_files {#max-open-files}
|
||||
|
||||
The maximum number of open files.
|
||||
@ -2420,7 +2403,8 @@ This section contains the following parameters:
|
||||
- zookeeper_load_balancing - Specifies the algorithm of ZooKeeper node selection.
|
||||
* random - randomly selects one of ZooKeeper nodes.
|
||||
* in_order - selects the first ZooKeeper node, if it's not available then the second, and so on.
|
||||
* nearest_hostname - selects a ZooKeeper node with a hostname that is most similar to the server’s hostname.
|
||||
* nearest_hostname - selects a ZooKeeper node with a hostname that is most similar to the server’s hostname, hostname is compared with name prefix.
|
||||
* hostname_levenshtein_distance - just like nearest_hostname, but it compares hostname in a levenshtein distance manner.
|
||||
* first_or_random - selects the first ZooKeeper node, if it's not available then randomly selects one of remaining ZooKeeper nodes.
|
||||
* round_robin - selects the first ZooKeeper node, if reconnection happens selects the next.
|
||||
|
||||
@ -2442,7 +2426,7 @@ This section contains the following parameters:
|
||||
<root>/path/to/zookeeper/node</root>
|
||||
<!-- Optional. Zookeeper digest ACL string. -->
|
||||
<identity>user:password</identity>
|
||||
<!--<zookeeper_load_balancing>random / in_order / nearest_hostname / first_or_random / round_robin</zookeeper_load_balancing>-->
|
||||
<!--<zookeeper_load_balancing>random / in_order / nearest_hostname / hostname_levenshtein_distance / first_or_random / round_robin</zookeeper_load_balancing>-->
|
||||
<zookeeper_load_balancing>random</zookeeper_load_balancing>
|
||||
</zookeeper>
|
||||
```
|
||||
|
@ -1413,6 +1413,7 @@ ClickHouse supports the following algorithms of choosing replicas:
|
||||
|
||||
- [Random](#load_balancing-random) (by default)
|
||||
- [Nearest hostname](#load_balancing-nearest_hostname)
|
||||
- [Hostname levenshtein distance](#load_balancing-hostname_levenshtein_distance)
|
||||
- [In order](#load_balancing-in_order)
|
||||
- [First or random](#load_balancing-first_or_random)
|
||||
- [Round robin](#load_balancing-round_robin)
|
||||
@ -1444,6 +1445,25 @@ This method might seem primitive, but it does not require external data about ne
|
||||
Thus, if there are equivalent replicas, the closest one by name is preferred.
|
||||
We can also assume that when sending a query to the same server, in the absence of failures, a distributed query will also go to the same servers. So even if different data is placed on the replicas, the query will return mostly the same results.
|
||||
|
||||
### Hostname levenshtein distance {#load_balancing-hostname_levenshtein_distance}
|
||||
|
||||
``` sql
|
||||
load_balancing = hostname_levenshtein_distance
|
||||
```
|
||||
|
||||
Just like `nearest_hostname`, but it compares hostname in a [levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) manner. For example:
|
||||
|
||||
``` text
|
||||
example-clickhouse-0-0 ample-clickhouse-0-0
|
||||
1
|
||||
|
||||
example-clickhouse-0-0 example-clickhouse-1-10
|
||||
2
|
||||
|
||||
example-clickhouse-0-0 example-clickhouse-12-0
|
||||
3
|
||||
```
|
||||
|
||||
### In Order {#load_balancing-in_order}
|
||||
|
||||
``` sql
|
||||
|
36
docs/en/operations/system-tables/query_cache.md
Normal file
36
docs/en/operations/system-tables/query_cache.md
Normal file
@ -0,0 +1,36 @@
|
||||
---
|
||||
slug: /en/operations/system-tables/query_cache
|
||||
---
|
||||
# query_cache
|
||||
|
||||
Shows the content of the [query cache](../query-cache.md).
|
||||
|
||||
Columns:
|
||||
|
||||
- `query` ([String](../../sql-reference/data-types/string.md)) — Query string.
|
||||
- `result_size` ([UInt64](../../sql-reference/data-types/int-uint.md#uint-ranges)) — Size of the query cache entry.
|
||||
- `stale` ([UInt8](../../sql-reference/data-types/int-uint.md)) — If the query cache entry is stale.
|
||||
- `shared` ([UInt8](../../sql-reference/data-types/int-uint.md)) — If the query cache entry is shared between multiple users.
|
||||
- `compressed` ([UInt8](../../sql-reference/data-types/int-uint.md)) — If the query cache entry is compressed.
|
||||
- `expires_at` ([DateTime](../../sql-reference/data-types/datetime.md)) — When the query cache entry becomes stale.
|
||||
- `key_hash` ([UInt64](../../sql-reference/data-types/int-uint.md#uint-ranges)) — A hash of the query string, used as a key to find query cache entries.
|
||||
|
||||
**Example**
|
||||
|
||||
``` sql
|
||||
SELECT * FROM system.query_cache FORMAT Vertical;
|
||||
```
|
||||
|
||||
``` text
|
||||
Row 1:
|
||||
──────
|
||||
query: SELECT 1 SETTINGS use_query_cache = 1
|
||||
result_size: 128
|
||||
stale: 0
|
||||
shared: 0
|
||||
compressed: 1
|
||||
expires_at: 2023-10-13 13:35:45
|
||||
key_hash: 12188185624808016954
|
||||
|
||||
1 row in set. Elapsed: 0.004 sec.
|
||||
```
|
@ -441,3 +441,40 @@ DB::Exception: Decimal result's scale is less than argument's one: While process
|
||||
│ -12 │ 2.1 │ -5.7 │ -5.71428 │
|
||||
└─────┴─────┴────────────────────────────────────────────────────────────┴────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## byteSwap
|
||||
|
||||
Reverses the bytes of an integer, i.e. changes its [endianness](https://en.wikipedia.org/wiki/Endianness). Currently, integers of up to 64 bit are supported.
|
||||
|
||||
**Syntax**
|
||||
|
||||
```sql
|
||||
byteSwap(a)
|
||||
```
|
||||
|
||||
**Example**
|
||||
|
||||
```sql
|
||||
byteSwap(3351772109)
|
||||
```
|
||||
|
||||
Result:
|
||||
|
||||
```result
|
||||
┌─byteSwap(3351772109)─┐
|
||||
│ 3455829959 │
|
||||
└──────────────────────┘
|
||||
```
|
||||
|
||||
The above example can be worked out in the following manner:
|
||||
1. Convert the base-10 integer to its equivalent hexadecimal format in big-endian format, i.e. 3351772109 -> C7 C7 FB CD (4 bytes)
|
||||
2. Reverse the bytes, i.e. C7 C7 FB CD -> CD FB C7 C7
|
||||
3. Convert the result back to an integer assuming big-endian, i.e. CD FB C7 C7 -> 3455829959
|
||||
|
||||
One use case of this function is reversing IPv4s:
|
||||
|
||||
```result
|
||||
┌─toIPv4(byteSwap(toUInt32(toIPv4('205.251.199.199'))))─┐
|
||||
│ 199.199.251.205 │
|
||||
└───────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
@ -97,12 +97,12 @@ The fourth one is useful to remove metadata of dead replica when all other repli
|
||||
Dead replicas of `Replicated` databases can be dropped using following syntax:
|
||||
|
||||
``` sql
|
||||
SYSTEM DROP DATABASE REPLICA 'replica_name' [FROM SHARD 'shard_name'] [FROM GROUP 'group_name'] FROM DATABASE database;
|
||||
SYSTEM DROP DATABASE REPLICA 'replica_name' [FROM SHARD 'shard_name'] [FROM GROUP 'group_name'];
|
||||
SYSTEM DROP DATABASE REPLICA 'replica_name' [FROM SHARD 'shard_name'] [FROM GROUP 'group_name'] FROM ZKPATH '/path/to/table/in/zk';
|
||||
SYSTEM DROP DATABASE REPLICA 'replica_name' [FROM SHARD 'shard_name'] FROM DATABASE database;
|
||||
SYSTEM DROP DATABASE REPLICA 'replica_name' [FROM SHARD 'shard_name'];
|
||||
SYSTEM DROP DATABASE REPLICA 'replica_name' [FROM SHARD 'shard_name'] FROM ZKPATH '/path/to/table/in/zk';
|
||||
```
|
||||
|
||||
Similar to `SYSTEM DROP REPLICA`, but removes the `Replicated` database replica path from ZooKeeper when there's no database to run `DROP DATABASE`. Please note that it does not remove `ReplicatedMergeTree` replicas (so you may need `SYSTEM DROP REPLICA` as well). Shard and replica names are the names that were specified in `Replicated` engine arguments when creating the database. Also, these names can be obtained from `database_shard_name` and `database_replica_name` columns in `system.clusters`. Replica group name is the name defined by `replica_group_name` [setting](../../operations/server-configuration-parameters/settings.md#replica_group_name) in the server configuration. If the `FROM SHARD` clause is missing, then `replica_name` must be a full replica name in `shard_name|replica_name` format if replica groups are not used and in `shard_name|replica_name|group_name` otherwise.
|
||||
Similar to `SYSTEM DROP REPLICA`, but removes the `Replicated` database replica path from ZooKeeper when there's no database to run `DROP DATABASE`. Please note that it does not remove `ReplicatedMergeTree` replicas (so you may need `SYSTEM DROP REPLICA` as well). Shard and replica names are the names that were specified in `Replicated` engine arguments when creating the database. Also, these names can be obtained from `database_shard_name` and `database_replica_name` columns in `system.clusters`. If the `FROM SHARD` clause is missing, then `replica_name` must be a full replica name in `shard_name|replica_name` format.
|
||||
|
||||
## DROP UNCOMPRESSED CACHE
|
||||
|
||||
|
@ -20,7 +20,7 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster]
|
||||
name1 [type1] [DEFAULT|MATERIALIZED|ALIAS expr1],
|
||||
name2 [type2] [DEFAULT|MATERIALIZED|ALIAS expr2],
|
||||
...
|
||||
) ENGINE = ReplacingMergeTree([ver])
|
||||
) ENGINE = ReplacingMergeTree([ver [, is_deleted]])
|
||||
[PARTITION BY expr]
|
||||
[ORDER BY expr]
|
||||
[SAMPLE BY expr]
|
||||
@ -86,6 +86,59 @@ SELECT * FROM mySecondReplacingMT FINAL;
|
||||
│ 1 │ first │ 2020-01-01 01:01:01 │
|
||||
└─────┴─────────┴─────────────────────┘
|
||||
```
|
||||
### is_deleted
|
||||
|
||||
`is_deleted` — Имя столбца, который используется во время слияния для обозначения того, нужно ли отображать строку или она подлежит удалению; `1` - для удаления строки, `0` - для отображения строки.
|
||||
|
||||
Тип данных столбца — `UInt8`.
|
||||
|
||||
:::note
|
||||
`is_deleted` может быть использован, если `ver` используется.
|
||||
|
||||
Строка удаляется в следующих случаях:
|
||||
|
||||
- при использовании инструкции `OPTIMIZE ... FINAL CLEANUP`
|
||||
- при использовании инструкции `OPTIMIZE ... FINAL`
|
||||
- параметр движка `clean_deleted_rows` установлен в значение `Always` (по умолчанию - `Never`)
|
||||
- есть новые версии строки
|
||||
|
||||
Не рекомендуется выполнять `FINAL CLEANUP` или использовать параметр движка `clean_deleted_rows` со значением `Always`, это может привести к неожиданным результатам, например удаленные строки могут вновь появиться.
|
||||
|
||||
Вне зависимости от производимых изменений над данными, версия должна увеличиваться. Если у двух строк одна и та же версия, то остается только последняя вставленная строка.
|
||||
:::
|
||||
|
||||
Пример:
|
||||
|
||||
```sql
|
||||
-- with ver and is_deleted
|
||||
CREATE OR REPLACE TABLE myThirdReplacingMT
|
||||
(
|
||||
`key` Int64,
|
||||
`someCol` String,
|
||||
`eventTime` DateTime,
|
||||
`is_deleted` UInt8
|
||||
)
|
||||
ENGINE = ReplacingMergeTree(eventTime, is_deleted)
|
||||
ORDER BY key;
|
||||
|
||||
INSERT INTO myThirdReplacingMT Values (1, 'first', '2020-01-01 01:01:01', 0);
|
||||
INSERT INTO myThirdReplacingMT Values (1, 'first', '2020-01-01 01:01:01', 1);
|
||||
|
||||
select * from myThirdReplacingMT final;
|
||||
|
||||
0 rows in set. Elapsed: 0.003 sec.
|
||||
|
||||
-- delete rows with is_deleted
|
||||
OPTIMIZE TABLE myThirdReplacingMT FINAL CLEANUP;
|
||||
|
||||
INSERT INTO myThirdReplacingMT Values (1, 'first', '2020-01-01 00:00:00', 0);
|
||||
|
||||
select * from myThirdReplacingMT final;
|
||||
|
||||
┌─key─┬─someCol─┬───────────eventTime─┬─is_deleted─┐
|
||||
│ 1 │ first │ 2020-01-01 00:00:00 │ 0 │
|
||||
└─────┴─────────┴─────────────────────┴────────────┘
|
||||
```
|
||||
|
||||
## Секции запроса
|
||||
|
||||
|
@ -1264,6 +1264,15 @@ void Client::processConfig()
|
||||
global_context->setQueryKindInitial();
|
||||
global_context->setQuotaClientKey(config().getString("quota_key", ""));
|
||||
global_context->setQueryKind(query_kind);
|
||||
|
||||
if (is_multiquery && !global_context->getSettingsRef().input_format_values_allow_data_after_semicolon.changed)
|
||||
{
|
||||
Settings settings = global_context->getSettings();
|
||||
settings.input_format_values_allow_data_after_semicolon = true;
|
||||
/// Do not send it to the server
|
||||
settings.input_format_values_allow_data_after_semicolon.changed = false;
|
||||
global_context->setSettings(settings);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -269,7 +269,7 @@ ShardPriority getReplicasPriority(const Cluster::Addresses & replicas, const std
|
||||
res.hostname_difference = std::numeric_limits<size_t>::max();
|
||||
for (const auto & replica : replicas)
|
||||
{
|
||||
size_t difference = getHostNameDifference(local_hostname, replica.host_name);
|
||||
size_t difference = getHostNamePrefixDistance(local_hostname, replica.host_name);
|
||||
res.hostname_difference = std::min(difference, res.hostname_difference);
|
||||
}
|
||||
|
||||
|
@ -783,6 +783,15 @@ void LocalServer::processConfig()
|
||||
|
||||
global_context->setQueryKindInitial();
|
||||
global_context->setQueryKind(query_kind);
|
||||
|
||||
if (is_multiquery && !global_context->getSettingsRef().input_format_values_allow_data_after_semicolon.changed)
|
||||
{
|
||||
Settings settings = global_context->getSettings();
|
||||
settings.input_format_values_allow_data_after_semicolon = true;
|
||||
/// Do not send it to the server
|
||||
settings.input_format_values_allow_data_after_semicolon.changed = false;
|
||||
global_context->setSettings(settings);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -926,15 +926,6 @@
|
||||
</macros>
|
||||
-->
|
||||
|
||||
<!-- Replica group name for database Replicated.
|
||||
The cluster created by Replicated database will consist of replicas in the same group.
|
||||
DDL queries will only wail for the replicas in the same group.
|
||||
Empty by default.
|
||||
-->
|
||||
<!--
|
||||
<replica_group_name><replica_group_name>
|
||||
-->
|
||||
|
||||
|
||||
<!-- Reloading interval for embedded dictionaries, in seconds. Default: 3600. -->
|
||||
<builtin_dictionaries_reload_interval>3600</builtin_dictionaries_reload_interval>
|
||||
|
@ -9,6 +9,7 @@ profiles:
|
||||
# random - choose random replica from set of replicas with minimum number of errors
|
||||
# nearest_hostname - from set of replicas with minimum number of errors, choose replica
|
||||
# with minimum number of different symbols between replica's hostname and local hostname (Hamming distance).
|
||||
# hostname_levenshtein_distance - just the same with nearest_hostname but calculate the difference by Levenshtein distance.
|
||||
# in_order - first live replica is chosen in specified order.
|
||||
# first_or_random - if first replica one has higher number of errors, pick a random one from replicas with minimum number of errors.
|
||||
load_balancing: random
|
||||
|
@ -1264,7 +1264,8 @@ private:
|
||||
size_t identifier_bind_size,
|
||||
const QueryTreeNodePtr & compound_expression,
|
||||
String compound_expression_source,
|
||||
IdentifierResolveScope & scope);
|
||||
IdentifierResolveScope & scope,
|
||||
bool can_be_not_found = false);
|
||||
|
||||
QueryTreeNodePtr tryResolveIdentifierFromExpressionArguments(const IdentifierLookup & identifier_lookup, IdentifierResolveScope & scope);
|
||||
|
||||
@ -1313,6 +1314,14 @@ private:
|
||||
IdentifierResolveScope & scope,
|
||||
IdentifierResolveSettings identifier_resolve_settings = {});
|
||||
|
||||
QueryTreeNodePtr tryResolveIdentifierFromStorage(
|
||||
const Identifier & identifier,
|
||||
const QueryTreeNodePtr & table_expression_node,
|
||||
const TableExpressionData & table_expression_data,
|
||||
IdentifierResolveScope & scope,
|
||||
size_t identifier_column_qualifier_parts,
|
||||
bool can_be_not_found = false);
|
||||
|
||||
/// Resolve query tree nodes functions
|
||||
|
||||
void qualifyColumnNodesWithProjectionNames(const QueryTreeNodes & column_nodes,
|
||||
@ -2395,11 +2404,13 @@ QueryTreeNodePtr QueryAnalyzer::tryResolveTableIdentifierFromDatabaseCatalog(con
|
||||
}
|
||||
|
||||
/// Resolve identifier from compound expression
|
||||
/// If identifier cannot be resolved throw exception or return nullptr if can_be_not_found is true
|
||||
QueryTreeNodePtr QueryAnalyzer::tryResolveIdentifierFromCompoundExpression(const Identifier & expression_identifier,
|
||||
size_t identifier_bind_size,
|
||||
const QueryTreeNodePtr & compound_expression,
|
||||
String compound_expression_source,
|
||||
IdentifierResolveScope & scope)
|
||||
IdentifierResolveScope & scope,
|
||||
bool can_be_not_found)
|
||||
{
|
||||
Identifier compound_expression_identifier;
|
||||
for (size_t i = 0; i < identifier_bind_size; ++i)
|
||||
@ -2412,6 +2423,23 @@ QueryTreeNodePtr QueryAnalyzer::tryResolveIdentifierFromCompoundExpression(const
|
||||
|
||||
if (!expression_type->hasSubcolumn(nested_path.getFullName()))
|
||||
{
|
||||
if (auto * column = compound_expression->as<ColumnNode>())
|
||||
{
|
||||
const DataTypePtr & column_type = column->getColumn().getTypeInStorage();
|
||||
if (column_type->getTypeId() == TypeIndex::Object)
|
||||
{
|
||||
const auto * object_type = checkAndGetDataType<DataTypeObject>(column_type.get());
|
||||
if (object_type->getSchemaFormat() == "json" && object_type->hasNullableSubcolumns())
|
||||
{
|
||||
QueryTreeNodePtr constant_node_null = std::make_shared<ConstantNode>(Field());
|
||||
return constant_node_null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (can_be_not_found)
|
||||
return {};
|
||||
|
||||
std::unordered_set<Identifier> valid_identifiers;
|
||||
collectCompoundExpressionValidIdentifiersForTypoCorrection(expression_identifier,
|
||||
expression_type,
|
||||
@ -2427,20 +2455,6 @@ QueryTreeNodePtr QueryAnalyzer::tryResolveIdentifierFromCompoundExpression(const
|
||||
compound_expression_from_error_message += compound_expression_source;
|
||||
}
|
||||
|
||||
if (auto * column = compound_expression->as<ColumnNode>())
|
||||
{
|
||||
const DataTypePtr & column_type = column->getColumn().getTypeInStorage();
|
||||
if (column_type->getTypeId() == TypeIndex::Object)
|
||||
{
|
||||
const auto * object_type = checkAndGetDataType<DataTypeObject>(column_type.get());
|
||||
if (object_type->getSchemaFormat() == "json" && object_type->hasNullableSubcolumns())
|
||||
{
|
||||
QueryTreeNodePtr constant_node_null = std::make_shared<ConstantNode>(Field());
|
||||
return constant_node_null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw Exception(ErrorCodes::UNKNOWN_IDENTIFIER,
|
||||
"Identifier {} nested path {} cannot be resolved from type {}{}. In scope {}{}",
|
||||
expression_identifier,
|
||||
@ -2796,6 +2810,160 @@ bool QueryAnalyzer::tryBindIdentifierToTableExpressions(const IdentifierLookup &
|
||||
return can_bind_identifier_to_table_expression;
|
||||
}
|
||||
|
||||
QueryTreeNodePtr QueryAnalyzer::tryResolveIdentifierFromStorage(
|
||||
const Identifier & identifier,
|
||||
const QueryTreeNodePtr & table_expression_node,
|
||||
const TableExpressionData & table_expression_data,
|
||||
IdentifierResolveScope & scope,
|
||||
size_t identifier_column_qualifier_parts,
|
||||
bool can_be_not_found)
|
||||
{
|
||||
auto identifier_without_column_qualifier = identifier;
|
||||
identifier_without_column_qualifier.popFirst(identifier_column_qualifier_parts);
|
||||
|
||||
/** Compound identifier cannot be resolved directly from storage if storage is not table.
|
||||
*
|
||||
* Example: SELECT test_table.id.value1.value2 FROM test_table;
|
||||
* In table storage column test_table.id.value1.value2 will exists.
|
||||
*
|
||||
* Example: SELECT test_subquery.compound_expression.value FROM (SELECT compound_expression AS value) AS test_subquery;
|
||||
* Here there is no column with name test_subquery.compound_expression.value, and additional wrap in tuple element is required.
|
||||
*/
|
||||
|
||||
QueryTreeNodePtr result_expression;
|
||||
bool match_full_identifier = false;
|
||||
|
||||
auto it = table_expression_data.column_name_to_column_node.find(identifier_without_column_qualifier.getFullName());
|
||||
if (it != table_expression_data.column_name_to_column_node.end())
|
||||
{
|
||||
match_full_identifier = true;
|
||||
result_expression = it->second;
|
||||
}
|
||||
else
|
||||
{
|
||||
it = table_expression_data.column_name_to_column_node.find(identifier_without_column_qualifier.at(0));
|
||||
if (it != table_expression_data.column_name_to_column_node.end())
|
||||
result_expression = it->second;
|
||||
}
|
||||
|
||||
bool clone_is_needed = true;
|
||||
|
||||
String table_expression_source = table_expression_data.table_expression_description;
|
||||
if (!table_expression_data.table_expression_name.empty())
|
||||
table_expression_source += " with name " + table_expression_data.table_expression_name;
|
||||
|
||||
if (result_expression && !match_full_identifier && identifier_without_column_qualifier.isCompound())
|
||||
{
|
||||
size_t identifier_bind_size = identifier_column_qualifier_parts + 1;
|
||||
result_expression = tryResolveIdentifierFromCompoundExpression(identifier,
|
||||
identifier_bind_size,
|
||||
result_expression,
|
||||
table_expression_source,
|
||||
scope,
|
||||
can_be_not_found);
|
||||
if (can_be_not_found && !result_expression)
|
||||
return {};
|
||||
clone_is_needed = false;
|
||||
}
|
||||
|
||||
if (!result_expression)
|
||||
{
|
||||
QueryTreeNodes nested_column_nodes;
|
||||
DataTypes nested_types;
|
||||
Array nested_names_array;
|
||||
|
||||
for (const auto & [column_name, _] : table_expression_data.column_names_and_types)
|
||||
{
|
||||
Identifier column_name_identifier_without_last_part(column_name);
|
||||
auto column_name_identifier_last_part = column_name_identifier_without_last_part.getParts().back();
|
||||
column_name_identifier_without_last_part.popLast();
|
||||
|
||||
if (identifier_without_column_qualifier.getFullName() != column_name_identifier_without_last_part.getFullName())
|
||||
continue;
|
||||
|
||||
auto column_node_it = table_expression_data.column_name_to_column_node.find(column_name);
|
||||
if (column_node_it == table_expression_data.column_name_to_column_node.end())
|
||||
continue;
|
||||
|
||||
const auto & column_node = column_node_it->second;
|
||||
const auto & column_type = column_node->getColumnType();
|
||||
const auto * column_type_array = typeid_cast<const DataTypeArray *>(column_type.get());
|
||||
if (!column_type_array)
|
||||
continue;
|
||||
|
||||
nested_column_nodes.push_back(column_node);
|
||||
nested_types.push_back(column_type_array->getNestedType());
|
||||
nested_names_array.push_back(Field(std::move(column_name_identifier_last_part)));
|
||||
}
|
||||
|
||||
if (!nested_types.empty())
|
||||
{
|
||||
auto nested_function_node = std::make_shared<FunctionNode>("nested");
|
||||
auto & nested_function_node_arguments = nested_function_node->getArguments().getNodes();
|
||||
|
||||
auto nested_function_names_array_type = std::make_shared<DataTypeArray>(std::make_shared<DataTypeString>());
|
||||
auto nested_function_names_constant_node = std::make_shared<ConstantNode>(std::move(nested_names_array),
|
||||
std::move(nested_function_names_array_type));
|
||||
nested_function_node_arguments.push_back(std::move(nested_function_names_constant_node));
|
||||
nested_function_node_arguments.insert(nested_function_node_arguments.end(),
|
||||
nested_column_nodes.begin(),
|
||||
nested_column_nodes.end());
|
||||
|
||||
auto nested_function = FunctionFactory::instance().get(nested_function_node->getFunctionName(), scope.context);
|
||||
nested_function_node->resolveAsFunction(nested_function->build(nested_function_node->getArgumentColumns()));
|
||||
|
||||
clone_is_needed = false;
|
||||
result_expression = std::move(nested_function_node);
|
||||
}
|
||||
}
|
||||
|
||||
if (!result_expression)
|
||||
{
|
||||
std::unordered_set<Identifier> valid_identifiers;
|
||||
collectTableExpressionValidIdentifiersForTypoCorrection(identifier,
|
||||
table_expression_node,
|
||||
table_expression_data,
|
||||
valid_identifiers);
|
||||
|
||||
auto hints = collectIdentifierTypoHints(identifier, valid_identifiers);
|
||||
|
||||
throw Exception(ErrorCodes::UNKNOWN_IDENTIFIER, "Identifier '{}' cannot be resolved from {}. In scope {}{}",
|
||||
identifier.getFullName(),
|
||||
table_expression_source,
|
||||
scope.scope_node->formatASTForErrorMessage(),
|
||||
getHintsErrorMessageSuffix(hints));
|
||||
}
|
||||
|
||||
if (clone_is_needed)
|
||||
result_expression = result_expression->clone();
|
||||
|
||||
auto qualified_identifier = identifier;
|
||||
|
||||
for (size_t i = 0; i < identifier_column_qualifier_parts; ++i)
|
||||
{
|
||||
auto qualified_identifier_with_removed_part = qualified_identifier;
|
||||
qualified_identifier_with_removed_part.popFirst();
|
||||
|
||||
if (qualified_identifier_with_removed_part.empty())
|
||||
break;
|
||||
|
||||
IdentifierLookup column_identifier_lookup = {qualified_identifier_with_removed_part, IdentifierLookupContext::EXPRESSION};
|
||||
if (tryBindIdentifierToAliases(column_identifier_lookup, scope))
|
||||
break;
|
||||
|
||||
if (table_expression_data.should_qualify_columns &&
|
||||
tryBindIdentifierToTableExpressions(column_identifier_lookup, table_expression_node, scope))
|
||||
break;
|
||||
|
||||
qualified_identifier = std::move(qualified_identifier_with_removed_part);
|
||||
}
|
||||
|
||||
auto qualified_identifier_full_name = qualified_identifier.getFullName();
|
||||
node_to_projection_name.emplace(result_expression, std::move(qualified_identifier_full_name));
|
||||
|
||||
return result_expression;
|
||||
}
|
||||
|
||||
QueryTreeNodePtr QueryAnalyzer::tryResolveIdentifierFromTableExpression(const IdentifierLookup & identifier_lookup,
|
||||
const QueryTreeNodePtr & table_expression_node,
|
||||
IdentifierResolveScope & scope)
|
||||
@ -2836,151 +3004,6 @@ QueryTreeNodePtr QueryAnalyzer::tryResolveIdentifierFromTableExpression(const Id
|
||||
return {};
|
||||
}
|
||||
|
||||
auto resolve_identifier_from_storage_or_throw = [&](size_t identifier_column_qualifier_parts) -> QueryTreeNodePtr
|
||||
{
|
||||
auto identifier_without_column_qualifier = identifier;
|
||||
identifier_without_column_qualifier.popFirst(identifier_column_qualifier_parts);
|
||||
|
||||
/** Compound identifier cannot be resolved directly from storage if storage is not table.
|
||||
*
|
||||
* Example: SELECT test_table.id.value1.value2 FROM test_table;
|
||||
* In table storage column test_table.id.value1.value2 will exists.
|
||||
*
|
||||
* Example: SELECT test_subquery.compound_expression.value FROM (SELECT compound_expression AS value) AS test_subquery;
|
||||
* Here there is no column with name test_subquery.compound_expression.value, and additional wrap in tuple element is required.
|
||||
*/
|
||||
|
||||
QueryTreeNodePtr result_expression;
|
||||
bool match_full_identifier = false;
|
||||
|
||||
auto it = table_expression_data.column_name_to_column_node.find(identifier_without_column_qualifier.getFullName());
|
||||
if (it != table_expression_data.column_name_to_column_node.end())
|
||||
{
|
||||
match_full_identifier = true;
|
||||
result_expression = it->second;
|
||||
}
|
||||
else
|
||||
{
|
||||
it = table_expression_data.column_name_to_column_node.find(identifier_without_column_qualifier.at(0));
|
||||
if (it != table_expression_data.column_name_to_column_node.end())
|
||||
result_expression = it->second;
|
||||
}
|
||||
|
||||
bool clone_is_needed = true;
|
||||
|
||||
String table_expression_source = table_expression_data.table_expression_description;
|
||||
if (!table_expression_data.table_expression_name.empty())
|
||||
table_expression_source += " with name " + table_expression_data.table_expression_name;
|
||||
|
||||
if (result_expression && !match_full_identifier && identifier_without_column_qualifier.isCompound())
|
||||
{
|
||||
size_t identifier_bind_size = identifier_column_qualifier_parts + 1;
|
||||
result_expression = tryResolveIdentifierFromCompoundExpression(identifier_lookup.identifier,
|
||||
identifier_bind_size,
|
||||
result_expression,
|
||||
table_expression_source,
|
||||
scope);
|
||||
clone_is_needed = false;
|
||||
}
|
||||
|
||||
if (!result_expression)
|
||||
{
|
||||
QueryTreeNodes nested_column_nodes;
|
||||
DataTypes nested_types;
|
||||
Array nested_names_array;
|
||||
|
||||
for (auto & [column_name, _] : table_expression_data.column_names_and_types)
|
||||
{
|
||||
Identifier column_name_identifier_without_last_part(column_name);
|
||||
auto column_name_identifier_last_part = column_name_identifier_without_last_part.getParts().back();
|
||||
column_name_identifier_without_last_part.popLast();
|
||||
|
||||
if (identifier_without_column_qualifier.getFullName() != column_name_identifier_without_last_part.getFullName())
|
||||
continue;
|
||||
|
||||
auto column_node_it = table_expression_data.column_name_to_column_node.find(column_name);
|
||||
if (column_node_it == table_expression_data.column_name_to_column_node.end())
|
||||
continue;
|
||||
|
||||
const auto & column_node = column_node_it->second;
|
||||
const auto & column_type = column_node->getColumnType();
|
||||
const auto * column_type_array = typeid_cast<const DataTypeArray *>(column_type.get());
|
||||
if (!column_type_array)
|
||||
continue;
|
||||
|
||||
nested_column_nodes.push_back(column_node);
|
||||
nested_types.push_back(column_type_array->getNestedType());
|
||||
nested_names_array.push_back(Field(std::move(column_name_identifier_last_part)));
|
||||
}
|
||||
|
||||
if (!nested_types.empty())
|
||||
{
|
||||
auto nested_function_node = std::make_shared<FunctionNode>("nested");
|
||||
auto & nested_function_node_arguments = nested_function_node->getArguments().getNodes();
|
||||
|
||||
auto nested_function_names_array_type = std::make_shared<DataTypeArray>(std::make_shared<DataTypeString>());
|
||||
auto nested_function_names_constant_node = std::make_shared<ConstantNode>(std::move(nested_names_array),
|
||||
std::move(nested_function_names_array_type));
|
||||
nested_function_node_arguments.push_back(std::move(nested_function_names_constant_node));
|
||||
nested_function_node_arguments.insert(nested_function_node_arguments.end(),
|
||||
nested_column_nodes.begin(),
|
||||
nested_column_nodes.end());
|
||||
|
||||
auto nested_function = FunctionFactory::instance().get(nested_function_node->getFunctionName(), scope.context);
|
||||
nested_function_node->resolveAsFunction(nested_function->build(nested_function_node->getArgumentColumns()));
|
||||
|
||||
clone_is_needed = false;
|
||||
result_expression = std::move(nested_function_node);
|
||||
}
|
||||
}
|
||||
|
||||
if (!result_expression)
|
||||
{
|
||||
std::unordered_set<Identifier> valid_identifiers;
|
||||
collectTableExpressionValidIdentifiersForTypoCorrection(identifier,
|
||||
table_expression_node,
|
||||
table_expression_data,
|
||||
valid_identifiers);
|
||||
|
||||
auto hints = collectIdentifierTypoHints(identifier, valid_identifiers);
|
||||
|
||||
throw Exception(ErrorCodes::UNKNOWN_IDENTIFIER, "Identifier '{}' cannot be resolved from {}. In scope {}{}",
|
||||
identifier.getFullName(),
|
||||
table_expression_source,
|
||||
scope.scope_node->formatASTForErrorMessage(),
|
||||
getHintsErrorMessageSuffix(hints));
|
||||
}
|
||||
|
||||
if (clone_is_needed)
|
||||
result_expression = result_expression->clone();
|
||||
|
||||
auto qualified_identifier = identifier;
|
||||
|
||||
for (size_t i = 0; i < identifier_column_qualifier_parts; ++i)
|
||||
{
|
||||
auto qualified_identifier_with_removed_part = qualified_identifier;
|
||||
qualified_identifier_with_removed_part.popFirst();
|
||||
|
||||
if (qualified_identifier_with_removed_part.empty())
|
||||
break;
|
||||
|
||||
IdentifierLookup column_identifier_lookup = {qualified_identifier_with_removed_part, IdentifierLookupContext::EXPRESSION};
|
||||
if (tryBindIdentifierToAliases(column_identifier_lookup, scope))
|
||||
break;
|
||||
|
||||
if (table_expression_data.should_qualify_columns &&
|
||||
tryBindIdentifierToTableExpressions(column_identifier_lookup, table_expression_node, scope))
|
||||
break;
|
||||
|
||||
qualified_identifier = std::move(qualified_identifier_with_removed_part);
|
||||
}
|
||||
|
||||
auto qualified_identifier_full_name = qualified_identifier.getFullName();
|
||||
node_to_projection_name.emplace(result_expression, std::move(qualified_identifier_full_name));
|
||||
|
||||
return result_expression;
|
||||
};
|
||||
|
||||
/** If identifier first part binds to some column start or table has full identifier name. Then we can try to find whole identifier in table.
|
||||
* 1. Try to bind identifier first part to column in table, if true get full identifier from table or throw exception.
|
||||
* 2. Try to bind identifier first part to table name or storage alias, if true remove first part and try to get full identifier from table or throw exception.
|
||||
@ -2988,24 +3011,35 @@ QueryTreeNodePtr QueryAnalyzer::tryResolveIdentifierFromTableExpression(const Id
|
||||
* 3. Try to bind identifier first parts to database name and table name, if true remove first two parts and try to get full identifier from table or throw exception.
|
||||
*/
|
||||
if (table_expression_data.hasFullIdentifierName(IdentifierView(identifier)))
|
||||
return resolve_identifier_from_storage_or_throw(0 /*identifier_column_qualifier_parts*/);
|
||||
return tryResolveIdentifierFromStorage(identifier, table_expression_node, table_expression_data, scope, 0 /*identifier_column_qualifier_parts*/);
|
||||
|
||||
if (table_expression_data.canBindIdentifier(IdentifierView(identifier)))
|
||||
return resolve_identifier_from_storage_or_throw(0 /*identifier_column_qualifier_parts*/);
|
||||
{
|
||||
/** This check is insufficient to determine whether and identifier can be resolved from table expression.
|
||||
* A further check will be performed in `tryResolveIdentifierFromStorage` to see if we have such a subcolumn.
|
||||
* In cases where the subcolumn cannot be found we want to have `nullptr` instead of exception.
|
||||
* So, we set `can_be_not_found = true` to have an attempt to resolve the identifier from another table expression.
|
||||
* Example: `SELECT t.t from (SELECT 1 as t) AS a FULL JOIN (SELECT 1 as t) as t ON a.t = t.t;`
|
||||
* Initially, we will try to resolve t.t from `a` because `t.` is bound to `1 as t`. However, as it is not a nested column, we will need to resolve it from the second table expression.
|
||||
*/
|
||||
auto resolved_identifier = tryResolveIdentifierFromStorage(identifier, table_expression_node, table_expression_data, scope, 0 /*identifier_column_qualifier_parts*/, true /*can_be_not_found*/);
|
||||
if (resolved_identifier)
|
||||
return resolved_identifier;
|
||||
}
|
||||
|
||||
if (identifier.getPartsSize() == 1)
|
||||
return {};
|
||||
|
||||
const auto & table_name = table_expression_data.table_name;
|
||||
if ((!table_name.empty() && path_start == table_name) || (table_expression_node->hasAlias() && path_start == table_expression_node->getAlias()))
|
||||
return resolve_identifier_from_storage_or_throw(1 /*identifier_column_qualifier_parts*/);
|
||||
return tryResolveIdentifierFromStorage(identifier, table_expression_node, table_expression_data, scope, 1 /*identifier_column_qualifier_parts*/);
|
||||
|
||||
if (identifier.getPartsSize() == 2)
|
||||
return {};
|
||||
|
||||
const auto & database_name = table_expression_data.database_name;
|
||||
if (!database_name.empty() && path_start == database_name && identifier[1] == table_name)
|
||||
return resolve_identifier_from_storage_or_throw(2 /*identifier_column_qualifier_parts*/);
|
||||
return tryResolveIdentifierFromStorage(identifier, table_expression_node, table_expression_data, scope, 2 /*identifier_column_qualifier_parts*/);
|
||||
|
||||
return {};
|
||||
}
|
||||
|
@ -2020,9 +2020,6 @@ bool ClientBase::executeMultiQuery(const String & all_queries_text)
|
||||
{
|
||||
bool echo_query = echo_queries;
|
||||
|
||||
/// Test tags are started with "--" so they are interpreted as comments anyway.
|
||||
/// But if the echo is enabled we have to remove the test tags from `all_queries_text`
|
||||
/// because we don't want test tags to be echoed.
|
||||
{
|
||||
/// disable logs if expects errors
|
||||
TestHint test_hint(all_queries_text);
|
||||
@ -2030,6 +2027,9 @@ bool ClientBase::executeMultiQuery(const String & all_queries_text)
|
||||
processTextAsSingleQuery("SET send_logs_level = 'fatal'");
|
||||
}
|
||||
|
||||
/// Test tags are started with "--" so they are interpreted as comments anyway.
|
||||
/// But if the echo is enabled we have to remove the test tags from `all_queries_text`
|
||||
/// because we don't want test tags to be echoed.
|
||||
size_t test_tags_length = getTestTagsLength(all_queries_text);
|
||||
|
||||
/// Several queries separated by ';'.
|
||||
|
@ -34,11 +34,13 @@ ConnectionPoolWithFailover::ConnectionPoolWithFailover(
|
||||
{
|
||||
const std::string & local_hostname = getFQDNOrHostName();
|
||||
|
||||
get_priority_load_balancing.hostname_differences.resize(nested_pools.size());
|
||||
get_priority_load_balancing.hostname_prefix_distance.resize(nested_pools.size());
|
||||
get_priority_load_balancing.hostname_levenshtein_distance.resize(nested_pools.size());
|
||||
for (size_t i = 0; i < nested_pools.size(); ++i)
|
||||
{
|
||||
ConnectionPool & connection_pool = dynamic_cast<ConnectionPool &>(*nested_pools[i]);
|
||||
get_priority_load_balancing.hostname_differences[i] = getHostNameDifference(local_hostname, connection_pool.getHost());
|
||||
get_priority_load_balancing.hostname_prefix_distance[i] = getHostNamePrefixDistance(local_hostname, connection_pool.getHost());
|
||||
get_priority_load_balancing.hostname_levenshtein_distance[i] = getHostNameLevenshteinDistance(local_hostname, connection_pool.getHost());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,9 +15,14 @@ std::function<Priority(size_t index)> GetPriorityForLoadBalancing::getPriorityFu
|
||||
switch (load_balance)
|
||||
{
|
||||
case LoadBalancing::NEAREST_HOSTNAME:
|
||||
if (hostname_differences.empty())
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "It's a bug: hostname_differences is not initialized");
|
||||
get_priority = [this](size_t i) { return Priority{static_cast<Int64>(hostname_differences[i])}; };
|
||||
if (hostname_prefix_distance.empty())
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "It's a bug: hostname_prefix_distance is not initialized");
|
||||
get_priority = [this](size_t i) { return Priority{static_cast<Int64>(hostname_prefix_distance[i])}; };
|
||||
break;
|
||||
case LoadBalancing::HOSTNAME_LEVENSHTEIN_DISTANCE:
|
||||
if (hostname_levenshtein_distance.empty())
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "It's a bug: hostname_levenshtein_distance is not initialized");
|
||||
get_priority = [this](size_t i) { return Priority{static_cast<Int64>(hostname_levenshtein_distance[i])}; };
|
||||
break;
|
||||
case LoadBalancing::IN_ORDER:
|
||||
get_priority = [](size_t i) { return Priority{static_cast<Int64>(i)}; };
|
||||
|
@ -13,7 +13,9 @@ public:
|
||||
|
||||
bool operator == (const GetPriorityForLoadBalancing & other) const
|
||||
{
|
||||
return load_balancing == other.load_balancing && hostname_differences == other.hostname_differences;
|
||||
return load_balancing == other.load_balancing
|
||||
&& hostname_prefix_distance == other.hostname_prefix_distance
|
||||
&& hostname_levenshtein_distance == other.hostname_levenshtein_distance;
|
||||
}
|
||||
|
||||
bool operator != (const GetPriorityForLoadBalancing & other) const
|
||||
@ -23,7 +25,8 @@ public:
|
||||
|
||||
std::function<Priority(size_t index)> getPriorityFunc(LoadBalancing load_balance, size_t offset, size_t pool_size) const;
|
||||
|
||||
std::vector<size_t> hostname_differences; /// Distances from name of this host to the names of hosts of pools.
|
||||
std::vector<size_t> hostname_prefix_distance; /// Prefix distances from name of this host to the names of hosts of pools.
|
||||
std::vector<size_t> hostname_levenshtein_distance; /// Levenshtein Distances from name of this host to the names of hosts of pools.
|
||||
|
||||
LoadBalancing load_balancing = LoadBalancing::RANDOM;
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include <base/types.h>
|
||||
#include <Common/PODArray.h>
|
||||
#include <Common/levenshteinDistance.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
@ -29,31 +30,6 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
static size_t levenshteinDistance(const String & lhs, const String & rhs)
|
||||
{
|
||||
size_t m = lhs.size();
|
||||
size_t n = rhs.size();
|
||||
|
||||
PODArrayWithStackMemory<size_t, 64> row(n + 1);
|
||||
|
||||
for (size_t i = 1; i <= n; ++i)
|
||||
row[i] = i;
|
||||
|
||||
for (size_t j = 1; j <= m; ++j)
|
||||
{
|
||||
row[0] = j;
|
||||
size_t prev = j - 1;
|
||||
for (size_t i = 1; i <= n; ++i)
|
||||
{
|
||||
size_t old = row[i];
|
||||
row[i] = std::min(prev + (std::tolower(lhs[j - 1]) != std::tolower(rhs[i - 1])),
|
||||
std::min(row[i - 1], row[i]) + 1);
|
||||
prev = old;
|
||||
}
|
||||
}
|
||||
return row[n];
|
||||
}
|
||||
|
||||
static void appendToQueue(size_t ind, const String & name, DistanceIndexQueue & queue, const std::vector<String> & prompting_strings)
|
||||
{
|
||||
const String & prompt = prompting_strings[ind];
|
||||
|
@ -39,12 +39,14 @@ ZooKeeperArgs::ZooKeeperArgs(const Poco::Util::AbstractConfiguration & config, c
|
||||
throw KeeperException::fromMessage(Coordination::Error::ZBADARGUMENTS, "Timeout cannot be negative");
|
||||
|
||||
/// init get_priority_load_balancing
|
||||
get_priority_load_balancing.hostname_differences.resize(hosts.size());
|
||||
get_priority_load_balancing.hostname_prefix_distance.resize(hosts.size());
|
||||
get_priority_load_balancing.hostname_levenshtein_distance.resize(hosts.size());
|
||||
const String & local_hostname = getFQDNOrHostName();
|
||||
for (size_t i = 0; i < hosts.size(); ++i)
|
||||
{
|
||||
const String & node_host = hosts[i].substr(0, hosts[i].find_last_of(':'));
|
||||
get_priority_load_balancing.hostname_differences[i] = DB::getHostNameDifference(local_hostname, node_host);
|
||||
get_priority_load_balancing.hostname_prefix_distance[i] = DB::getHostNamePrefixDistance(local_hostname, node_host);
|
||||
get_priority_load_balancing.hostname_levenshtein_distance[i] = DB::getHostNameLevenshteinDistance(local_hostname, node_host);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <optional>
|
||||
#include <base/types.h>
|
||||
#include <Common/Exception.h>
|
||||
#include <Common/levenshteinDistance.h>
|
||||
#include <Poco/Net/IPAddress.h>
|
||||
#include <Poco/Net/SocketAddress.h>
|
||||
|
||||
@ -121,10 +122,8 @@ bool isLocalAddress(const Poco::Net::SocketAddress & address, UInt16 clickhouse_
|
||||
return clickhouse_port == address.port() && isLocalAddress(address.host());
|
||||
}
|
||||
|
||||
|
||||
size_t getHostNameDifference(const std::string & local_hostname, const std::string & host)
|
||||
size_t getHostNamePrefixDistance(const std::string & local_hostname, const std::string & host)
|
||||
{
|
||||
/// FIXME should we replace it with Levenstein distance? (we already have it in NamePrompter)
|
||||
size_t hostname_difference = 0;
|
||||
for (size_t i = 0; i < std::min(local_hostname.length(), host.length()); ++i)
|
||||
if (local_hostname[i] != host[i])
|
||||
@ -132,4 +131,9 @@ size_t getHostNameDifference(const std::string & local_hostname, const std::stri
|
||||
return hostname_difference;
|
||||
}
|
||||
|
||||
size_t getHostNameLevenshteinDistance(const std::string & local_hostname, const std::string & host)
|
||||
{
|
||||
return levenshteinDistance(local_hostname, host);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -26,6 +26,8 @@ namespace DB
|
||||
bool isLocalAddress(const Poco::Net::SocketAddress & address);
|
||||
bool isLocalAddress(const Poco::Net::IPAddress & address);
|
||||
|
||||
/// Returns number of different bytes in hostnames, used for load balancing
|
||||
size_t getHostNameDifference(const std::string & local_hostname, const std::string & host);
|
||||
/// Returns host name difference with name prefix, used for load balancing
|
||||
size_t getHostNamePrefixDistance(const std::string & local_hostname, const std::string & host);
|
||||
/// Returns host name difference with Levenshtein Distance.
|
||||
size_t getHostNameLevenshteinDistance(const std::string & local_hostname, const std::string & host);
|
||||
}
|
||||
|
32
src/Common/levenshteinDistance.cpp
Normal file
32
src/Common/levenshteinDistance.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
#include <Common/levenshteinDistance.h>
|
||||
#include <Common/PODArray.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
size_t levenshteinDistance(const String & lhs, const String & rhs)
|
||||
{
|
||||
size_t m = lhs.size();
|
||||
size_t n = rhs.size();
|
||||
|
||||
PODArrayWithStackMemory<size_t, 64> row(n + 1);
|
||||
|
||||
for (size_t i = 1; i <= n; ++i)
|
||||
row[i] = i;
|
||||
|
||||
for (size_t j = 1; j <= m; ++j)
|
||||
{
|
||||
row[0] = j;
|
||||
size_t prev = j - 1;
|
||||
for (size_t i = 1; i <= n; ++i)
|
||||
{
|
||||
size_t old = row[i];
|
||||
row[i] = std::min(prev + (std::tolower(lhs[j - 1]) != std::tolower(rhs[i - 1])),
|
||||
std::min(row[i - 1], row[i]) + 1);
|
||||
prev = old;
|
||||
}
|
||||
}
|
||||
return row[n];
|
||||
}
|
||||
|
||||
}
|
12
src/Common/levenshteinDistance.h
Normal file
12
src/Common/levenshteinDistance.h
Normal file
@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <base/types.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
/// How many steps if we want to change lhs to rhs.
|
||||
/// Details in https://en.wikipedia.org/wiki/Levenshtein_distance
|
||||
size_t levenshteinDistance(const String & lhs, const String & rhs);
|
||||
|
||||
}
|
@ -963,6 +963,7 @@ class IColumn;
|
||||
M(Bool, input_format_values_interpret_expressions, true, "For Values format: if the field could not be parsed by streaming parser, run SQL parser and try to interpret it as SQL expression.", 0) \
|
||||
M(Bool, input_format_values_deduce_templates_of_expressions, true, "For Values format: if the field could not be parsed by streaming parser, run SQL parser, deduce template of the SQL expression, try to parse all rows using template and then interpret expression for all rows.", 0) \
|
||||
M(Bool, input_format_values_accurate_types_of_literals, true, "For Values format: when parsing and interpreting expressions using template, check actual type of literal to avoid possible overflow and precision issues.", 0) \
|
||||
M(Bool, input_format_values_allow_data_after_semicolon, false, "For Values format: allow extra data after semicolon (used by client to interpret comments).", 0) \
|
||||
M(Bool, input_format_avro_allow_missing_fields, false, "For Avro/AvroConfluent format: when field is not found in schema use default value instead of error", 0) \
|
||||
/** This setting is obsolete and do nothing, left for compatibility reasons. */ \
|
||||
M(Bool, input_format_avro_null_as_default, false, "For Avro/AvroConfluent format: insert default in case of null and non Nullable column", 0) \
|
||||
|
@ -20,6 +20,7 @@ namespace ErrorCodes
|
||||
IMPLEMENT_SETTING_ENUM(LoadBalancing, ErrorCodes::UNKNOWN_LOAD_BALANCING,
|
||||
{{"random", LoadBalancing::RANDOM},
|
||||
{"nearest_hostname", LoadBalancing::NEAREST_HOSTNAME},
|
||||
{"hostname_levenshtein_distance", LoadBalancing::HOSTNAME_LEVENSHTEIN_DISTANCE},
|
||||
{"in_order", LoadBalancing::IN_ORDER},
|
||||
{"first_or_random", LoadBalancing::FIRST_OR_RANDOM},
|
||||
{"round_robin", LoadBalancing::ROUND_ROBIN}})
|
||||
|
@ -16,8 +16,10 @@ enum class LoadBalancing
|
||||
/// among replicas with a minimum number of errors selected randomly
|
||||
RANDOM = 0,
|
||||
/// a replica is selected among the replicas with the minimum number of errors
|
||||
/// with the minimum number of distinguished characters in the replica name and local hostname
|
||||
/// with the minimum number of distinguished characters in the replica name prefix and local hostname prefix
|
||||
NEAREST_HOSTNAME,
|
||||
/// just like NEAREST_HOSTNAME, but it count distinguished characters in a levenshtein distance manner
|
||||
HOSTNAME_LEVENSHTEIN_DISTANCE,
|
||||
// replicas with the same number of errors are accessed in the same order
|
||||
// as they are specified in the configuration.
|
||||
IN_ORDER,
|
||||
|
@ -116,52 +116,28 @@ DatabaseReplicated::DatabaseReplicated(
|
||||
|
||||
if (!db_settings.collection_name.value.empty())
|
||||
fillClusterAuthInfo(db_settings.collection_name.value, context_->getConfigRef());
|
||||
|
||||
replica_group_name = context_->getConfigRef().getString("replica_group_name", "");
|
||||
|
||||
if (replica_group_name.find('/') != std::string::npos)
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Replica group name should not contain '/': {}", replica_group_name);
|
||||
if (replica_group_name.find('|') != std::string::npos)
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Replica group name should not contain '|': {}", replica_group_name);
|
||||
}
|
||||
|
||||
String DatabaseReplicated::getFullReplicaName(const String & shard, const String & replica, const String & replica_group)
|
||||
String DatabaseReplicated::getFullReplicaName(const String & shard, const String & replica)
|
||||
{
|
||||
if (replica_group.empty())
|
||||
return shard + '|' + replica;
|
||||
else
|
||||
return shard + '|' + replica + '|' + replica_group;
|
||||
return shard + '|' + replica;
|
||||
}
|
||||
|
||||
String DatabaseReplicated::getFullReplicaName() const
|
||||
{
|
||||
return getFullReplicaName(shard_name, replica_name, replica_group_name);
|
||||
return getFullReplicaName(shard_name, replica_name);
|
||||
}
|
||||
|
||||
DatabaseReplicated::NameParts DatabaseReplicated::parseFullReplicaName(const String & name)
|
||||
std::pair<String, String> DatabaseReplicated::parseFullReplicaName(const String & name)
|
||||
{
|
||||
NameParts parts;
|
||||
|
||||
auto pos_first = name.find('|');
|
||||
if (pos_first == std::string::npos)
|
||||
String shard;
|
||||
String replica;
|
||||
auto pos = name.find('|');
|
||||
if (pos == std::string::npos || name.find('|', pos + 1) != std::string::npos)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Incorrect replica identifier: {}", name);
|
||||
|
||||
parts.shard = name.substr(0, pos_first);
|
||||
|
||||
auto pos_second = name.find('|', pos_first + 1);
|
||||
if (pos_second == std::string::npos)
|
||||
{
|
||||
parts.replica = name.substr(pos_first + 1);
|
||||
return parts;
|
||||
}
|
||||
|
||||
if (name.find('|', pos_second + 1) != std::string::npos)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Incorrect replica identifier: {}", name);
|
||||
|
||||
parts.replica = name.substr(pos_first + 1, pos_second - pos_first - 1);
|
||||
parts.replica_group = name.substr(pos_second + 1);
|
||||
|
||||
return parts;
|
||||
shard = name.substr(0, pos);
|
||||
replica = name.substr(pos + 1);
|
||||
return {shard, replica};
|
||||
}
|
||||
|
||||
ClusterPtr DatabaseReplicated::tryGetCluster() const
|
||||
@ -199,7 +175,6 @@ void DatabaseReplicated::setCluster(ClusterPtr && new_cluster)
|
||||
|
||||
ClusterPtr DatabaseReplicated::getClusterImpl() const
|
||||
{
|
||||
Strings unfiltered_hosts;
|
||||
Strings hosts;
|
||||
Strings host_ids;
|
||||
|
||||
@ -211,18 +186,11 @@ ClusterPtr DatabaseReplicated::getClusterImpl() const
|
||||
{
|
||||
host_ids.resize(0);
|
||||
Coordination::Stat stat;
|
||||
unfiltered_hosts = zookeeper->getChildren(zookeeper_path + "/replicas", &stat);
|
||||
if (unfiltered_hosts.empty())
|
||||
hosts = zookeeper->getChildren(zookeeper_path + "/replicas", &stat);
|
||||
if (hosts.empty())
|
||||
throw Exception(ErrorCodes::NO_ACTIVE_REPLICAS, "No replicas of database {} found. "
|
||||
"It's possible if the first replica is not fully created yet "
|
||||
"or if the last replica was just dropped or due to logical error", zookeeper_path);
|
||||
|
||||
for (const auto & host : unfiltered_hosts)
|
||||
{
|
||||
if (replica_group_name == parseFullReplicaName(host).replica_group)
|
||||
hosts.push_back(host);
|
||||
}
|
||||
|
||||
Int32 cversion = stat.cversion;
|
||||
::sort(hosts.begin(), hosts.end());
|
||||
|
||||
@ -253,7 +221,7 @@ ClusterPtr DatabaseReplicated::getClusterImpl() const
|
||||
|
||||
assert(!hosts.empty());
|
||||
assert(hosts.size() == host_ids.size());
|
||||
String current_shard = parseFullReplicaName(hosts.front()).shard;
|
||||
String current_shard = parseFullReplicaName(hosts.front()).first;
|
||||
std::vector<std::vector<DatabaseReplicaInfo>> shards;
|
||||
shards.emplace_back();
|
||||
for (size_t i = 0; i < hosts.size(); ++i)
|
||||
@ -261,17 +229,17 @@ ClusterPtr DatabaseReplicated::getClusterImpl() const
|
||||
const auto & id = host_ids[i];
|
||||
if (id == DROPPED_MARK)
|
||||
continue;
|
||||
auto parts = parseFullReplicaName(hosts[i]);
|
||||
auto [shard, replica] = parseFullReplicaName(hosts[i]);
|
||||
auto pos = id.rfind(':');
|
||||
String host_port = id.substr(0, pos);
|
||||
if (parts.shard != current_shard)
|
||||
if (shard != current_shard)
|
||||
{
|
||||
current_shard = parts.shard;
|
||||
current_shard = shard;
|
||||
if (!shards.back().empty())
|
||||
shards.emplace_back();
|
||||
}
|
||||
String hostname = unescapeForFileName(host_port);
|
||||
shards.back().push_back(DatabaseReplicaInfo{std::move(hostname), std::move(parts.shard), std::move(parts.replica), std::move(parts.replica_group)});
|
||||
shards.back().push_back(DatabaseReplicaInfo{std::move(hostname), std::move(shard), std::move(replica)});
|
||||
}
|
||||
|
||||
UInt16 default_port = getContext()->getTCPPort();
|
||||
@ -301,7 +269,7 @@ std::vector<UInt8> DatabaseReplicated::tryGetAreReplicasActive(const ClusterPtr
|
||||
{
|
||||
for (const auto & replica : addresses_with_failover[shard_index])
|
||||
{
|
||||
String full_name = getFullReplicaName(replica.database_shard_name, replica.database_replica_name, replica.database_replica_name);
|
||||
String full_name = getFullReplicaName(replica.database_shard_name, replica.database_replica_name);
|
||||
paths.emplace_back(fs::path(zookeeper_path) / "replicas" / full_name / "active");
|
||||
}
|
||||
}
|
||||
@ -341,7 +309,6 @@ void DatabaseReplicated::fillClusterAuthInfo(String collection_name, const Poco:
|
||||
cluster_auth_info.cluster_secure_connection = config_ref.getBool(config_prefix + ".cluster_secure_connection", false);
|
||||
}
|
||||
|
||||
|
||||
void DatabaseReplicated::tryConnectToZooKeeperAndInitDatabase(LoadingStrictnessLevel mode)
|
||||
{
|
||||
try
|
||||
@ -497,26 +464,8 @@ void DatabaseReplicated::createReplicaNodesInZooKeeper(const zkutil::ZooKeeperPt
|
||||
|
||||
for (int attempts = 10; attempts > 0; --attempts)
|
||||
{
|
||||
Coordination::Stat stat_max_log_ptr;
|
||||
Coordination::Stat stat_replicas;
|
||||
String max_log_ptr_str = current_zookeeper->get(zookeeper_path + "/max_log_ptr", &stat_max_log_ptr);
|
||||
Strings replicas = current_zookeeper->getChildren(zookeeper_path + "/replicas", &stat_replicas);
|
||||
for (const auto & replica : replicas)
|
||||
{
|
||||
NameParts parts = parseFullReplicaName(replica);
|
||||
if (parts.shard == shard_name && parts.replica == replica_name)
|
||||
{
|
||||
throw Exception(
|
||||
ErrorCodes::REPLICA_ALREADY_EXISTS,
|
||||
"Replica {} of shard {} of replicated database already exists in the replica group {} at {}",
|
||||
replica_name, shard_name, parts.replica_group, zookeeper_path);
|
||||
}
|
||||
}
|
||||
|
||||
/// This way we make sure that other replica with the same replica_name and shard_name
|
||||
/// but with a different replica_group_name was not created at the same time.
|
||||
String replica_value = "Last added replica: " + getFullReplicaName();
|
||||
|
||||
Coordination::Stat stat;
|
||||
String max_log_ptr_str = current_zookeeper->get(zookeeper_path + "/max_log_ptr", &stat);
|
||||
Coordination::Requests ops;
|
||||
ops.emplace_back(zkutil::makeCreateRequest(replica_path, host_id, zkutil::CreateMode::Persistent));
|
||||
ops.emplace_back(zkutil::makeCreateRequest(replica_path + "/log_ptr", "0", zkutil::CreateMode::Persistent));
|
||||
@ -524,8 +473,7 @@ void DatabaseReplicated::createReplicaNodesInZooKeeper(const zkutil::ZooKeeperPt
|
||||
/// In addition to creating the replica nodes, we record the max_log_ptr at the instant where
|
||||
/// we declared ourself as an existing replica. We'll need this during recoverLostReplica to
|
||||
/// notify other nodes that issued new queries while this node was recovering.
|
||||
ops.emplace_back(zkutil::makeCheckRequest(zookeeper_path + "/max_log_ptr", stat_max_log_ptr.version));
|
||||
ops.emplace_back(zkutil::makeSetRequest(zookeeper_path + "/replicas", replica_value, stat_replicas.version));
|
||||
ops.emplace_back(zkutil::makeCheckRequest(zookeeper_path + "/max_log_ptr", stat.version));
|
||||
Coordination::Responses responses;
|
||||
const auto code = current_zookeeper->tryMulti(ops, responses);
|
||||
if (code == Coordination::Error::ZOK)
|
||||
@ -756,15 +704,7 @@ BlockIO DatabaseReplicated::tryEnqueueReplicatedDDL(const ASTPtr & query, Contex
|
||||
entry.tracing_context = OpenTelemetry::CurrentContext();
|
||||
String node_path = ddl_worker->tryEnqueueAndExecuteEntry(entry, query_context);
|
||||
|
||||
Strings hosts_to_wait;
|
||||
Strings unfiltered_hosts = getZooKeeper()->getChildren(zookeeper_path + "/replicas");
|
||||
|
||||
for (const auto & host : unfiltered_hosts)
|
||||
{
|
||||
if (replica_group_name == parseFullReplicaName(host).replica_group)
|
||||
hosts_to_wait.push_back(host);
|
||||
}
|
||||
|
||||
Strings hosts_to_wait = getZooKeeper()->getChildren(zookeeper_path + "/replicas");
|
||||
return getDistributedDDLStatus(node_path, entry, query_context, &hosts_to_wait);
|
||||
}
|
||||
|
||||
@ -1172,11 +1112,11 @@ ASTPtr DatabaseReplicated::parseQueryFromMetadataInZooKeeper(const String & node
|
||||
}
|
||||
|
||||
void DatabaseReplicated::dropReplica(
|
||||
DatabaseReplicated * database, const String & database_zookeeper_path, const String & shard, const String & replica, const String & replica_group)
|
||||
DatabaseReplicated * database, const String & database_zookeeper_path, const String & shard, const String & replica)
|
||||
{
|
||||
assert(!database || database_zookeeper_path == database->zookeeper_path);
|
||||
|
||||
String full_replica_name = shard.empty() ? replica : getFullReplicaName(shard, replica, replica_group);
|
||||
String full_replica_name = shard.empty() ? replica : getFullReplicaName(shard, replica);
|
||||
|
||||
if (full_replica_name.find('/') != std::string::npos)
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Invalid replica name, '/' is not allowed: {}", full_replica_name);
|
||||
|
@ -54,19 +54,11 @@ public:
|
||||
|
||||
void stopReplication() override;
|
||||
|
||||
struct NameParts
|
||||
{
|
||||
String shard;
|
||||
String replica;
|
||||
String replica_group;
|
||||
};
|
||||
|
||||
String getShardName() const { return shard_name; }
|
||||
String getReplicaName() const { return replica_name; }
|
||||
String getReplicaGroupName() const { return replica_group_name; }
|
||||
String getFullReplicaName() const;
|
||||
static String getFullReplicaName(const String & shard, const String & replica, const String & replica_group);
|
||||
static NameParts parseFullReplicaName(const String & name);
|
||||
static String getFullReplicaName(const String & shard, const String & replica);
|
||||
static std::pair<String, String> parseFullReplicaName(const String & name);
|
||||
|
||||
const String & getZooKeeperPath() const { return zookeeper_path; }
|
||||
|
||||
@ -88,7 +80,7 @@ public:
|
||||
|
||||
bool shouldReplicateQuery(const ContextPtr & query_context, const ASTPtr & query_ptr) const override;
|
||||
|
||||
static void dropReplica(DatabaseReplicated * database, const String & database_zookeeper_path, const String & shard, const String & replica, const String & replica_group);
|
||||
static void dropReplica(DatabaseReplicated * database, const String & database_zookeeper_path, const String & shard, const String & replica);
|
||||
|
||||
std::vector<UInt8> tryGetAreReplicasActive(const ClusterPtr & cluster_) const;
|
||||
|
||||
@ -134,7 +126,6 @@ private:
|
||||
String zookeeper_path;
|
||||
String shard_name;
|
||||
String replica_name;
|
||||
String replica_group_name;
|
||||
String replica_path;
|
||||
DatabaseReplicatedSettings db_settings;
|
||||
|
||||
|
@ -170,6 +170,7 @@ FormatSettings getFormatSettings(ContextPtr context, const Settings & settings)
|
||||
format_settings.tsv.skip_trailing_empty_lines = settings.input_format_tsv_skip_trailing_empty_lines;
|
||||
format_settings.tsv.allow_variable_number_of_columns = settings.input_format_tsv_allow_variable_number_of_columns;
|
||||
format_settings.values.accurate_types_of_literals = settings.input_format_values_accurate_types_of_literals;
|
||||
format_settings.values.allow_data_after_semicolon = settings.input_format_values_allow_data_after_semicolon;
|
||||
format_settings.values.deduce_templates_of_expressions = settings.input_format_values_deduce_templates_of_expressions;
|
||||
format_settings.values.interpret_expressions = settings.input_format_values_interpret_expressions;
|
||||
format_settings.with_names_use_header = settings.input_format_with_names_use_header;
|
||||
|
@ -341,6 +341,7 @@ struct FormatSettings
|
||||
bool interpret_expressions = true;
|
||||
bool deduce_templates_of_expressions = true;
|
||||
bool accurate_types_of_literals = true;
|
||||
bool allow_data_after_semicolon = false;
|
||||
} values;
|
||||
|
||||
enum class ORCCompression
|
||||
|
97
src/Functions/byteSwap.cpp
Normal file
97
src/Functions/byteSwap.cpp
Normal file
@ -0,0 +1,97 @@
|
||||
#include <Functions/FunctionFactory.h>
|
||||
#include <Functions/FunctionUnaryArithmetic.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
template <typename T>
|
||||
requires std::is_integral_v<T>
|
||||
T byteSwap(T x)
|
||||
{
|
||||
return std::byteswap(x);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T byteSwap(T)
|
||||
{
|
||||
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "byteSwap() is not implemented for {} datatype", demangle(typeid(T).name()));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
struct ByteSwapImpl
|
||||
{
|
||||
using ResultType = T;
|
||||
static constexpr const bool allow_string_or_fixed_string = false;
|
||||
static T apply(T x) { return byteSwap<T>(x); }
|
||||
|
||||
#if USE_EMBEDDED_COMPILER
|
||||
static constexpr bool compilable = false;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct NameByteSwap
|
||||
{
|
||||
static constexpr auto name = "byteSwap";
|
||||
};
|
||||
using FunctionByteSwap = FunctionUnaryArithmetic<ByteSwapImpl, NameByteSwap, true>;
|
||||
|
||||
}
|
||||
|
||||
template <>
|
||||
struct FunctionUnaryArithmeticMonotonicity<NameByteSwap>
|
||||
{
|
||||
static bool has() { return false; }
|
||||
static IFunction::Monotonicity get(const Field &, const Field &) { return {}; }
|
||||
};
|
||||
|
||||
REGISTER_FUNCTION(ByteSwap)
|
||||
{
|
||||
factory.registerFunction<FunctionByteSwap>(
|
||||
FunctionDocumentation{
|
||||
.description = R"(
|
||||
Reverses the bytes of an integer, i.e. changes its [endianness](https://en.wikipedia.org/wiki/Endianness). Currently, integers of up to 64 bit are supported.
|
||||
|
||||
**Example**
|
||||
|
||||
```sql
|
||||
byteSwap(3351772109)
|
||||
```
|
||||
|
||||
Result:
|
||||
|
||||
```result
|
||||
┌─byteSwap(3351772109)─┐
|
||||
│ 3455829959 │
|
||||
└──────────────────────┘
|
||||
```
|
||||
|
||||
The above example can be worked out in the following manner:
|
||||
1. Convert the base-10 integer to its equivalent hexadecimal format in big-endian format, i.e. 3351772109 -> C7 C7 FB CD (4 bytes)
|
||||
2. Reverse the bytes, i.e. C7 C7 FB CD -> CD FB C7 C7
|
||||
3. Convert the result back to an integer assuming big-endian, i.e. CD FB C7 C7 -> 3455829959
|
||||
|
||||
One use-case of this function is reversing IPv4s:
|
||||
|
||||
```result
|
||||
┌─toIPv4(byteSwap(toUInt32(toIPv4('205.251.199.199'))))─┐
|
||||
│ 199.199.251.205 │
|
||||
└───────────────────────────────────────────────────────┘
|
||||
```
|
||||
)",
|
||||
.examples{
|
||||
{"8-bit", "SELECT byteSwap(54)", "54"},
|
||||
{"16-bit", "SELECT byteSwap(4135)", "10000"},
|
||||
{"32-bit", "SELECT byteSwap(3351772109)", "3455829959"},
|
||||
{"64-bit", "SELECT byteSwap(123294967295)", "18439412204227788800"},
|
||||
},
|
||||
.categories{"Mathematical", "Arithmetic"}},
|
||||
FunctionFactory::CaseInsensitive);
|
||||
}
|
||||
|
||||
}
|
@ -159,7 +159,6 @@ Cluster::Address::Address(
|
||||
host_name = parsed_host_port.first;
|
||||
database_shard_name = info.shard_name;
|
||||
database_replica_name = info.replica_name;
|
||||
database_replica_group_name = info.replica_group_name;
|
||||
port = parsed_host_port.second;
|
||||
secure = params.secure ? Protocol::Secure::Enable : Protocol::Secure::Disable;
|
||||
priority = params.priority;
|
||||
@ -517,7 +516,7 @@ Cluster::Cluster(
|
||||
Addresses current;
|
||||
for (const auto & replica : shard)
|
||||
current.emplace_back(
|
||||
DatabaseReplicaInfo{replica, "", "", ""},
|
||||
DatabaseReplicaInfo{replica, "", ""},
|
||||
params,
|
||||
current_shard_num,
|
||||
current.size() + 1);
|
||||
|
@ -35,7 +35,6 @@ struct DatabaseReplicaInfo
|
||||
String hostname;
|
||||
String shard_name;
|
||||
String replica_name;
|
||||
String replica_group_name;
|
||||
};
|
||||
|
||||
struct ClusterConnectionParameters
|
||||
@ -112,7 +111,6 @@ public:
|
||||
String host_name;
|
||||
String database_shard_name;
|
||||
String database_replica_name;
|
||||
String database_replica_group_name;
|
||||
UInt16 port{0};
|
||||
String user;
|
||||
String password;
|
||||
|
@ -167,6 +167,9 @@ ZooKeeperPtr DDLWorker::getAndSetZooKeeper()
|
||||
|
||||
DDLTaskPtr DDLWorker::initAndCheckTask(const String & entry_name, String & out_reason, const ZooKeeperPtr & zookeeper)
|
||||
{
|
||||
if (entries_to_skip.contains(entry_name))
|
||||
return {};
|
||||
|
||||
String node_data;
|
||||
String entry_path = fs::path(queue_dir) / entry_name;
|
||||
|
||||
@ -186,6 +189,12 @@ DDLTaskPtr DDLWorker::initAndCheckTask(const String & entry_name, String & out_r
|
||||
zookeeper->tryCreate(fs::path(entry_path) / "finished" / host_id, status.serializeText(), zkutil::CreateMode::Persistent);
|
||||
};
|
||||
|
||||
auto add_to_skip_set = [&]()
|
||||
{
|
||||
entries_to_skip.insert(entry_name);
|
||||
return nullptr;
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
/// Stage 1: parse entry
|
||||
@ -198,7 +207,7 @@ DDLTaskPtr DDLWorker::initAndCheckTask(const String & entry_name, String & out_r
|
||||
/// Otherwise, that node will be ignored by DDLQueryStatusSource.
|
||||
out_reason = "Incorrect task format";
|
||||
write_error_status(host_fqdn_id, ExecutionStatus::fromCurrentException(), out_reason);
|
||||
return {};
|
||||
return add_to_skip_set();
|
||||
}
|
||||
|
||||
/// Stage 2: resolve host_id and check if we should execute query or not
|
||||
@ -207,7 +216,7 @@ DDLTaskPtr DDLWorker::initAndCheckTask(const String & entry_name, String & out_r
|
||||
if (!task->findCurrentHostID(context, log))
|
||||
{
|
||||
out_reason = "There is no a local address in host list";
|
||||
return {};
|
||||
return add_to_skip_set();
|
||||
}
|
||||
|
||||
try
|
||||
@ -223,13 +232,13 @@ DDLTaskPtr DDLWorker::initAndCheckTask(const String & entry_name, String & out_r
|
||||
{
|
||||
out_reason = "Cannot parse query or obtain cluster info";
|
||||
write_error_status(task->host_id_str, ExecutionStatus::fromCurrentException(), out_reason);
|
||||
return {};
|
||||
return add_to_skip_set();
|
||||
}
|
||||
|
||||
if (zookeeper->exists(task->getFinishedNodePath()))
|
||||
{
|
||||
out_reason = TASK_PROCESSED_OUT_REASON;
|
||||
return {};
|
||||
return add_to_skip_set();
|
||||
}
|
||||
|
||||
/// Now task is ready for execution
|
||||
@ -955,6 +964,7 @@ void DDLWorker::cleanupQueue(Int64, const ZooKeeperPtr & zookeeper)
|
||||
continue;
|
||||
}
|
||||
zkutil::KeeperMultiException::check(rm_entry_res, ops, res);
|
||||
entries_to_skip.remove(node_name);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
|
@ -13,7 +13,9 @@
|
||||
#include <chrono>
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
#include <shared_mutex>
|
||||
#include <thread>
|
||||
#include <unordered_set>
|
||||
|
||||
namespace zkutil
|
||||
{
|
||||
@ -79,6 +81,33 @@ public:
|
||||
ZooKeeperPtr getAndSetZooKeeper();
|
||||
|
||||
protected:
|
||||
|
||||
class ConcurrentSet
|
||||
{
|
||||
public:
|
||||
bool contains(const String & key) const
|
||||
{
|
||||
std::shared_lock lock(mtx);
|
||||
return set.contains(key);
|
||||
}
|
||||
|
||||
bool insert(const String & key)
|
||||
{
|
||||
std::unique_lock lock(mtx);
|
||||
return set.emplace(key).second;
|
||||
}
|
||||
|
||||
bool remove(const String & key)
|
||||
{
|
||||
std::unique_lock lock(mtx);
|
||||
return set.erase(key);
|
||||
}
|
||||
|
||||
private:
|
||||
std::unordered_set<String> set;
|
||||
mutable std::shared_mutex mtx;
|
||||
};
|
||||
|
||||
/// Iterates through queue tasks in ZooKeeper, runs execution of new tasks
|
||||
void scheduleTasks(bool reinitialized);
|
||||
|
||||
@ -160,6 +189,9 @@ protected:
|
||||
size_t max_tasks_in_queue = 1000;
|
||||
|
||||
std::atomic<UInt32> max_id = 0;
|
||||
|
||||
ConcurrentSet entries_to_skip;
|
||||
|
||||
const CurrentMetrics::Metric * max_entry_metric;
|
||||
const CurrentMetrics::Metric * max_pushed_entry_metric;
|
||||
};
|
||||
|
@ -4,7 +4,6 @@
|
||||
#include <Interpreters/DatabaseAndTableWithAlias.h>
|
||||
#include <Interpreters/InDepthNodeVisitor.h>
|
||||
#include <Interpreters/QueryAliasesVisitor.h>
|
||||
#include <Interpreters/getHeaderForProcessingStage.h>
|
||||
#include <Interpreters/getTableExpressions.h>
|
||||
|
||||
namespace DB
|
||||
|
@ -927,7 +927,7 @@ void InterpreterSystemQuery::dropDatabaseReplica(ASTSystemQuery & query)
|
||||
if (!query_.replica_zk_path.empty() && fs::path(replicated->getZooKeeperPath()) != fs::path(query_.replica_zk_path))
|
||||
return;
|
||||
String full_replica_name = query_.shard.empty() ? query_.replica
|
||||
: DatabaseReplicated::getFullReplicaName(query_.shard, query_.replica, query_.replica_group);
|
||||
: DatabaseReplicated::getFullReplicaName(query_.shard, query_.replica);
|
||||
if (replicated->getFullReplicaName() != full_replica_name)
|
||||
return;
|
||||
|
||||
@ -943,7 +943,7 @@ void InterpreterSystemQuery::dropDatabaseReplica(ASTSystemQuery & query)
|
||||
if (auto * replicated = dynamic_cast<DatabaseReplicated *>(database.get()))
|
||||
{
|
||||
check_not_local_replica(replicated, query);
|
||||
DatabaseReplicated::dropReplica(replicated, replicated->getZooKeeperPath(), query.shard, query.replica, query.replica_group);
|
||||
DatabaseReplicated::dropReplica(replicated, replicated->getZooKeeperPath(), query.shard, query.replica);
|
||||
}
|
||||
else
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Database {} is not Replicated, cannot drop replica", query.getDatabase());
|
||||
@ -968,7 +968,7 @@ void InterpreterSystemQuery::dropDatabaseReplica(ASTSystemQuery & query)
|
||||
}
|
||||
|
||||
check_not_local_replica(replicated, query);
|
||||
DatabaseReplicated::dropReplica(replicated, replicated->getZooKeeperPath(), query.shard, query.replica, query.replica_group);
|
||||
DatabaseReplicated::dropReplica(replicated, replicated->getZooKeeperPath(), query.shard, query.replica);
|
||||
LOG_TRACE(log, "Dropped replica {} of Replicated database {}", query.replica, backQuoteIfNeed(database->getDatabaseName()));
|
||||
}
|
||||
}
|
||||
@ -981,7 +981,7 @@ void InterpreterSystemQuery::dropDatabaseReplica(ASTSystemQuery & query)
|
||||
if (auto * replicated = dynamic_cast<DatabaseReplicated *>(elem.second.get()))
|
||||
check_not_local_replica(replicated, query);
|
||||
|
||||
DatabaseReplicated::dropReplica(nullptr, query.replica_zk_path, query.shard, query.replica, query.replica_group);
|
||||
DatabaseReplicated::dropReplica(nullptr, query.replica_zk_path, query.shard, query.replica);
|
||||
LOG_INFO(log, "Dropped replica {} of Replicated database with path {}", query.replica, query.replica_zk_path);
|
||||
}
|
||||
else
|
||||
|
@ -357,9 +357,9 @@ Chunk DDLQueryStatusSource::generateChunkWithUnfinishedHosts() const
|
||||
size_t num = 0;
|
||||
if (is_replicated_database)
|
||||
{
|
||||
auto parts = DatabaseReplicated::parseFullReplicaName(host_id);
|
||||
columns[num++]->insert(parts.shard);
|
||||
columns[num++]->insert(parts.replica);
|
||||
auto [shard, replica] = DatabaseReplicated::parseFullReplicaName(host_id);
|
||||
columns[num++]->insert(shard);
|
||||
columns[num++]->insert(replica);
|
||||
if (active_hosts_set.contains(host_id))
|
||||
columns[num++]->insert(IN_PROGRESS);
|
||||
else
|
||||
@ -511,9 +511,9 @@ Chunk DDLQueryStatusSource::generate()
|
||||
{
|
||||
if (status.code != 0)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "There was an error on {}: {} (probably it's a bug)", host_id, status.message);
|
||||
auto parts = DatabaseReplicated::parseFullReplicaName(host_id);
|
||||
columns[num++]->insert(parts.shard);
|
||||
columns[num++]->insert(parts.replica);
|
||||
auto [shard, replica] = DatabaseReplicated::parseFullReplicaName(host_id);
|
||||
columns[num++]->insert(shard);
|
||||
columns[num++]->insert(replica);
|
||||
columns[num++]->insert(OK);
|
||||
}
|
||||
else
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include <Analyzer/QueryNode.h>
|
||||
#include <Analyzer/Utils.h>
|
||||
#include <Interpreters/getHeaderForProcessingStage.h>
|
||||
#include <Interpreters/InterpreterSelectQuery.h>
|
||||
#include <Interpreters/InterpreterSelectQueryAnalyzer.h>
|
||||
@ -8,6 +10,7 @@
|
||||
#include <Parsers/ASTFunction.h>
|
||||
#include <Parsers/ASTIdentifier.h>
|
||||
#include <Parsers/ASTTablesInSelectQuery.h>
|
||||
#include <Planner/Utils.h>
|
||||
#include <Processors/Sources/SourceFromSingleChunk.h>
|
||||
|
||||
namespace DB
|
||||
@ -16,7 +19,6 @@ namespace DB
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int LOGICAL_ERROR;
|
||||
extern const int UNSUPPORTED_METHOD;
|
||||
}
|
||||
|
||||
bool hasJoin(const ASTSelectQuery & select)
|
||||
@ -124,13 +126,27 @@ Block getHeaderForProcessingStage(
|
||||
ASTPtr query = query_info.query;
|
||||
if (const auto * select = query_info.query->as<ASTSelectQuery>(); select && hasJoin(*select))
|
||||
{
|
||||
/// TODO: Analyzer syntax analyzer result
|
||||
if (!query_info.syntax_analyzer_result)
|
||||
throw Exception(ErrorCodes::UNSUPPORTED_METHOD, "getHeaderForProcessingStage is unsupported");
|
||||
{
|
||||
if (!query_info.planner_context)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Query is not analyzed: no planner context");
|
||||
|
||||
query = query_info.query->clone();
|
||||
TreeRewriterResult new_rewriter_result = *query_info.syntax_analyzer_result;
|
||||
removeJoin(*query->as<ASTSelectQuery>(), new_rewriter_result, context);
|
||||
const auto & query_node = query_info.query_tree->as<QueryNode &>();
|
||||
const auto & join_tree = query_node.getJoinTree();
|
||||
auto left_table_expression = extractLeftTableExpression(join_tree);
|
||||
|
||||
auto & table_expression_data = query_info.planner_context->getTableExpressionDataOrThrow(left_table_expression);
|
||||
const auto & query_context = query_info.planner_context->getQueryContext();
|
||||
auto columns = table_expression_data.getColumns();
|
||||
auto new_query_node = buildSubqueryToReadColumnsFromTableExpression(columns, left_table_expression, query_context);
|
||||
query = new_query_node->toAST();
|
||||
}
|
||||
else
|
||||
{
|
||||
query = query_info.query->clone();
|
||||
TreeRewriterResult new_rewriter_result = *query_info.syntax_analyzer_result;
|
||||
removeJoin(*query->as<ASTSelectQuery>(), new_rewriter_result, context);
|
||||
}
|
||||
}
|
||||
|
||||
Block result;
|
||||
|
@ -107,7 +107,6 @@ public:
|
||||
String replica;
|
||||
String shard;
|
||||
String replica_zk_path;
|
||||
String replica_group;
|
||||
bool is_drop_whole_replica{};
|
||||
String storage_policy;
|
||||
String volume;
|
||||
|
@ -165,14 +165,6 @@ enum class SystemQueryTargetType
|
||||
if (!ParserStringLiteral{}.parse(pos, ast, expected))
|
||||
return false;
|
||||
res->shard = ast->as<ASTLiteral &>().value.safeGet<String>();
|
||||
|
||||
if (database && ParserKeyword{"FROM GROUP"}.ignore(pos, expected))
|
||||
{
|
||||
ASTPtr group_ast;
|
||||
if (!ParserStringLiteral{}.parse(pos, group_ast, expected))
|
||||
return false;
|
||||
res->replica_group = group_ast->as<ASTLiteral &>().value.safeGet<String>();
|
||||
}
|
||||
}
|
||||
|
||||
if (ParserKeyword{"FROM"}.ignore(pos, expected))
|
||||
|
@ -1248,7 +1248,26 @@ JoinTreeQueryPlan buildQueryPlanForJoinNode(const QueryTreeNodePtr & join_table_
|
||||
const auto & join_clause = table_join->getOnlyClause();
|
||||
|
||||
bool kind_allows_filtering = isInner(join_kind) || isLeft(join_kind) || isRight(join_kind);
|
||||
if (settings.max_rows_in_set_to_optimize_join > 0 && kind_allows_filtering)
|
||||
|
||||
auto has_non_const = [](const Block & block, const auto & keys)
|
||||
{
|
||||
for (const auto & key : keys)
|
||||
{
|
||||
const auto & column = block.getByName(key).column;
|
||||
if (column && !isColumnConst(*column))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
/// This optimization relies on the sorting that should buffer data from both streams before emitting any rows.
|
||||
/// Sorting on a stream with const keys can start returning rows immediately and pipeline may stuck.
|
||||
/// Note: it's also doesn't work with the read-in-order optimization.
|
||||
/// No checks here because read in order is not applied if we have `CreateSetAndFilterOnTheFlyStep` in the pipeline between the reading and sorting steps.
|
||||
bool has_non_const_keys = has_non_const(left_plan.getCurrentDataStream().header, join_clause.key_names_left)
|
||||
&& has_non_const(right_plan.getCurrentDataStream().header, join_clause.key_names_right);
|
||||
|
||||
if (settings.max_rows_in_set_to_optimize_join > 0 && kind_allows_filtering && has_non_const_keys)
|
||||
{
|
||||
auto * left_set = add_create_set(left_plan, join_clause.key_names_left, JoinTableSide::Left);
|
||||
auto * right_set = add_create_set(right_plan, join_clause.key_names_right, JoinTableSide::Right);
|
||||
|
@ -584,13 +584,17 @@ std::shared_ptr<DirectKeyValueJoin> tryDirectJoin(const std::shared_ptr<TableJoi
|
||||
const String & key_name = clauses[0].key_names_right[0];
|
||||
|
||||
auto & right_table_expression_data = planner_context->getTableExpressionDataOrThrow(right_table_expression);
|
||||
const auto * table_column_name = right_table_expression_data.getColumnNameOrNull(key_name);
|
||||
if (!table_column_name)
|
||||
return {};
|
||||
|
||||
const auto & storage_primary_key = storage->getPrimaryKey();
|
||||
if (storage_primary_key.size() != 1 || storage_primary_key[0] != *table_column_name)
|
||||
if (const auto * table_column_name = right_table_expression_data.getColumnNameOrNull(key_name))
|
||||
{
|
||||
const auto & storage_primary_key = storage->getPrimaryKey();
|
||||
if (storage_primary_key.size() != 1 || storage_primary_key[0] != *table_column_name)
|
||||
return {};
|
||||
}
|
||||
else
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
/** For right table expression during execution columns have unique name.
|
||||
* Direct key value join implementation during storage querying must use storage column names.
|
||||
@ -608,8 +612,8 @@ std::shared_ptr<DirectKeyValueJoin> tryDirectJoin(const std::shared_ptr<TableJoi
|
||||
|
||||
for (const auto & right_table_expression_column : right_table_expression_header)
|
||||
{
|
||||
const auto * table_column_name_ = right_table_expression_data.getColumnNameOrNull(right_table_expression_column.name);
|
||||
if (!table_column_name_)
|
||||
const auto * table_column_name = right_table_expression_data.getColumnNameOrNull(right_table_expression_column.name);
|
||||
if (!table_column_name)
|
||||
return {};
|
||||
|
||||
auto right_table_expression_column_with_storage_column_name = right_table_expression_column;
|
||||
|
@ -17,6 +17,7 @@ static FormatSettings updateFormatSettings(const FormatSettings & settings, cons
|
||||
updated.skip_unknown_fields = true;
|
||||
updated.with_names_use_header = true;
|
||||
updated.date_time_input_format = FormatSettings::DateTimeInputFormat::BestEffort;
|
||||
updated.defaults_for_omitted_fields = true;
|
||||
updated.csv.delimiter = updated.hive_text.fields_delimiter;
|
||||
if (settings.hive_text.input_field_names.empty())
|
||||
updated.hive_text.input_field_names = header.getNames();
|
||||
|
@ -617,10 +617,12 @@ void ValuesBlockInputFormat::readSuffix()
|
||||
skipWhitespaceIfAny(*buf);
|
||||
if (buf->hasUnreadData())
|
||||
throw Exception(ErrorCodes::CANNOT_READ_ALL_DATA, "Cannot read data after semicolon");
|
||||
if (!format_settings.values.allow_data_after_semicolon && !buf->eof())
|
||||
throw Exception(ErrorCodes::CANNOT_READ_ALL_DATA, "Cannot read data after semicolon (and input_format_values_allow_data_after_semicolon=0)");
|
||||
return;
|
||||
}
|
||||
|
||||
if (buf->hasUnreadData())
|
||||
if (buf->hasUnreadData() || !buf->eof())
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Unread data in PeekableReadBuffer will be lost. Most likely it's a bug.");
|
||||
}
|
||||
|
||||
|
@ -206,6 +206,8 @@ struct Settings;
|
||||
MAKE_OBSOLETE_MERGE_TREE_SETTING(M, MaxThreads, max_part_loading_threads, 0) \
|
||||
MAKE_OBSOLETE_MERGE_TREE_SETTING(M, MaxThreads, max_part_removal_threads, 0) \
|
||||
MAKE_OBSOLETE_MERGE_TREE_SETTING(M, Bool, use_metadata_cache, false) \
|
||||
MAKE_OBSOLETE_MERGE_TREE_SETTING(M, UInt64, merge_tree_enable_clear_old_broken_detached, 0) \
|
||||
MAKE_OBSOLETE_MERGE_TREE_SETTING(M, UInt64, merge_tree_clear_old_broken_detached_parts_ttl_timeout_seconds, 1ULL * 3600 * 24 * 30) \
|
||||
|
||||
/// Settings that should not change after the creation of a table.
|
||||
/// NOLINTNEXTLINE
|
||||
|
@ -29,7 +29,7 @@
|
||||
01268_shard_avgweighted
|
||||
01270_optimize_skip_unused_shards_low_cardinality
|
||||
01319_optimize_skip_unused_shards_nesting
|
||||
01353_low_cardinality_join_types
|
||||
01428_nullable_asof_join
|
||||
01455_shard_leaf_max_rows_bytes_to_read
|
||||
01495_subqueries_in_with_statement
|
||||
01504_rocksdb
|
||||
@ -52,7 +52,6 @@
|
||||
01681_bloom_filter_nullable_column
|
||||
01700_system_zookeeper_path_in
|
||||
01710_projection_additional_filters
|
||||
01721_join_implicit_cast_long
|
||||
01739_index_hint
|
||||
02880_indexHint__partition_id
|
||||
01747_join_view_filter_dictionary
|
||||
@ -76,8 +75,6 @@
|
||||
02131_used_row_policies_in_query_log
|
||||
02139_MV_with_scalar_subquery
|
||||
02174_cte_scalar_cache_mv
|
||||
02242_join_rocksdb
|
||||
02267_join_dup_columns_issue36199
|
||||
02302_s3_file_pruning
|
||||
02341_global_join_cte
|
||||
02345_implicit_transaction
|
||||
@ -85,7 +82,6 @@
|
||||
02354_annoy
|
||||
02366_union_decimal_conversion
|
||||
02375_rocksdb_with_filters
|
||||
02382_join_and_filtering_set
|
||||
02402_merge_engine_with_view
|
||||
02404_memory_bound_merging
|
||||
02426_orc_bug
|
||||
|
@ -8,9 +8,10 @@ import logging
|
||||
import time
|
||||
|
||||
from github import Github
|
||||
from github.GithubObject import _NotSetType, NotSet as NotSet
|
||||
from github.Commit import Commit
|
||||
from github.CommitStatus import CommitStatus
|
||||
from github.GithubException import GithubException
|
||||
from github.GithubObject import _NotSetType, NotSet as NotSet
|
||||
from github.IssueComment import IssueComment
|
||||
from github.PullRequest import PullRequest
|
||||
from github.Repository import Repository
|
||||
@ -336,7 +337,18 @@ def remove_labels(gh: Github, pr_info: PRInfo, labels_names: List[str]) -> None:
|
||||
repo = get_repo(gh)
|
||||
pull_request = repo.get_pull(pr_info.number)
|
||||
for label in labels_names:
|
||||
pull_request.remove_from_labels(label)
|
||||
try:
|
||||
pull_request.remove_from_labels(label)
|
||||
except GithubException as exc:
|
||||
if not (
|
||||
exc.status == 404
|
||||
and isinstance(exc.data, dict)
|
||||
and exc.data.get("message", "") == "Label does not exist"
|
||||
):
|
||||
raise
|
||||
logging.warning(
|
||||
"The label '%s' does not exist in PR #%s", pr_info.number, label
|
||||
)
|
||||
pr_info.labels.remove(label)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<clickhouse>
|
||||
<zookeeper>
|
||||
<!--<zookeeper_load_balancing>random / in_order / nearest_hostname / first_or_random / round_robin</zookeeper_load_balancing>-->
|
||||
<!--<zookeeper_load_balancing>random / in_order / nearest_hostname / hostname_levenshtein_distance / first_or_random / round_robin</zookeeper_load_balancing>-->
|
||||
<zookeeper_load_balancing>random</zookeeper_load_balancing>
|
||||
<node index="1">
|
||||
<host>localhost</host>
|
||||
|
@ -140,6 +140,16 @@ def test_load_balancing_nearest_hostname():
|
||||
assert unique_nodes == set(["n1"])
|
||||
|
||||
|
||||
def test_load_balancing_hostname_levenshtein_distance():
|
||||
unique_nodes = set()
|
||||
for _ in range(0, queries):
|
||||
unique_nodes.add(
|
||||
get_node(n1, settings={"load_balancing": "hostname_levenshtein_distance"})
|
||||
)
|
||||
assert len(unique_nodes) == 1, unique_nodes
|
||||
assert unique_nodes == set(["n1"])
|
||||
|
||||
|
||||
def test_load_balancing_in_order():
|
||||
unique_nodes = set()
|
||||
for _ in range(0, queries):
|
||||
|
@ -1,3 +0,0 @@
|
||||
<clickhouse>
|
||||
<replica_group_name>backups</replica_group_name>
|
||||
</clickhouse>
|
@ -1,14 +0,0 @@
|
||||
<clickhouse>
|
||||
<profiles>
|
||||
<default>
|
||||
<allow_drop_detached>1</allow_drop_detached>
|
||||
<allow_experimental_database_replicated>1</allow_experimental_database_replicated>
|
||||
<allow_experimental_alter_materialized_view_structure>1</allow_experimental_alter_materialized_view_structure>
|
||||
</default>
|
||||
</profiles>
|
||||
<users>
|
||||
<default>
|
||||
<profile>default</profile>
|
||||
</default>
|
||||
</users>
|
||||
</clickhouse>
|
@ -1,129 +0,0 @@
|
||||
import re
|
||||
import pytest
|
||||
|
||||
from helpers.cluster import ClickHouseCluster
|
||||
from helpers.test_tools import assert_eq_with_retry
|
||||
|
||||
cluster = ClickHouseCluster(__file__)
|
||||
|
||||
main_node_1 = cluster.add_instance(
|
||||
"main_node_1",
|
||||
user_configs=["configs/settings.xml"],
|
||||
with_zookeeper=True,
|
||||
stay_alive=True,
|
||||
macros={"shard": 1, "replica": 1},
|
||||
)
|
||||
main_node_2 = cluster.add_instance(
|
||||
"main_node_2",
|
||||
user_configs=["configs/settings.xml"],
|
||||
with_zookeeper=True,
|
||||
stay_alive=True,
|
||||
macros={"shard": 1, "replica": 2},
|
||||
)
|
||||
backup_node_1 = cluster.add_instance(
|
||||
"backup_node_1",
|
||||
main_configs=["configs/backup_group.xml"],
|
||||
user_configs=["configs/settings.xml"],
|
||||
with_zookeeper=True,
|
||||
stay_alive=True,
|
||||
macros={"shard": 1, "replica": 3},
|
||||
)
|
||||
backup_node_2 = cluster.add_instance(
|
||||
"backup_node_2",
|
||||
main_configs=["configs/backup_group.xml"],
|
||||
user_configs=["configs/settings.xml"],
|
||||
with_zookeeper=True,
|
||||
stay_alive=True,
|
||||
macros={"shard": 1, "replica": 4},
|
||||
)
|
||||
|
||||
all_nodes = [
|
||||
main_node_1,
|
||||
main_node_2,
|
||||
backup_node_1,
|
||||
backup_node_2,
|
||||
]
|
||||
|
||||
uuid_regex = re.compile("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}")
|
||||
|
||||
|
||||
def assert_create_query(nodes, table_name, expected):
|
||||
replace_uuid = lambda x: re.sub(uuid_regex, "uuid", x)
|
||||
query = "show create table {}".format(table_name)
|
||||
for node in nodes:
|
||||
assert_eq_with_retry(node, query, expected, get_result=replace_uuid)
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def started_cluster():
|
||||
try:
|
||||
cluster.start()
|
||||
yield cluster
|
||||
|
||||
finally:
|
||||
cluster.shutdown()
|
||||
|
||||
|
||||
def test_cluster_groups(started_cluster):
|
||||
for node in all_nodes:
|
||||
node.query(
|
||||
f"CREATE DATABASE cluster_groups ENGINE = Replicated('/test/cluster_groups', '{node.macros['shard']}', '{node.macros['replica']}');"
|
||||
)
|
||||
|
||||
# 1. system.clusters
|
||||
|
||||
cluster_query = "SELECT host_name from system.clusters WHERE cluster = 'cluster_groups' ORDER BY host_name"
|
||||
expected_main = "main_node_1\nmain_node_2\n"
|
||||
expected_backup = "backup_node_1\nbackup_node_2\n"
|
||||
|
||||
for node in [main_node_1, main_node_2]:
|
||||
assert_eq_with_retry(node, cluster_query, expected_main)
|
||||
|
||||
for node in [backup_node_1, backup_node_2]:
|
||||
assert_eq_with_retry(node, cluster_query, expected_backup)
|
||||
|
||||
# 2. Query execution depends only on your cluster group
|
||||
|
||||
backup_node_1.stop_clickhouse()
|
||||
backup_node_2.stop_clickhouse()
|
||||
|
||||
# OK
|
||||
main_node_1.query(
|
||||
"CREATE TABLE cluster_groups.table_1 (d Date, k UInt64) ENGINE=ReplicatedMergeTree ORDER BY k PARTITION BY toYYYYMM(d);"
|
||||
)
|
||||
|
||||
# Exception
|
||||
main_node_2.stop_clickhouse()
|
||||
settings = {"distributed_ddl_task_timeout": 5}
|
||||
assert (
|
||||
"There are 1 unfinished hosts (0 of them are currently active)"
|
||||
in main_node_1.query_and_get_error(
|
||||
"CREATE TABLE cluster_groups.table_2 (d Date, k UInt64) ENGINE=ReplicatedMergeTree ORDER BY k PARTITION BY toYYYYMM(d);",
|
||||
settings=settings,
|
||||
)
|
||||
)
|
||||
|
||||
# 3. After start both groups are synced
|
||||
|
||||
backup_node_1.start_clickhouse()
|
||||
backup_node_2.start_clickhouse()
|
||||
main_node_2.start_clickhouse()
|
||||
|
||||
expected_1 = "CREATE TABLE cluster_groups.table_1\\n(\\n `d` Date,\\n `k` UInt64\\n)\\nENGINE = ReplicatedMergeTree(\\'/clickhouse/tables/{uuid}/{shard}\\', \\'{replica}\\')\\nPARTITION BY toYYYYMM(d)\\nORDER BY k\\nSETTINGS index_granularity = 8192"
|
||||
expected_2 = "CREATE TABLE cluster_groups.table_2\\n(\\n `d` Date,\\n `k` UInt64\\n)\\nENGINE = ReplicatedMergeTree(\\'/clickhouse/tables/{uuid}/{shard}\\', \\'{replica}\\')\\nPARTITION BY toYYYYMM(d)\\nORDER BY k\\nSETTINGS index_granularity = 8192"
|
||||
|
||||
assert_create_query(all_nodes, "cluster_groups.table_1", expected_1)
|
||||
assert_create_query(all_nodes, "cluster_groups.table_2", expected_2)
|
||||
|
||||
# 4. SYSTEM DROP DATABASE REPLICA
|
||||
backup_node_2.stop_clickhouse()
|
||||
backup_node_1.query(
|
||||
"SYSTEM DROP DATABASE REPLICA '4' FROM SHARD '1' FROM GROUP 'backups' FROM DATABASE cluster_groups"
|
||||
)
|
||||
|
||||
assert_eq_with_retry(backup_node_1, cluster_query, "backup_node_1\n")
|
||||
|
||||
main_node_2.stop_clickhouse()
|
||||
main_node_1.query("SYSTEM DROP DATABASE REPLICA '1|2' FROM DATABASE cluster_groups")
|
||||
|
||||
assert_eq_with_retry(main_node_1, cluster_query, "main_node_1\n")
|
@ -312,6 +312,96 @@ def test_nearest_hostname(started_cluster):
|
||||
change_balancing("nearest_hostname", "random", reload=False)
|
||||
|
||||
|
||||
def test_hostname_levenshtein_distance(started_cluster):
|
||||
try:
|
||||
change_balancing("random", "hostname_levenshtein_distance")
|
||||
print(
|
||||
str(
|
||||
node1.exec_in_container(
|
||||
[
|
||||
"bash",
|
||||
"-c",
|
||||
"lsof -a -i4 -i6 -itcp -w | grep ':2181' | grep ESTABLISHED",
|
||||
],
|
||||
privileged=True,
|
||||
user="root",
|
||||
)
|
||||
)
|
||||
)
|
||||
assert (
|
||||
"1"
|
||||
== str(
|
||||
node1.exec_in_container(
|
||||
[
|
||||
"bash",
|
||||
"-c",
|
||||
"lsof -a -i4 -i6 -itcp -w | grep 'testzookeeperconfigloadbalancing_zoo1_1.*testzookeeperconfigloadbalancing_default:2181' | grep ESTABLISHED | wc -l",
|
||||
],
|
||||
privileged=True,
|
||||
user="root",
|
||||
)
|
||||
).strip()
|
||||
)
|
||||
|
||||
print(
|
||||
str(
|
||||
node2.exec_in_container(
|
||||
[
|
||||
"bash",
|
||||
"-c",
|
||||
"lsof -a -i4 -i6 -itcp -w | grep ':2181' | grep ESTABLISHED",
|
||||
],
|
||||
privileged=True,
|
||||
user="root",
|
||||
)
|
||||
)
|
||||
)
|
||||
assert (
|
||||
"1"
|
||||
== str(
|
||||
node2.exec_in_container(
|
||||
[
|
||||
"bash",
|
||||
"-c",
|
||||
"lsof -a -i4 -i6 -itcp -w | grep 'testzookeeperconfigloadbalancing_zoo2_1.*testzookeeperconfigloadbalancing_default:2181' | grep ESTABLISHED | wc -l",
|
||||
],
|
||||
privileged=True,
|
||||
user="root",
|
||||
)
|
||||
).strip()
|
||||
)
|
||||
|
||||
print(
|
||||
str(
|
||||
node3.exec_in_container(
|
||||
[
|
||||
"bash",
|
||||
"-c",
|
||||
"lsof -a -i4 -i6 -itcp -w | grep ':2181' | grep ESTABLISHED",
|
||||
],
|
||||
privileged=True,
|
||||
user="root",
|
||||
)
|
||||
)
|
||||
)
|
||||
assert (
|
||||
"1"
|
||||
== str(
|
||||
node3.exec_in_container(
|
||||
[
|
||||
"bash",
|
||||
"-c",
|
||||
"lsof -a -i4 -i6 -itcp -w | grep 'testzookeeperconfigloadbalancing_zoo3_1.*testzookeeperconfigloadbalancing_default:2181' | grep ESTABLISHED | wc -l",
|
||||
],
|
||||
privileged=True,
|
||||
user="root",
|
||||
)
|
||||
).strip()
|
||||
)
|
||||
finally:
|
||||
change_balancing("hostname_levenshtein_distance", "random", reload=False)
|
||||
|
||||
|
||||
def test_round_robin(started_cluster):
|
||||
pm = PartitionManager()
|
||||
try:
|
||||
|
@ -96,7 +96,7 @@ $CLICKHOUSE_CLIENT --query="DROP TABLE src;"
|
||||
$CLICKHOUSE_CLIENT --query="CREATE TABLE src (p UInt64, k String, d UInt64) ENGINE = MergeTree PARTITION BY p ORDER BY k;"
|
||||
$CLICKHOUSE_CLIENT --query="INSERT INTO src VALUES (1, '0', 1);"
|
||||
$CLICKHOUSE_CLIENT --query="INSERT INTO src VALUES (1, '1', 1);"
|
||||
$CLICKHOUSE_CLIENT --query="INSERT INTO dst_r1 VALUES (1, '1', 2); -- trash part to be deleted"
|
||||
$CLICKHOUSE_CLIENT --query="INSERT INTO dst_r1 VALUES (1, '1', 2);" # trash part to be deleted
|
||||
|
||||
# Stop replication at the second replica and remove source table to use fetch instead of copying
|
||||
$CLICKHOUSE_CLIENT --query="SYSTEM STOP REPLICATION QUEUES dst_r2;"
|
||||
@ -116,7 +116,7 @@ query_with_retry "ALTER TABLE dst_r1 DROP PARTITION 1;"
|
||||
$CLICKHOUSE_CLIENT --query="CREATE TABLE src (p UInt64, k String, d UInt64) ENGINE = MergeTree PARTITION BY p ORDER BY k;"
|
||||
$CLICKHOUSE_CLIENT --query="INSERT INTO src VALUES (1, '0', 1);"
|
||||
$CLICKHOUSE_CLIENT --query="INSERT INTO src VALUES (1, '1', 1);"
|
||||
$CLICKHOUSE_CLIENT --query="INSERT INTO dst_r1 VALUES (1, '1', 2); -- trash part to be deleted"
|
||||
$CLICKHOUSE_CLIENT --query="INSERT INTO dst_r1 VALUES (1, '1', 2);" # trash part to be deleted
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="SYSTEM STOP MERGES dst_r2;"
|
||||
$CLICKHOUSE_CLIENT --query="SYSTEM STOP REPLICATION QUEUES dst_r2;"
|
||||
|
@ -1,615 +0,0 @@
|
||||
-- join_algorithm = default, join_use_nulls = 0 --
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
LowCardinality(String) LowCardinality(String) LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
LowCardinality(String) LowCardinality(String) LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
String String str str LowCardinality(String) LowCardinality(String) str str
|
||||
String String str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
String String str str LowCardinality(String) LowCardinality(String) str str
|
||||
String String str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
String String str str LowCardinality(String) LowCardinality(String) str str
|
||||
String String str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
String String LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
String String str str LowCardinality(String) LowCardinality(String) str str
|
||||
String String str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
String String LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
str String
|
||||
String
|
||||
str String
|
||||
str_r String
|
||||
str String
|
||||
String
|
||||
str_l String
|
||||
str String
|
||||
str_r String
|
||||
str_l String
|
||||
LowCardinality(String) LowCardinality(String) str str String String str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r String String
|
||||
LowCardinality(String) LowCardinality(String) str str String String str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r String String
|
||||
LowCardinality(String) LowCardinality(String) str str String String str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r String String
|
||||
LowCardinality(String) LowCardinality(String) String String str_l str_l
|
||||
LowCardinality(String) LowCardinality(String) str str String String str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r String String
|
||||
LowCardinality(String) LowCardinality(String) String String str_l str_l
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
Nullable(String) Nullable(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
Nullable(String) Nullable(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
Nullable(String) Nullable(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
Nullable(String) Nullable(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str Nullable(String)
|
||||
str_r Nullable(String)
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str_r Nullable(String)
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(String) LowCardinality(String) Nullable(String) Nullable(String) str_l str_l
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) Nullable(String) Nullable(String) str_l str_l
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
-- join_algorithm = default, join_use_nulls = 1 --
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
String String str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
String String str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
String String str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
String String str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str Nullable(String)
|
||||
str_r Nullable(String)
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str_r Nullable(String)
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str Nullable(String)
|
||||
str_r Nullable(String)
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str_r Nullable(String)
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
-- join_algorithm = partial_merge, join_use_nulls = 0 --
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
LowCardinality(String) LowCardinality(String) LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
LowCardinality(String) LowCardinality(String) LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
String String str str LowCardinality(String) LowCardinality(String) str str
|
||||
String String str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
String String str str LowCardinality(String) LowCardinality(String) str str
|
||||
String String str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
String String str str LowCardinality(String) LowCardinality(String) str str
|
||||
String String str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
String String LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
String String str str LowCardinality(String) LowCardinality(String) str str
|
||||
String String str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
String String LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
str String
|
||||
String
|
||||
str String
|
||||
str_r String
|
||||
str String
|
||||
String
|
||||
str_l String
|
||||
str String
|
||||
str_r String
|
||||
str_l String
|
||||
LowCardinality(String) LowCardinality(String) str str String String str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r String String
|
||||
LowCardinality(String) LowCardinality(String) str str String String str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r String String
|
||||
LowCardinality(String) LowCardinality(String) str str String String str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r String String
|
||||
LowCardinality(String) LowCardinality(String) String String str_l str_l
|
||||
LowCardinality(String) LowCardinality(String) str str String String str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r String String
|
||||
LowCardinality(String) LowCardinality(String) String String str_l str_l
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
Nullable(String) Nullable(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
Nullable(String) Nullable(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
Nullable(String) Nullable(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
Nullable(String) Nullable(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str Nullable(String)
|
||||
str_r Nullable(String)
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str_r Nullable(String)
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(String) LowCardinality(String) Nullable(String) Nullable(String) str_l str_l
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) Nullable(String) Nullable(String) str_l str_l
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
-- join_algorithm = partial_merge, join_use_nulls = 1 --
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
String String str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
String String str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
String String str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
String String str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str Nullable(String)
|
||||
str_r Nullable(String)
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str_r Nullable(String)
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str Nullable(String)
|
||||
str_r Nullable(String)
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str_r Nullable(String)
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
-- join_algorithm = parallel_hash, join_use_nulls = 0 --
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
LowCardinality(String) LowCardinality(String) LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
LowCardinality(String) LowCardinality(String) LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
String String str str LowCardinality(String) LowCardinality(String) str str
|
||||
String String str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
String String str str LowCardinality(String) LowCardinality(String) str str
|
||||
String String str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
String String str str LowCardinality(String) LowCardinality(String) str str
|
||||
String String str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
String String LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
String String str str LowCardinality(String) LowCardinality(String) str str
|
||||
String String str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
String String LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
str String
|
||||
String
|
||||
str String
|
||||
str_r String
|
||||
str String
|
||||
String
|
||||
str_l String
|
||||
str String
|
||||
str_r String
|
||||
str_l String
|
||||
LowCardinality(String) LowCardinality(String) str str String String str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r String String
|
||||
LowCardinality(String) LowCardinality(String) str str String String str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r String String
|
||||
LowCardinality(String) LowCardinality(String) str str String String str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r String String
|
||||
LowCardinality(String) LowCardinality(String) String String str_l str_l
|
||||
LowCardinality(String) LowCardinality(String) str str String String str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r String String
|
||||
LowCardinality(String) LowCardinality(String) String String str_l str_l
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
Nullable(String) Nullable(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
Nullable(String) Nullable(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
Nullable(String) Nullable(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
Nullable(String) Nullable(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str Nullable(String)
|
||||
str_r Nullable(String)
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str_r Nullable(String)
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(String) LowCardinality(String) Nullable(String) Nullable(String) str_l str_l
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) Nullable(String) Nullable(String) str_l str_l
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
-- join_algorithm = parallel_hash, join_use_nulls = 1 --
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
String String str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
String String str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
String String str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
String String str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str Nullable(String)
|
||||
str_r Nullable(String)
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str_r Nullable(String)
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
str LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str Nullable(String)
|
||||
str_r Nullable(String)
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str_r Nullable(String)
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
--
|
||||
LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
|
||||
|
||||
str
|
||||
str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String))
|
||||
str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String))
|
||||
\N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String))
|
@ -0,0 +1,635 @@
|
||||
-- { echoOn }
|
||||
SET allow_experimental_analyzer = 0;
|
||||
{% for join_algorithm in ['default', 'partial_merge', 'parallel_hash'] -%}
|
||||
SET join_algorithm = '{{ join_algorithm }}';
|
||||
SET join_use_nulls = 0;
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l RIGHT JOIN r_lc AS r USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l RIGHT JOIN r_lc AS r USING (lc) ORDER BY x, lc;
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l FULL JOIN r_lc AS r USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l FULL JOIN r_lc AS r USING (lc) ORDER BY x, lc;
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
LowCardinality(String) LowCardinality(String) LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
LowCardinality(String) LowCardinality(String) LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
--
|
||||
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l RIGHT JOIN r USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l RIGHT JOIN r USING (lc) ORDER BY x, lc;
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l FULL JOIN r USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l FULL JOIN r USING (lc) ORDER BY x, lc;
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
String String str str LowCardinality(String) LowCardinality(String) str str
|
||||
String String str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
String String str str LowCardinality(String) LowCardinality(String) str str
|
||||
String String str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
String String str str LowCardinality(String) LowCardinality(String) str str
|
||||
String String str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
String String LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
String String str str LowCardinality(String) LowCardinality(String) str str
|
||||
String String str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
String String LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
--
|
||||
|
||||
SELECT lc, toTypeName(lc) FROM l RIGHT JOIN r USING (x) ORDER BY x, lc;
|
||||
str String
|
||||
String
|
||||
SELECT lc, toTypeName(lc) FROM l RIGHT JOIN r USING (lc) ORDER BY x, lc;
|
||||
str String
|
||||
str_r String
|
||||
SELECT lc, toTypeName(lc) FROM l FULL JOIN r USING (x) ORDER BY x, lc;
|
||||
str String
|
||||
String
|
||||
str_l String
|
||||
SELECT lc, toTypeName(lc) FROM l FULL JOIN r USING (lc) ORDER BY x, lc;
|
||||
str String
|
||||
str_r String
|
||||
str_l String
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l RIGHT JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str String String str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r String String
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l RIGHT JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str String String str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r String String
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l FULL JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str String String str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r String String
|
||||
LowCardinality(String) LowCardinality(String) String String str_l str_l
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l FULL JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str String String str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r String String
|
||||
LowCardinality(String) LowCardinality(String) String String str_l str_l
|
||||
--
|
||||
|
||||
SELECT lc, toTypeName(lc) FROM l_lc RIGHT JOIN nr USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
SELECT lc, toTypeName(lc) FROM l_lc RIGHT JOIN nr USING (lc) ORDER BY x, lc;
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
SELECT lc, toTypeName(lc) FROM l_lc FULL JOIN nr USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
SELECT lc, toTypeName(lc) FROM l_lc FULL JOIN nr USING (lc) ORDER BY x, lc;
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN nr AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN nr AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN nr AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN nr AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
--
|
||||
|
||||
SELECT lc, toTypeName(lc) FROM nl RIGHT JOIN r_lc USING (x) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
SELECT lc, toTypeName(lc) FROM nl RIGHT JOIN r_lc USING (lc) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
str_r Nullable(String)
|
||||
SELECT lc, toTypeName(lc) FROM nl FULL JOIN r_lc USING (x) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str_l Nullable(String)
|
||||
SELECT lc, toTypeName(lc) FROM nl FULL JOIN r_lc USING (lc) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str_r Nullable(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM nl AS l RIGHT JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM nl AS l RIGHT JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM nl AS l FULL JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(String) LowCardinality(String) Nullable(String) Nullable(String) str_l str_l
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM nl AS l FULL JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) Nullable(String) Nullable(String) str_l str_l
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
SET join_use_nulls = 1;
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l RIGHT JOIN r_lc AS r USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l RIGHT JOIN r_lc AS r USING (lc) ORDER BY x, lc;
|
||||
str LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l FULL JOIN r_lc AS r USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l FULL JOIN r_lc AS r USING (lc) ORDER BY x, lc;
|
||||
str LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
--
|
||||
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l RIGHT JOIN r USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l RIGHT JOIN r USING (lc) ORDER BY x, lc;
|
||||
str LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l FULL JOIN r USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l FULL JOIN r USING (lc) ORDER BY x, lc;
|
||||
str LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
String String str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
String String str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
String String str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
String String str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
--
|
||||
|
||||
SELECT lc, toTypeName(lc) FROM l RIGHT JOIN r USING (x) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
SELECT lc, toTypeName(lc) FROM l RIGHT JOIN r USING (lc) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
str_r Nullable(String)
|
||||
SELECT lc, toTypeName(lc) FROM l FULL JOIN r USING (x) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str_l Nullable(String)
|
||||
SELECT lc, toTypeName(lc) FROM l FULL JOIN r USING (lc) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str_r Nullable(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l RIGHT JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l RIGHT JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l FULL JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l FULL JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
--
|
||||
|
||||
SELECT lc, toTypeName(lc) FROM l_lc RIGHT JOIN nr USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
SELECT lc, toTypeName(lc) FROM l_lc RIGHT JOIN nr USING (lc) ORDER BY x, lc;
|
||||
str LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
SELECT lc, toTypeName(lc) FROM l_lc FULL JOIN nr USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
SELECT lc, toTypeName(lc) FROM l_lc FULL JOIN nr USING (lc) ORDER BY x, lc;
|
||||
str LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN nr AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN nr AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN nr AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN nr AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
--
|
||||
|
||||
SELECT lc, toTypeName(lc) FROM nl RIGHT JOIN r_lc USING (x) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
SELECT lc, toTypeName(lc) FROM nl RIGHT JOIN r_lc USING (lc) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
str_r Nullable(String)
|
||||
SELECT lc, toTypeName(lc) FROM nl FULL JOIN r_lc USING (x) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str_l Nullable(String)
|
||||
SELECT lc, toTypeName(lc) FROM nl FULL JOIN r_lc USING (lc) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str_r Nullable(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM nl AS l RIGHT JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM nl AS l RIGHT JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM nl AS l FULL JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM nl AS l FULL JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
{% endfor -%}
|
||||
SELECT '--';
|
||||
--
|
||||
SET join_use_nulls = 0;
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l RIGHT JOIN r_lc AS r USING (x) ORDER BY l.lc;
|
||||
LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
SET join_algorithm = 'partial_merge';
|
||||
SET join_use_nulls = 1;
|
||||
SELECT r.lc, materialize(r.lc), toTypeName(r.lc), toTypeName(materialize(r.lc)) FROM l_lc AS l FULL OUTER JOIN r_lc AS r USING (x) ORDER BY r.lc;
|
||||
str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String))
|
||||
str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String))
|
||||
\N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String))
|
||||
SET allow_experimental_analyzer = 1;
|
||||
{% for join_algorithm in ['default', 'partial_merge', 'parallel_hash'] -%}
|
||||
SET join_algorithm = '{{ join_algorithm }}';
|
||||
SET join_use_nulls = 0;
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l RIGHT JOIN r_lc AS r USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l RIGHT JOIN r_lc AS r USING (lc) ORDER BY x, lc;
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l FULL JOIN r_lc AS r USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l FULL JOIN r_lc AS r USING (lc) ORDER BY x, lc;
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
LowCardinality(String) LowCardinality(String) LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
LowCardinality(String) LowCardinality(String) LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
--
|
||||
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l RIGHT JOIN r USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l RIGHT JOIN r USING (lc) ORDER BY x, lc;
|
||||
str String
|
||||
str_r String
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l FULL JOIN r USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l FULL JOIN r USING (lc) ORDER BY x, lc;
|
||||
str String
|
||||
str_r String
|
||||
str_l String
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
String String str str LowCardinality(String) LowCardinality(String) str str
|
||||
String String str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
String String str str String String str str
|
||||
String String str_r str_r String String
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
String String str str LowCardinality(String) LowCardinality(String) str str
|
||||
String String str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
String String LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
String String str str String String str str
|
||||
String String str_r str_r String String
|
||||
String String String String str_l str_l
|
||||
--
|
||||
|
||||
SELECT lc, toTypeName(lc) FROM l RIGHT JOIN r USING (x) ORDER BY x, lc;
|
||||
str String
|
||||
String
|
||||
SELECT lc, toTypeName(lc) FROM l RIGHT JOIN r USING (lc) ORDER BY x, lc;
|
||||
str String
|
||||
str_r String
|
||||
SELECT lc, toTypeName(lc) FROM l FULL JOIN r USING (x) ORDER BY x, lc;
|
||||
str String
|
||||
String
|
||||
str_l String
|
||||
SELECT lc, toTypeName(lc) FROM l FULL JOIN r USING (lc) ORDER BY x, lc;
|
||||
str String
|
||||
str_r String
|
||||
str_l String
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l RIGHT JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str String String str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r String String
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l RIGHT JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
String String str str String String str str
|
||||
String String str_r str_r String String
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l FULL JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str String String str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r String String
|
||||
LowCardinality(String) LowCardinality(String) String String str_l str_l
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l FULL JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
String String str str String String str str
|
||||
String String str_r str_r String String
|
||||
String String String String str_l str_l
|
||||
--
|
||||
|
||||
SELECT lc, toTypeName(lc) FROM l_lc RIGHT JOIN nr USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
SELECT lc, toTypeName(lc) FROM l_lc RIGHT JOIN nr USING (lc) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
str_r Nullable(String)
|
||||
SELECT lc, toTypeName(lc) FROM l_lc FULL JOIN nr USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(String)
|
||||
LowCardinality(String)
|
||||
str_l LowCardinality(String)
|
||||
SELECT lc, toTypeName(lc) FROM l_lc FULL JOIN nr USING (lc) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
str_r Nullable(String)
|
||||
str_l Nullable(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN nr AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN nr AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str Nullable(String) Nullable(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN nr AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str LowCardinality(String) LowCardinality(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(String) LowCardinality(String)
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(String) LowCardinality(String) str_l str_l
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN nr AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str Nullable(String) Nullable(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
Nullable(String) Nullable(String) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
--
|
||||
|
||||
SELECT lc, toTypeName(lc) FROM nl RIGHT JOIN r_lc USING (x) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
SELECT lc, toTypeName(lc) FROM nl RIGHT JOIN r_lc USING (lc) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
str_r Nullable(String)
|
||||
SELECT lc, toTypeName(lc) FROM nl FULL JOIN r_lc USING (x) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str_l Nullable(String)
|
||||
SELECT lc, toTypeName(lc) FROM nl FULL JOIN r_lc USING (lc) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str_r Nullable(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM nl AS l RIGHT JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM nl AS l RIGHT JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str Nullable(String) Nullable(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM nl AS l FULL JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(String) LowCardinality(String) Nullable(String) Nullable(String) str_l str_l
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM nl AS l FULL JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str Nullable(String) Nullable(String) str str
|
||||
Nullable(String) Nullable(String) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
Nullable(String) Nullable(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
SET join_use_nulls = 1;
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l RIGHT JOIN r_lc AS r USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l RIGHT JOIN r_lc AS r USING (lc) ORDER BY x, lc;
|
||||
str LowCardinality(String)
|
||||
str_r LowCardinality(String)
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l FULL JOIN r_lc AS r USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l FULL JOIN r_lc AS r USING (lc) ORDER BY x, lc;
|
||||
str LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
str_r LowCardinality(Nullable(String))
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
--
|
||||
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l RIGHT JOIN r USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l RIGHT JOIN r USING (lc) ORDER BY x, lc;
|
||||
str String
|
||||
str_r String
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l FULL JOIN r USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l FULL JOIN r USING (lc) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str_r Nullable(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
String String str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
String String str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
String String str str Nullable(String) Nullable(String) str str
|
||||
String String str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str Nullable(String) Nullable(String) str str
|
||||
Nullable(String) Nullable(String) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
Nullable(String) Nullable(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
--
|
||||
|
||||
SELECT lc, toTypeName(lc) FROM l RIGHT JOIN r USING (x) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
SELECT lc, toTypeName(lc) FROM l RIGHT JOIN r USING (lc) ORDER BY x, lc;
|
||||
str String
|
||||
str_r String
|
||||
SELECT lc, toTypeName(lc) FROM l FULL JOIN r USING (x) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str_l Nullable(String)
|
||||
SELECT lc, toTypeName(lc) FROM l FULL JOIN r USING (lc) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str_r Nullable(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l RIGHT JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l RIGHT JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
String String str str Nullable(String) Nullable(String) str str
|
||||
String String str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l FULL JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l FULL JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str Nullable(String) Nullable(String) str str
|
||||
Nullable(String) Nullable(String) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
Nullable(String) Nullable(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
--
|
||||
|
||||
SELECT lc, toTypeName(lc) FROM l_lc RIGHT JOIN nr USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
SELECT lc, toTypeName(lc) FROM l_lc RIGHT JOIN nr USING (lc) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
str_r Nullable(String)
|
||||
SELECT lc, toTypeName(lc) FROM l_lc FULL JOIN nr USING (x) ORDER BY x, lc;
|
||||
str LowCardinality(Nullable(String))
|
||||
\N LowCardinality(Nullable(String))
|
||||
str_l LowCardinality(Nullable(String))
|
||||
SELECT lc, toTypeName(lc) FROM l_lc FULL JOIN nr USING (lc) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str_r Nullable(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN nr AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l RIGHT JOIN nr AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str Nullable(String) Nullable(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN nr AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str
|
||||
Nullable(String) Nullable(String) str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N
|
||||
Nullable(String) Nullable(String) \N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_l str_l
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM l_lc AS l FULL JOIN nr AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str Nullable(String) Nullable(String) str str
|
||||
Nullable(String) Nullable(String) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
Nullable(String) Nullable(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
--
|
||||
|
||||
SELECT lc, toTypeName(lc) FROM nl RIGHT JOIN r_lc USING (x) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
SELECT lc, toTypeName(lc) FROM nl RIGHT JOIN r_lc USING (lc) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
str_r Nullable(String)
|
||||
SELECT lc, toTypeName(lc) FROM nl FULL JOIN r_lc USING (x) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
\N Nullable(String)
|
||||
str_l Nullable(String)
|
||||
SELECT lc, toTypeName(lc) FROM nl FULL JOIN r_lc USING (lc) ORDER BY x, lc;
|
||||
str Nullable(String)
|
||||
str_l Nullable(String)
|
||||
str_r Nullable(String)
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM nl AS l RIGHT JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(String) LowCardinality(String) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(String) LowCardinality(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM nl AS l RIGHT JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str Nullable(String) Nullable(String) str str
|
||||
Nullable(String) Nullable(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM nl AS l FULL JOIN r_lc AS r USING (x) ORDER BY x, r.lc, l.lc;
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str str Nullable(String) Nullable(String) str str
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
LowCardinality(Nullable(String)) LowCardinality(Nullable(String)) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
SELECT toTypeName(r.lc), toTypeName(materialize(r.lc)), r.lc, materialize(r.lc), toTypeName(l.lc), toTypeName(materialize(l.lc)), l.lc, materialize(l.lc) FROM nl AS l FULL JOIN r_lc AS r USING (lc) ORDER BY x, r.lc, l.lc;
|
||||
Nullable(String) Nullable(String) str str Nullable(String) Nullable(String) str str
|
||||
Nullable(String) Nullable(String) \N \N Nullable(String) Nullable(String) str_l str_l
|
||||
Nullable(String) Nullable(String) str_r str_r Nullable(String) Nullable(String) \N \N
|
||||
{% endfor -%}
|
||||
SELECT '--';
|
||||
--
|
||||
SET join_use_nulls = 0;
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l RIGHT JOIN r_lc AS r USING (x) ORDER BY l.lc;
|
||||
LowCardinality(String)
|
||||
str LowCardinality(String)
|
||||
SET join_algorithm = 'partial_merge';
|
||||
SET join_use_nulls = 1;
|
||||
SELECT r.lc, materialize(r.lc), toTypeName(r.lc), toTypeName(materialize(r.lc)) FROM l_lc AS l FULL OUTER JOIN r_lc AS r USING (x) ORDER BY r.lc;
|
||||
str str LowCardinality(Nullable(String)) LowCardinality(Nullable(String))
|
||||
str_r str_r LowCardinality(Nullable(String)) LowCardinality(Nullable(String))
|
||||
\N \N LowCardinality(Nullable(String)) LowCardinality(Nullable(String))
|
||||
DROP TABLE l;
|
||||
DROP TABLE r;
|
||||
DROP TABLE nl;
|
||||
DROP TABLE nr;
|
||||
DROP TABLE l_lc;
|
||||
DROP TABLE r_lc;
|
@ -22,15 +22,17 @@ INSERT INTO l VALUES (0, 'str'), (2, 'str_l');
|
||||
INSERT INTO nl VALUES (0, 'str'), (2, 'str_l');
|
||||
INSERT INTO l_lc VALUES (0, 'str'), (2, 'str_l');
|
||||
|
||||
{% for join_algorithm in [None, 'partial_merge', 'parallel_hash'] -%}
|
||||
-- { echoOn }
|
||||
{% for allow_experimental_analyzer in [0, 1] -%}
|
||||
|
||||
SET allow_experimental_analyzer = {{ allow_experimental_analyzer }};
|
||||
|
||||
{% for join_algorithm in ['default', 'partial_merge', 'parallel_hash'] -%}
|
||||
SET join_algorithm = '{{ join_algorithm }}';
|
||||
|
||||
{% for join_use_nulls in [0, 1] -%}
|
||||
|
||||
SELECT '-- join_algorithm = {{ join_algorithm or 'default' }}, join_use_nulls = {{ join_use_nulls }} --';
|
||||
|
||||
{% if join_algorithm %}SET join_algorithm = '{{ join_algorithm }}';{% endif -%}
|
||||
SET join_use_nulls = {{ join_use_nulls }};
|
||||
|
||||
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l RIGHT JOIN r_lc AS r USING (x) ORDER BY x, lc;
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l RIGHT JOIN r_lc AS r USING (lc) ORDER BY x, lc;
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l FULL JOIN r_lc AS r USING (x) ORDER BY x, lc;
|
||||
@ -98,13 +100,13 @@ SET join_use_nulls = 0;
|
||||
|
||||
SELECT lc, toTypeName(lc) FROM l_lc AS l RIGHT JOIN r_lc AS r USING (x) ORDER BY l.lc;
|
||||
|
||||
SELECT lowCardinalityKeys(lc.lc) FROM r FULL JOIN l_lc as lc USING (lc) ORDER BY lowCardinalityKeys(lc.lc);
|
||||
|
||||
SET join_algorithm = 'partial_merge';
|
||||
SET join_use_nulls = 1;
|
||||
|
||||
SELECT r.lc, materialize(r.lc), toTypeName(r.lc), toTypeName(materialize(r.lc)) FROM l_lc AS l FULL OUTER JOIN r_lc AS r USING (x) ORDER BY r.lc;
|
||||
|
||||
{% endfor -%}
|
||||
|
||||
DROP TABLE l;
|
||||
DROP TABLE r;
|
||||
DROP TABLE nl;
|
||||
|
@ -21,20 +21,21 @@ expect ":) "
|
||||
send -- "DROP TABLE IF EXISTS test_01179\r"
|
||||
expect "Ok."
|
||||
|
||||
send -- "CREATE TABLE test_01179 (date DateTime64(3)) ENGINE=Memory()\r"
|
||||
send -- "CREATE TABLE test_01179 (val String) ENGINE=Memory()\r"
|
||||
expect "Ok."
|
||||
|
||||
send -- "INSERT INTO test_01179 values ('2020-01-01')\r"
|
||||
send -- "INSERT INTO test_01179 values ('foo')\r"
|
||||
|
||||
expect "Ok."
|
||||
|
||||
send -- "INSERT INTO test_01179 values ('2020-01-01'); \r"
|
||||
send -- "INSERT INTO test_01179 values ('foo'); \r"
|
||||
expect "Ok."
|
||||
|
||||
send -- "INSERT INTO test_01179 values ('2020-01-01 0'); (1) \r"
|
||||
send -- "INSERT INTO test_01179 values ('foo'); ('bar') \r"
|
||||
expect "Cannot read data after semicolon"
|
||||
|
||||
send -- "SELECT date, count() FROM test_01179 GROUP BY date FORMAT TSV\r"
|
||||
expect "2020-01-01 00:00:00.000\t2"
|
||||
send -- "SELECT val, count() FROM test_01179 GROUP BY val FORMAT TSV\r"
|
||||
expect "foo\t2"
|
||||
|
||||
send -- "DROP TABLE test_01179\r"
|
||||
expect "Ok."
|
||||
|
@ -34,3 +34,21 @@ UInt64 LowCardinality(UInt64) LowCardinality(String) String
|
||||
LowCardinality(UInt64) LowCardinality(UInt64) LowCardinality(String) LowCardinality(String)
|
||||
LowCardinality(UInt64) LowCardinality(UInt64) LowCardinality(String) LowCardinality(String)
|
||||
LowCardinality(UInt64) LowCardinality(UInt64) LowCardinality(String) LowCardinality(String)
|
||||
-
|
||||
UInt64 UInt64 String LowCardinality(String)
|
||||
-
|
||||
UInt64 UInt64 LowCardinality(String) String
|
||||
-
|
||||
LowCardinality(UInt64) LowCardinality(UInt64) LowCardinality(String) LowCardinality(String)
|
||||
-
|
||||
UInt64 UInt64 String LowCardinality(String)
|
||||
UInt64 UInt64 String LowCardinality(String)
|
||||
UInt64 UInt64 String LowCardinality(String)
|
||||
-
|
||||
UInt64 UInt64 LowCardinality(String) String
|
||||
UInt64 UInt64 LowCardinality(String) String
|
||||
UInt64 UInt64 LowCardinality(String) String
|
||||
-
|
||||
LowCardinality(UInt64) LowCardinality(UInt64) LowCardinality(String) LowCardinality(String)
|
||||
LowCardinality(UInt64) LowCardinality(UInt64) LowCardinality(String) LowCardinality(String)
|
||||
LowCardinality(UInt64) LowCardinality(UInt64) LowCardinality(String) LowCardinality(String)
|
||||
|
@ -1,3 +1,4 @@
|
||||
SET allow_experimental_analyzer = 0;
|
||||
set join_algorithm = 'hash';
|
||||
|
||||
select '-';
|
||||
@ -73,3 +74,42 @@ select toTypeName(materialize(js1.k)), toTypeName(materialize(js2.k)), toTypeNam
|
||||
from (select toLowCardinality(number) k, toLowCardinality(toString(number)) s from numbers(2)) as js1
|
||||
full join (select toLowCardinality(number+1) k, toLowCardinality(toString(number+1)) s from numbers(2)) as js2
|
||||
using k order by js1.k, js2.k;
|
||||
|
||||
SET allow_experimental_analyzer = 1;
|
||||
set join_algorithm = 'hash';
|
||||
|
||||
select '-';
|
||||
select toTypeName(materialize(js1.k)), toTypeName(materialize(js2.k)), toTypeName(materialize(js1.s)), toTypeName(materialize(js2.s))
|
||||
from (select toLowCardinality(number) k, toString(number) s from numbers(2)) as js1
|
||||
join (select number+1 k, toLowCardinality(toString(number+1)) s from numbers(2)) as js2
|
||||
using k order by js1.k, js2.k;
|
||||
|
||||
select '-';
|
||||
select toTypeName(materialize(js1.k)), toTypeName(materialize(js2.k)), toTypeName(materialize(js1.s)), toTypeName(materialize(js2.s))
|
||||
from (select number k, toLowCardinality(toString(number)) s from numbers(2)) as js1
|
||||
join (select toLowCardinality(number+1) k, toString(number+1) s from numbers(2)) as js2
|
||||
using k order by js1.k, js2.k;
|
||||
|
||||
select '-';
|
||||
select toTypeName(materialize(js1.k)), toTypeName(materialize(js2.k)), toTypeName(materialize(js1.s)), toTypeName(materialize(js2.s))
|
||||
from (select toLowCardinality(number) k, toLowCardinality(toString(number)) s from numbers(2)) as js1
|
||||
join (select toLowCardinality(number+1) k, toLowCardinality(toString(number+1)) s from numbers(2)) as js2
|
||||
using k order by js1.k, js2.k;
|
||||
|
||||
select '-';
|
||||
select toTypeName(materialize(js1.k)), toTypeName(materialize(js2.k)), toTypeName(materialize(js1.s)), toTypeName(materialize(js2.s))
|
||||
from (select toLowCardinality(number) k, toString(number) s from numbers(2)) as js1
|
||||
full join (select number+1 k, toLowCardinality(toString(number+1)) s from numbers(2)) as js2
|
||||
using k order by js1.k, js2.k;
|
||||
|
||||
select '-';
|
||||
select toTypeName(materialize(js1.k)), toTypeName(materialize(js2.k)), toTypeName(materialize(js1.s)), toTypeName(materialize(js2.s))
|
||||
from (select number k, toLowCardinality(toString(number)) s from numbers(2)) as js1
|
||||
full join (select toLowCardinality(number+1) k, toString(number+1) s from numbers(2)) as js2
|
||||
using k order by js1.k, js2.k;
|
||||
|
||||
select '-';
|
||||
select toTypeName(materialize(js1.k)), toTypeName(materialize(js2.k)), toTypeName(materialize(js1.s)), toTypeName(materialize(js2.s))
|
||||
from (select toLowCardinality(number) k, toLowCardinality(toString(number)) s from numbers(2)) as js1
|
||||
full join (select toLowCardinality(number+1) k, toLowCardinality(toString(number+1)) s from numbers(2)) as js2
|
||||
using k order by js1.k, js2.k;
|
||||
|
@ -82,6 +82,16 @@
|
||||
3 3 3
|
||||
4 4 4
|
||||
5 5 5
|
||||
-4 0 -4
|
||||
-3 0 -3
|
||||
-2 0 -2
|
||||
-1 0 -1
|
||||
0 0 0
|
||||
1 1 1
|
||||
2 2 2
|
||||
3 3 3
|
||||
4 4 4
|
||||
5 5 5
|
||||
= inner =
|
||||
1 1 1
|
||||
2 2 2
|
||||
@ -284,6 +294,16 @@
|
||||
\N \N -2
|
||||
\N \N -1
|
||||
\N \N 0
|
||||
1 1 1
|
||||
2 2 2
|
||||
3 3 3
|
||||
4 4 4
|
||||
5 5 5
|
||||
-4 \N -4
|
||||
-3 \N -3
|
||||
-2 \N -2
|
||||
-1 \N -1
|
||||
0 \N 0
|
||||
= inner =
|
||||
1 1 1
|
||||
2 2 2
|
||||
@ -402,5 +422,6 @@
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
{% endif -%}
|
||||
{% endfor -%}
|
||||
|
@ -37,7 +37,8 @@ SELECT a, t1.a, t2.a FROM t1 FULL JOIN t2 USING (a) ORDER BY (t1.a, t2.a); {{ is
|
||||
SELECT '= left =';
|
||||
SELECT a, t1.a, t2.a FROM t1 LEFT JOIN t2 USING (a) ORDER BY (t1.a, t2.a);
|
||||
SELECT '= right =';
|
||||
SELECT a, t1.a, t2.a FROM t1 RIGHT JOIN t2 USING (a) ORDER BY (t1.a, t2.a); {{ is_implemented(join_algorithm) }}
|
||||
SELECT a, t1.a, t2.a FROM t1 RIGHT JOIN t2 USING (a) ORDER BY (t1.a, t2.a) SETTINGS allow_experimental_analyzer = 0; {{ is_implemented(join_algorithm) }}
|
||||
SELECT a, t1.a, t2.a FROM t1 RIGHT JOIN t2 USING (a) ORDER BY (t1.a, t2.a) SETTINGS allow_experimental_analyzer = 1; {{ is_implemented(join_algorithm) }}
|
||||
SELECT '= inner =';
|
||||
SELECT a, t1.a, t2.a FROM t1 INNER JOIN t2 USING (a) ORDER BY (t1.a, t2.a);
|
||||
|
||||
@ -61,10 +62,10 @@ SELECT '= inner =';
|
||||
SELECT * FROM t1 INNER JOIN t2 ON (t1.a + t1.b = t2.a + t2.b - 100) ORDER BY (t1.a, t2.a);
|
||||
|
||||
-- Int64 and UInt64 has no supertype
|
||||
SELECT * FROM t1 FULL JOIN t2 ON (t1.a + t1.b + 100 = t2.a + t2.b) ORDER BY (t1.a, t2.a); -- { serverError 53 }
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON (t1.a + t1.b + 100 = t2.a + t2.b) ORDER BY (t1.a, t2.a); -- { serverError 53 }
|
||||
SELECT * FROM t1 RIGHT JOIN t2 ON (t1.a + t1.b + 100 = t2.a + t2.b) ORDER BY (t1.a, t2.a); -- { serverError 53 }
|
||||
SELECT * FROM t1 INNER JOIN t2 ON (t1.a + t1.b + 100 = t2.a + t2.b) ORDER BY (t1.a, t2.a); -- { serverError 53 }
|
||||
SELECT * FROM t1 FULL JOIN t2 ON (t1.a + t1.b + 100 = t2.a + t2.b) ORDER BY (t1.a, t2.a); -- { serverError 53,386 }
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON (t1.a + t1.b + 100 = t2.a + t2.b) ORDER BY (t1.a, t2.a); -- { serverError 53,386 }
|
||||
SELECT * FROM t1 RIGHT JOIN t2 ON (t1.a + t1.b + 100 = t2.a + t2.b) ORDER BY (t1.a, t2.a); -- { serverError 53,386 }
|
||||
SELECT * FROM t1 INNER JOIN t2 ON (t1.a + t1.b + 100 = t2.a + t2.b) ORDER BY (t1.a, t2.a); -- { serverError 53,386 }
|
||||
|
||||
SELECT '= agg =';
|
||||
SELECT sum(a) == 7 FROM t1 FULL JOIN t2 USING (a) WHERE b > 102 AND t2.b <= 204; {{ is_implemented(join_algorithm) }}
|
||||
@ -118,7 +119,8 @@ SELECT a, t1.a, t2.a FROM t1 FULL JOIN t2 USING (a) ORDER BY (t1.a, t2.a); {{ is
|
||||
SELECT '= left =';
|
||||
SELECT a, t1.a, t2.a FROM t1 LEFT JOIN t2 USING (a) ORDER BY (t1.a, t2.a);
|
||||
SELECT '= right =';
|
||||
SELECT a, t1.a, t2.a FROM t1 RIGHT JOIN t2 USING (a) ORDER BY (t1.a, t2.a); {{ is_implemented(join_algorithm) }}
|
||||
SELECT a, t1.a, t2.a FROM t1 RIGHT JOIN t2 USING (a) ORDER BY (t1.a, t2.a) SETTINGS allow_experimental_analyzer = 0; {{ is_implemented(join_algorithm) }}
|
||||
SELECT a, t1.a, t2.a FROM t1 RIGHT JOIN t2 USING (a) ORDER BY (t1.a, t2.a) SETTINGS allow_experimental_analyzer = 1; {{ is_implemented(join_algorithm) }}
|
||||
SELECT '= inner =';
|
||||
SELECT a, t1.a, t2.a FROM t1 INNER JOIN t2 USING (a) ORDER BY (t1.a, t2.a);
|
||||
|
||||
@ -142,10 +144,10 @@ SELECT '= inner =';
|
||||
SELECT * FROM t1 INNER JOIN t2 ON (t1.a + t1.b = t2.a + t2.b - 100) ORDER BY (t1.a, t2.a);
|
||||
|
||||
-- Int64 and UInt64 has no supertype
|
||||
SELECT * FROM t1 FULL JOIN t2 ON (t1.a + t1.b + 100 = t2.a + t2.b) ORDER BY (t1.a, t2.a); -- { serverError 53 }
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON (t1.a + t1.b + 100 = t2.a + t2.b) ORDER BY (t1.a, t2.a); -- { serverError 53 }
|
||||
SELECT * FROM t1 RIGHT JOIN t2 ON (t1.a + t1.b + 100 = t2.a + t2.b) ORDER BY (t1.a, t2.a); -- { serverError 53 }
|
||||
SELECT * FROM t1 INNER JOIN t2 ON (t1.a + t1.b + 100 = t2.a + t2.b) ORDER BY (t1.a, t2.a); -- { serverError 53 }
|
||||
SELECT * FROM t1 FULL JOIN t2 ON (t1.a + t1.b + 100 = t2.a + t2.b) ORDER BY (t1.a, t2.a); -- { serverError 53,386 }
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON (t1.a + t1.b + 100 = t2.a + t2.b) ORDER BY (t1.a, t2.a); -- { serverError 53,386 }
|
||||
SELECT * FROM t1 RIGHT JOIN t2 ON (t1.a + t1.b + 100 = t2.a + t2.b) ORDER BY (t1.a, t2.a); -- { serverError 53,386 }
|
||||
SELECT * FROM t1 INNER JOIN t2 ON (t1.a + t1.b + 100 = t2.a + t2.b) ORDER BY (t1.a, t2.a); -- { serverError 53,386 }
|
||||
|
||||
SELECT '= agg =';
|
||||
SELECT sum(a) == 7 FROM t1 FULL JOIN t2 USING (a) WHERE b > 102 AND t2.b <= 204; {{ is_implemented(join_algorithm) }}
|
||||
@ -163,7 +165,10 @@ SELECT a > 0, sum(a), sum(t2.a), sum(b), sum(t2.b) FROM t1 FULL JOIN t2 ON (t1.a
|
||||
SELECT '= types =';
|
||||
SELECT any(toTypeName(a)) == 'Nullable(Int32)' AND any(toTypeName(t2.a)) == 'Nullable(Int32)' FROM t1 FULL JOIN t2 USING (a); {{ is_implemented(join_algorithm) }}
|
||||
SELECT any(toTypeName(a)) == 'Int32' AND any(toTypeName(t2.a)) == 'Nullable(Int32)' FROM t1 LEFT JOIN t2 USING (a);
|
||||
SELECT any(toTypeName(a)) == 'Nullable(Int32)' AND any(toTypeName(t2.a)) == 'Int32' FROM t1 RIGHT JOIN t2 USING (a); {{ is_implemented(join_algorithm) }}
|
||||
|
||||
SELECT any(toTypeName(a)) == 'Nullable(Int32)' AND any(toTypeName(t2.a)) == 'Int32' FROM t1 RIGHT JOIN t2 USING (a) SETTINGS allow_experimental_analyzer = 0; {{ is_implemented(join_algorithm) }}
|
||||
SELECT any(toTypeName(a)) == 'Int32' AND any(toTypeName(t2.a)) == 'Int32' FROM t1 RIGHT JOIN t2 USING (a) SETTINGS allow_experimental_analyzer = 1; {{ is_implemented(join_algorithm) }}
|
||||
|
||||
SELECT any(toTypeName(a)) == 'Int32' AND any(toTypeName(t2.a)) == 'Int32' FROM t1 INNER JOIN t2 USING (a);
|
||||
|
||||
SELECT toTypeName(any(a)) == 'Nullable(Int32)' AND toTypeName(any(t2.a)) == 'Nullable(Int32)' FROM t1 FULL JOIN t2 USING (a); {{ is_implemented(join_algorithm) }}
|
||||
|
@ -6,3 +6,5 @@
|
||||
1 1 1 2
|
||||
2
|
||||
4
|
||||
1 1 2
|
||||
1 1 2
|
||||
|
@ -27,6 +27,7 @@ $CLICKHOUSE_CLIENT -nm -q "
|
||||
select * from test_distributed td asof join $CLICKHOUSE_DATABASE.test_local tl on td.k = tl.k and td.v < tl.v order by tl.v;
|
||||
select sum(td.v) from test_distributed td asof join $CLICKHOUSE_DATABASE.test_local tl on td.k = tl.k and td.v < tl.v group by tl.k;
|
||||
select sum(tl.v) from test_distributed td asof join $CLICKHOUSE_DATABASE.test_local tl on td.k = tl.k and td.v < tl.v group by td.k;
|
||||
select td.k, tl.* from test_distributed td join $CLICKHOUSE_DATABASE.test_local tl on td.k = tl.k;
|
||||
|
||||
drop table test_distributed;
|
||||
drop table test_source;
|
||||
|
@ -30,3 +30,27 @@
|
||||
\N 3
|
||||
1 \N
|
||||
2 \N
|
||||
2 2
|
||||
2 2
|
||||
-- { echoOn }
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON t1.id = t2.id AND 1 = 1 SETTINGS allow_experimental_analyzer = 1;
|
||||
1 0
|
||||
2 2
|
||||
SELECT * FROM t1 RIGHT JOIN t2 ON t1.id = t2.id AND 1 = 1 SETTINGS allow_experimental_analyzer = 1;
|
||||
2 2
|
||||
0 3
|
||||
SELECT * FROM t1 FULL JOIN t2 ON t1.id = t2.id AND 1 = 1 SETTINGS allow_experimental_analyzer = 1;
|
||||
1 0
|
||||
2 2
|
||||
0 3
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON t1.id = t2.id AND 1 = 2 SETTINGS allow_experimental_analyzer = 1;
|
||||
1 0
|
||||
2 0
|
||||
SELECT * FROM t1 RIGHT JOIN t2 ON t1.id = t2.id AND 1 = 2 SETTINGS allow_experimental_analyzer = 1;
|
||||
0 2
|
||||
0 3
|
||||
SELECT * FROM t1 FULL JOIN t2 ON t1.id = t2.id AND 1 = 2 SETTINGS allow_experimental_analyzer = 1;
|
||||
1 0
|
||||
2 0
|
||||
0 2
|
||||
0 3
|
||||
|
@ -10,23 +10,23 @@ INSERT INTO t2 VALUES (2), (3);
|
||||
SELECT 70 = 10 * sum(t1.id) + sum(t2.id) AND count() == 4 FROM t1 JOIN t2 ON 1 = 1;
|
||||
SELECT 70 = 10 * sum(t1.id) + sum(t2.id) AND count() == 4 FROM t1 JOIN t2 ON 1;
|
||||
SELECT 70 = 10 * sum(t1.id) + sum(t2.id) AND count() == 4 FROM t1 JOIN t2 ON 2 = 2 AND 3 = 3;
|
||||
SELECT 70 = 10 * sum(t1.id) + sum(t2.id) AND count() == 4 FROM t1 INNER ANY JOIN t2 ON toNullable(1);
|
||||
SELECT 70 = 10 * sum(t1.id) + sum(t2.id) AND count() == 4 FROM t1 INNER ANY JOIN t2 ON toLowCardinality(1);
|
||||
SELECT 70 = 10 * sum(t1.id) + sum(t2.id) AND count() == 4 FROM t1 INNER ANY JOIN t2 ON toLowCardinality(toNullable(1));
|
||||
SELECT 70 = 10 * sum(t1.id) + sum(t2.id) AND count() == 4 FROM t1 INNER ANY JOIN t2 ON toNullable(toLowCardinality(1));
|
||||
SELECT 70 = 10 * sum(t1.id) + sum(t2.id) AND count() == 4 FROM t1 JOIN t2 ON toNullable(1);
|
||||
SELECT 70 = 10 * sum(t1.id) + sum(t2.id) AND count() == 4 FROM t1 JOIN t2 ON toLowCardinality(1);
|
||||
SELECT 70 = 10 * sum(t1.id) + sum(t2.id) AND count() == 4 FROM t1 JOIN t2 ON toLowCardinality(toNullable(1));
|
||||
SELECT 70 = 10 * sum(t1.id) + sum(t2.id) AND count() == 4 FROM t1 JOIN t2 ON toNullable(toLowCardinality(1));
|
||||
|
||||
SELECT * FROM t1 INNER ANY JOIN t2 ON toUInt16(1); -- { serverError 403 }
|
||||
SELECT * FROM t1 INNER ANY JOIN t2 ON toInt8(1); -- { serverError 403 }
|
||||
SELECT * FROM t1 INNER ANY JOIN t2 ON 256; -- { serverError 403 }
|
||||
SELECT * FROM t1 INNER ANY JOIN t2 ON -1; -- { serverError 403 }
|
||||
SELECT * FROM t1 INNER ANY JOIN t2 ON toString(1); -- { serverError 403 }
|
||||
SELECT * FROM t1 JOIN t2 ON toUInt16(1); -- { serverError 403 }
|
||||
SELECT * FROM t1 JOIN t2 ON toInt8(1); -- { serverError 403 }
|
||||
SELECT * FROM t1 JOIN t2 ON 256; -- { serverError 403 }
|
||||
SELECT * FROM t1 JOIN t2 ON -1; -- { serverError 403 }
|
||||
SELECT * FROM t1 JOIN t2 ON toString(1); -- { serverError 403 }
|
||||
|
||||
SELECT '- ON NULL -';
|
||||
|
||||
SELECT '- inner -';
|
||||
SELECT * FROM t1 INNER ANY JOIN t2 ON NULL;
|
||||
SELECT * FROM t1 INNER ANY JOIN t2 ON 0;
|
||||
SELECT * FROM t1 INNER ANY JOIN t2 ON 1 = 2;
|
||||
SELECT * FROM t1 JOIN t2 ON NULL;
|
||||
SELECT * FROM t1 JOIN t2 ON 0;
|
||||
SELECT * FROM t1 JOIN t2 ON 1 = 2;
|
||||
SELECT '- left -';
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON NULL ORDER BY t1.id, t2.id;
|
||||
SELECT '- right -';
|
||||
@ -35,7 +35,7 @@ SELECT '- full -';
|
||||
SELECT * FROM t1 FULL JOIN t2 ON NULL ORDER BY t1.id, t2.id;
|
||||
|
||||
SELECT '- inner -';
|
||||
SELECT * FROM t1 INNER ANY JOIN t2 ON NULL ORDER BY t1.id NULLS FIRST, t2.id SETTINGS join_use_nulls = 1;
|
||||
SELECT * FROM t1 JOIN t2 ON NULL ORDER BY t1.id NULLS FIRST, t2.id SETTINGS join_use_nulls = 1;
|
||||
SELECT '- left -';
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON NULL ORDER BY t1.id NULLS FIRST, t2.id SETTINGS join_use_nulls = 1;
|
||||
SELECT '- right -';
|
||||
@ -43,29 +43,45 @@ SELECT * FROM t1 RIGHT JOIN t2 ON NULL ORDER BY t1.id NULLS FIRST, t2.id SETTING
|
||||
SELECT '- full -';
|
||||
SELECT * FROM t1 FULL JOIN t2 ON NULL ORDER BY t1.id NULLS FIRST, t2.id SETTINGS join_use_nulls = 1;
|
||||
|
||||
-- in this cases we have AMBIGUOUS_COLUMN_NAME instead of INVALID_JOIN_ON_EXPRESSION
|
||||
-- in this cases in old analuyzer we have AMBIGUOUS_COLUMN_NAME instead of INVALID_JOIN_ON_EXPRESSION
|
||||
-- because there's some function in ON expression is not constant itself (result is constant)
|
||||
SELECT * FROM t1 JOIN t2 ON 1 = 1 SETTINGS join_algorithm = 'full_sorting_merge'; -- { serverError AMBIGUOUS_COLUMN_NAME }
|
||||
SELECT * FROM t1 JOIN t2 ON 1 = 1 SETTINGS join_algorithm = 'partial_merge'; -- { serverError AMBIGUOUS_COLUMN_NAME }
|
||||
SELECT * FROM t1 JOIN t2 ON 1 = 1 SETTINGS join_algorithm = 'auto'; -- { serverError AMBIGUOUS_COLUMN_NAME }
|
||||
SELECT * FROM t1 JOIN t2 ON 1 = 1 SETTINGS join_algorithm = 'full_sorting_merge'; -- { serverError AMBIGUOUS_COLUMN_NAME,NOT_IMPLEMENTED }
|
||||
SELECT * FROM t1 JOIN t2 ON 1 = 1 SETTINGS join_algorithm = 'partial_merge'; -- { serverError AMBIGUOUS_COLUMN_NAME,NOT_IMPLEMENTED }
|
||||
SELECT * FROM t1 JOIN t2 ON 1 = 1 SETTINGS join_algorithm = 'auto'; -- { serverError AMBIGUOUS_COLUMN_NAME,NOT_IMPLEMENTED }
|
||||
|
||||
SELECT * FROM t1 JOIN t2 ON NULL SETTINGS join_algorithm = 'full_sorting_merge'; -- { serverError INVALID_JOIN_ON_EXPRESSION }
|
||||
SELECT * FROM t1 JOIN t2 ON NULL SETTINGS join_algorithm = 'partial_merge'; -- { serverError INVALID_JOIN_ON_EXPRESSION }
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON NULL SETTINGS join_algorithm = 'partial_merge'; -- { serverError INVALID_JOIN_ON_EXPRESSION }
|
||||
SELECT * FROM t1 RIGHT JOIN t2 ON NULL SETTINGS join_algorithm = 'auto'; -- { serverError INVALID_JOIN_ON_EXPRESSION }
|
||||
SELECT * FROM t1 FULL JOIN t2 ON NULL SETTINGS join_algorithm = 'partial_merge'; -- { serverError INVALID_JOIN_ON_EXPRESSION }
|
||||
SELECT * FROM t1 JOIN t2 ON NULL SETTINGS join_algorithm = 'full_sorting_merge'; -- { serverError INVALID_JOIN_ON_EXPRESSION,NOT_IMPLEMENTED }
|
||||
SELECT * FROM t1 JOIN t2 ON NULL SETTINGS join_algorithm = 'partial_merge'; -- { serverError INVALID_JOIN_ON_EXPRESSION,NOT_IMPLEMENTED }
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON NULL SETTINGS join_algorithm = 'partial_merge'; -- { serverError INVALID_JOIN_ON_EXPRESSION,NOT_IMPLEMENTED }
|
||||
SELECT * FROM t1 RIGHT JOIN t2 ON NULL SETTINGS join_algorithm = 'auto'; -- { serverError INVALID_JOIN_ON_EXPRESSION,NOT_IMPLEMENTED }
|
||||
SELECT * FROM t1 FULL JOIN t2 ON NULL SETTINGS join_algorithm = 'partial_merge'; -- { serverError INVALID_JOIN_ON_EXPRESSION,NOT_IMPLEMENTED }
|
||||
|
||||
-- mixing of constant and non-constant expressions in ON is not allowed
|
||||
SELECT * FROM t1 JOIN t2 ON t1.id = t2.id AND 1 == 1; -- { serverError AMBIGUOUS_COLUMN_NAME }
|
||||
SELECT * FROM t1 JOIN t2 ON t1.id = t2.id AND 1 == 2; -- { serverError AMBIGUOUS_COLUMN_NAME }
|
||||
SELECT * FROM t1 JOIN t2 ON t1.id = t2.id AND 1 == 1 SETTINGS allow_experimental_analyzer = 0; -- { serverError AMBIGUOUS_COLUMN_NAME }
|
||||
SELECT * FROM t1 JOIN t2 ON t1.id = t2.id AND 1 == 1 SETTINGS allow_experimental_analyzer = 1;
|
||||
SELECT * FROM t1 JOIN t2 ON t1.id = t2.id AND 1 == 2 SETTINGS allow_experimental_analyzer = 0; -- { serverError AMBIGUOUS_COLUMN_NAME }
|
||||
SELECT * FROM t1 JOIN t2 ON t1.id = t2.id AND 1 == 2 SETTINGS allow_experimental_analyzer = 1;
|
||||
|
||||
SELECT * FROM t1 JOIN t2 ON t1.id = t2.id AND 1 != 1; -- { serverError INVALID_JOIN_ON_EXPRESSION }
|
||||
SELECT * FROM t1 JOIN t2 ON t1.id = t2.id AND 1 != 1 SETTINGS allow_experimental_analyzer = 0; -- { serverError INVALID_JOIN_ON_EXPRESSION }
|
||||
SELECT * FROM t1 JOIN t2 ON t1.id = t2.id AND 1 != 1 SETTINGS allow_experimental_analyzer = 1;
|
||||
SELECT * FROM t1 JOIN t2 ON t1.id = t2.id AND NULL; -- { serverError INVALID_JOIN_ON_EXPRESSION }
|
||||
SELECT * FROM t1 JOIN t2 ON t1.id = t2.id AND 'aaa'; -- { serverError INVALID_JOIN_ON_EXPRESSION }
|
||||
SELECT * FROM t1 JOIN t2 ON t1.id = t2.id AND 'aaa'; -- { serverError INVALID_JOIN_ON_EXPRESSION,ILLEGAL_TYPE_OF_ARGUMENT }
|
||||
SELECT * FROM t1 JOIN t2 ON 'aaa'; -- { serverError INVALID_JOIN_ON_EXPRESSION }
|
||||
|
||||
SELECT * FROM t1 JOIN t2 ON t1.id = t2.id AND 0; -- { serverError INVALID_JOIN_ON_EXPRESSION }
|
||||
SELECT * FROM t1 JOIN t2 ON t1.id = t2.id AND 1; -- { serverError INVALID_JOIN_ON_EXPRESSION }
|
||||
SELECT * FROM t1 JOIN t2 ON t1.id = t2.id AND 0 SETTINGS allow_experimental_analyzer = 0; -- { serverError INVALID_JOIN_ON_EXPRESSION }
|
||||
SELECT * FROM t1 JOIN t2 ON t1.id = t2.id AND 0 SETTINGS allow_experimental_analyzer = 1;
|
||||
SELECT * FROM t1 JOIN t2 ON t1.id = t2.id AND 1 SETTINGS allow_experimental_analyzer = 0; -- { serverError INVALID_JOIN_ON_EXPRESSION }
|
||||
SELECT * FROM t1 JOIN t2 ON t1.id = t2.id AND 1 SETTINGS allow_experimental_analyzer = 1;
|
||||
|
||||
-- { echoOn }
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON t1.id = t2.id AND 1 = 1 SETTINGS allow_experimental_analyzer = 1;
|
||||
SELECT * FROM t1 RIGHT JOIN t2 ON t1.id = t2.id AND 1 = 1 SETTINGS allow_experimental_analyzer = 1;
|
||||
SELECT * FROM t1 FULL JOIN t2 ON t1.id = t2.id AND 1 = 1 SETTINGS allow_experimental_analyzer = 1;
|
||||
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON t1.id = t2.id AND 1 = 2 SETTINGS allow_experimental_analyzer = 1;
|
||||
SELECT * FROM t1 RIGHT JOIN t2 ON t1.id = t2.id AND 1 = 2 SETTINGS allow_experimental_analyzer = 1;
|
||||
SELECT * FROM t1 FULL JOIN t2 ON t1.id = t2.id AND 1 = 2 SETTINGS allow_experimental_analyzer = 1;
|
||||
|
||||
-- { echoOff }
|
||||
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
|
@ -45,7 +45,7 @@ SELECT '--- key types';
|
||||
SELECT * FROM t2 INNER JOIN rdb ON rdb.key == t2.k ORDER BY rdb.key;
|
||||
|
||||
-- can't promote right table type
|
||||
SELECT * FROM (SELECT toUInt64(k) as k FROM t2) as t2 INNER JOIN rdb ON rdb.key == t2.k; -- { serverError TYPE_MISMATCH }
|
||||
SELECT * FROM (SELECT toUInt64(k) as k FROM t2) as t2 INNER JOIN rdb ON rdb.key == t2.k; -- { serverError NOT_IMPLEMENTED,TYPE_MISMATCH }
|
||||
-- TODO: support fallcack when right table key type can't be changed
|
||||
-- SELECT * FROM (SELECT toUInt64(k) as k FROM t2) as t2 INNER JOIN rdb ON rdb.key == t2.k FORMAT Null SETTINGS join_algorithm = 'direct,hash';
|
||||
|
||||
|
@ -12,3 +12,10 @@ y 0 0 1 3
|
||||
0 0 1 0
|
||||
y 0 0 1 3
|
||||
\N 0 \N 10000000000 \N
|
||||
2 1 1 2
|
||||
0 1 1 0
|
||||
0 1 1 0
|
||||
0 1 1 0
|
||||
0 0 0 0 1 1 0
|
||||
y 0 0 0 1 1 3
|
||||
\N 0 \N \N 10000000000 \N
|
||||
|
@ -1,3 +1,5 @@
|
||||
SET allow_experimental_analyzer = 0;
|
||||
|
||||
SET join_algorithm = 'hash';
|
||||
|
||||
SELECT * FROM ( SELECT 2 AS x ) AS t1 RIGHT JOIN ( SELECT count('x'), count('y'), 2 AS x ) AS t2 ON t1.x = t2.x;
|
||||
@ -15,7 +17,18 @@ SELECT * FROM ( SELECT 2 AS x ) AS t1 RIGHT JOIN ( SELECT count('x'), count('y')
|
||||
SELECT * FROM ( SELECT 2 AS x ) as t1 RIGHT JOIN ( SELECT count('x'), count('y'), 0 AS x ) AS t2 ON t1.x = t2.x;
|
||||
SELECT * FROM ( SELECT 2 AS x ) as t1 RIGHT JOIN ( SELECT count('x') :: Nullable(Int32), count('y'), 0 AS x ) AS t2 ON t1.x = t2.x;
|
||||
SELECT * FROM ( SELECT 2 AS x ) as t1 RIGHT JOIN ( SELECT count('x') :: Nullable(Int32), count('y') :: Nullable(Int32), 0 AS x ) AS t2 ON t1.x = t2.x;
|
||||
|
||||
SELECT * FROM ( SELECT count('a'), count('b'), count('c'), 2 AS x ) as t1 RIGHT JOIN ( SELECT count('x'), count('y'), 0 AS x ) AS t2 ON t1.x = t2.x;
|
||||
|
||||
SELECT 'y', * FROM (SELECT count('y'), count('y'), 2 AS x) AS t1 RIGHT JOIN (SELECT count('x'), count('y'), 3 AS x) AS t2 ON t1.x = t2.x;
|
||||
SELECT * FROM (SELECT arrayJoin([NULL]), 9223372036854775806, arrayJoin([NULL]), NULL AS x) AS t1 RIGHT JOIN (SELECT arrayJoin([arrayJoin([10000000000.])]), NULL AS x) AS t2 ON t1.x = t2.x;
|
||||
|
||||
SET allow_experimental_analyzer = 1;
|
||||
SET join_algorithm = 'hash';
|
||||
|
||||
SELECT * FROM ( SELECT 2 AS x ) AS t1 RIGHT JOIN ( SELECT count('x'), count('y'), 2 AS x ) AS t2 ON t1.x = t2.x;
|
||||
SELECT * FROM ( SELECT 2 AS x ) as t1 RIGHT JOIN ( SELECT count('x'), count('y'), 0 AS x ) AS t2 ON t1.x = t2.x;
|
||||
SELECT * FROM ( SELECT 2 AS x ) as t1 RIGHT JOIN ( SELECT count('x') :: Nullable(Int32), count('y'), 0 AS x ) AS t2 ON t1.x = t2.x;
|
||||
SELECT * FROM ( SELECT 2 AS x ) as t1 RIGHT JOIN ( SELECT count('x') :: Nullable(Int32), count('y') :: Nullable(Int32), 0 AS x ) AS t2 ON t1.x = t2.x;
|
||||
SELECT * FROM ( SELECT count('a'), count('b'), count('c'), 2 AS x ) as t1 RIGHT JOIN ( SELECT count('x'), count('y'), 0 AS x ) AS t2 ON t1.x = t2.x;
|
||||
|
||||
SELECT 'y', * FROM (SELECT count('y'), count('y'), 2 AS x) AS t1 RIGHT JOIN (SELECT count('x'), count('y'), 3 AS x) AS t2 ON t1.x = t2.x;
|
||||
|
@ -7,8 +7,5 @@
|
||||
10
|
||||
bug with constant columns in join keys
|
||||
a a
|
||||
a a
|
||||
a a
|
||||
a a
|
||||
1
|
||||
1
|
||||
|
@ -22,20 +22,20 @@ SELECT count() FROM t1 JOIN t2 ON t1.x = t2.x WHERE t1.x % 2 == 0 AND t2.x % 2 =
|
||||
SELECT 'bug with constant columns in join keys';
|
||||
|
||||
SELECT * FROM ( SELECT 'a' AS key ) AS t1
|
||||
INNER JOIN ( SELECT 'a' AS key GROUP BY ignore(1), ignore(2) WITH CUBE ) AS t2
|
||||
INNER JOIN ( SELECT 'a' AS key ) AS t2
|
||||
ON t1.key = t2.key
|
||||
;
|
||||
|
||||
SELECT count() > 1 FROM (EXPLAIN PIPELINE
|
||||
SELECT * FROM ( SELECT materialize('a') AS key ) AS t1
|
||||
INNER JOIN ( SELECT materialize('a') AS key GROUP BY ignore(1), ignore(2) WITH CUBE ) AS t2
|
||||
INNER JOIN ( SELECT materialize('a') AS key ) AS t2
|
||||
ON t1.key = t2.key
|
||||
) WHERE explain ilike '%FilterBySetOnTheFlyTransform%'
|
||||
;
|
||||
|
||||
SELECT count() == 0 FROM (EXPLAIN PIPELINE
|
||||
SELECT * FROM ( SELECT 'a' AS key ) AS t1
|
||||
INNER JOIN ( SELECT 'a' AS key GROUP BY ignore(1), ignore(2) WITH CUBE ) AS t2
|
||||
INNER JOIN ( SELECT 'a' AS key ) AS t2
|
||||
ON t1.key = t2.key
|
||||
) WHERE explain ilike '%FilterBySetOnTheFlyTransform%'
|
||||
;
|
||||
|
@ -1,4 +1,4 @@
|
||||
DROP TABLE IF EXISTS t_mutations_subcolumns;
|
||||
DROP TABLE IF EXISTS t_missed_subcolumns;
|
||||
|
||||
SET allow_experimental_object_type = 1;
|
||||
|
||||
@ -14,7 +14,7 @@ OPTIMIZE TABLE t_missed_subcolumns FINAL;
|
||||
|
||||
SELECT count(), min(id) FROM t_missed_subcolumns;
|
||||
|
||||
SELECT * FROM t_missed_subcolumns WHERE obj.k4 = 5 ORDER BY id FORMAT JSONEachRow;
|
||||
SELECT * FROM t_missed_subcolumns WHERE obj.k4 = 5 ORDER BY id FORMAT JSONEachRow;
|
||||
|
||||
SELECT * FROM t_missed_subcolumns WHERE obj.k1.k3 = 'fee' ORDER BY id FORMAT JSONEachRow;
|
||||
|
||||
|
29
tests/queries/0_stateless/02887_byteswap.reference
Normal file
29
tests/queries/0_stateless/02887_byteswap.reference
Normal file
@ -0,0 +1,29 @@
|
||||
0
|
||||
1
|
||||
255
|
||||
1
|
||||
10000
|
||||
4135
|
||||
65535
|
||||
256
|
||||
3455829959
|
||||
3351772109
|
||||
4294967295
|
||||
16777216
|
||||
18439412204227788800
|
||||
123294967295
|
||||
18446744073709551615
|
||||
0
|
||||
-1
|
||||
-128
|
||||
32767
|
||||
-9745
|
||||
128
|
||||
-8388609
|
||||
855914552
|
||||
128
|
||||
-549755813889
|
||||
4039370097989451775
|
||||
128
|
||||
0
|
||||
1
|
57
tests/queries/0_stateless/02887_byteswap.sql
Normal file
57
tests/queries/0_stateless/02887_byteswap.sql
Normal file
@ -0,0 +1,57 @@
|
||||
SELECT byteSwap(0::UInt8);
|
||||
SELECT byteSwap(1::UInt8);
|
||||
SELECT byteSwap(255::UInt8);
|
||||
|
||||
SELECT byteSwap(256::UInt16);
|
||||
SELECT byteSwap(4135::UInt16);
|
||||
SELECT byteSwap(10000::UInt16);
|
||||
SELECT byteSwap(65535::UInt16);
|
||||
|
||||
SELECT byteSwap(65536::UInt32);
|
||||
SELECT byteSwap(3351772109::UInt32);
|
||||
SELECT byteSwap(3455829959::UInt32);
|
||||
SELECT byteSwap(4294967295::UInt32);
|
||||
|
||||
SELECT byteSwap(4294967296::UInt64);
|
||||
SELECT byteSwap(123294967295::UInt64);
|
||||
SELECT byteSwap(18439412204227788800::UInt64);
|
||||
SELECT byteSwap(18446744073709551615::UInt64);
|
||||
|
||||
SELECT byteSwap(-0::Int8);
|
||||
SELECT byteSwap(-1::Int8);
|
||||
SELECT byteSwap(-128::Int8);
|
||||
|
||||
SELECT byteSwap(-129::Int16);
|
||||
SELECT byteSwap(-4135::Int16);
|
||||
SELECT byteSwap(-32768::Int16);
|
||||
|
||||
SELECT byteSwap(-32769::Int32);
|
||||
SELECT byteSwap(-3351772109::Int32);
|
||||
SELECT byteSwap(-2147483648::Int32);
|
||||
|
||||
SELECT byteSwap(-2147483649::Int64);
|
||||
SELECT byteSwap(-1242525266376::Int64);
|
||||
SELECT byteSwap(-9223372036854775808::Int64);
|
||||
|
||||
-- Booleans are interpreted as UInt8
|
||||
SELECT byteSwap(false);
|
||||
SELECT byteSwap(true);
|
||||
|
||||
-- Number of arguments should equal 1
|
||||
SELECT byteSwap(); -- { serverError NUMBER_OF_ARGUMENTS_DOESNT_MATCH }
|
||||
SELECT byteSwap(128, 129); -- { serverError NUMBER_OF_ARGUMENTS_DOESNT_MATCH }
|
||||
|
||||
-- Input should be integral
|
||||
SELECT byteSwap('abc'); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
|
||||
SELECT byteSwap(toFixedString('abc', 3)); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
|
||||
SELECT byteSwap(toDate('2019-01-01')); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
|
||||
SELECT byteSwap(toDate32('2019-01-01')); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
|
||||
SELECT byteSwap(toDateTime32(1546300800)); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
|
||||
SELECT byteSwap(toDateTime64(1546300800, 3)); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
|
||||
SELECT byteSwap(generateUUIDv4()); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
|
||||
SELECT byteSwap(toDecimal32(2, 4)); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
|
||||
SELECT byteSwap(toFloat32(123.456)); -- { serverError NOT_IMPLEMENTED }
|
||||
SELECT byteSwap(toFloat64(123.456)); -- { serverError NOT_IMPLEMENTED }
|
||||
SELECT byteSwap(18446744073709551616::UInt128); -- { serverError NOT_IMPLEMENTED }
|
||||
SELECT byteSwap(-9223372036854775809::Int128); -- { serverError NOT_IMPLEMENTED }
|
||||
|
@ -50,6 +50,8 @@ in_memory_parts_enable_wal
|
||||
in_memory_parts_insert_sync
|
||||
max_part_loading_threads
|
||||
max_part_removal_threads
|
||||
merge_tree_clear_old_broken_detached_parts_ttl_timeout_seconds
|
||||
merge_tree_enable_clear_old_broken_detached
|
||||
min_bytes_for_compact_part
|
||||
min_relative_delay_to_yield_leadership
|
||||
min_rows_for_compact_part
|
||||
|
@ -0,0 +1,6 @@
|
||||
client no multiquery
|
||||
Cannot read data after semicolon (and input_format_values_allow_data_after_semicolon=0)
|
||||
client multiquery
|
||||
local no multiquery
|
||||
Cannot read data after semicolon (and input_format_values_allow_data_after_semicolon=0)
|
||||
local multiquery
|
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CUR_DIR"/../shell_config.sh
|
||||
|
||||
echo "client no multiquery"
|
||||
$CLICKHOUSE_CLIENT -q "insert into function null() values (1); -- { foo }" |& grep -F -o "Cannot read data after semicolon (and input_format_values_allow_data_after_semicolon=0)"
|
||||
echo "client multiquery"
|
||||
$CLICKHOUSE_CLIENT -n -q "insert into function null() values (1); -- { foo }"
|
||||
|
||||
echo "local no multiquery"
|
||||
$CLICKHOUSE_LOCAL -q "insert into function null() values (1); -- { foo }" |& grep -F -o "Cannot read data after semicolon (and input_format_values_allow_data_after_semicolon=0)"
|
||||
echo "local multiquery"
|
||||
$CLICKHOUSE_LOCAL -n -q "insert into function null() values (1); -- { foo }"
|
@ -432,6 +432,7 @@ Klickhouse
|
||||
Kolmogorov
|
||||
Kubernetes
|
||||
LDAP
|
||||
Levenshtein
|
||||
LGPL
|
||||
LLDB
|
||||
LLVM's
|
||||
@ -1178,6 +1179,7 @@ buildId
|
||||
buildable
|
||||
builtins
|
||||
byteSize
|
||||
byteSwap
|
||||
bytebase
|
||||
bytesToCutForIPv
|
||||
editDistance
|
||||
@ -1421,6 +1423,7 @@ encodeXMLComponent
|
||||
encodings
|
||||
encryptions
|
||||
endian
|
||||
endianness
|
||||
endsWith
|
||||
endsWithUTF
|
||||
enum
|
||||
@ -1712,6 +1715,7 @@ lemmatize
|
||||
lemmatized
|
||||
lengthUTF
|
||||
lessOrEquals
|
||||
levenshtein
|
||||
lexicographically
|
||||
lgamma
|
||||
libFuzzer
|
||||
|
Loading…
Reference in New Issue
Block a user