mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Merge branch 'master' into amosbird-stacktracefix
This commit is contained in:
commit
13ac1bee7a
123
CHANGELOG.md
123
CHANGELOG.md
@ -1,3 +1,126 @@
|
||||
### ClickHouse release 20.12
|
||||
|
||||
### ClickHouse release v20.12.3.3-stable, 2020-12-13
|
||||
|
||||
#### Backward Incompatible Change
|
||||
|
||||
* Enable `use_compact_format_in_distributed_parts_names` by default (see the documentation for the reference). [#16728](https://github.com/ClickHouse/ClickHouse/pull/16728) ([Azat Khuzhin](https://github.com/azat)).
|
||||
* Accept user settings related to file formats (e.g. `format_csv_delimiter`) in the `SETTINGS` clause when creating a table that uses `File` engine, and use these settings in all `INSERT`s and `SELECT`s. The file format settings changed in the current user session, or in the `SETTINGS` clause of a DML query itself, no longer affect the query. [#16591](https://github.com/ClickHouse/ClickHouse/pull/16591) ([Alexander Kuzmenkov](https://github.com/akuzm)).
|
||||
|
||||
#### New Feature
|
||||
|
||||
* add `*.xz` compression/decompression support.It enables using `*.xz` in `file()` function. This closes [#8828](https://github.com/ClickHouse/ClickHouse/issues/8828). [#16578](https://github.com/ClickHouse/ClickHouse/pull/16578) ([Abi Palagashvili](https://github.com/fibersel)).
|
||||
* Introduce the query `ALTER TABLE ... DROP|DETACH PART 'part_name'`. [#15511](https://github.com/ClickHouse/ClickHouse/pull/15511) ([nvartolomei](https://github.com/nvartolomei)).
|
||||
* Added new ALTER UPDATE/DELETE IN PARTITION syntax. [#13403](https://github.com/ClickHouse/ClickHouse/pull/13403) ([Vladimir Chebotarev](https://github.com/excitoon)).
|
||||
* Allow formatting named tuples as JSON objects when using JSON input/output formats, controlled by the `output_format_json_named_tuples_as_objects` setting, disabled by default. [#17175](https://github.com/ClickHouse/ClickHouse/pull/17175) ([Alexander Kuzmenkov](https://github.com/akuzm)).
|
||||
* Add a possibility to input enum value as it's id in TSV and CSV formats by default. [#16834](https://github.com/ClickHouse/ClickHouse/pull/16834) ([Kruglov Pavel](https://github.com/Avogar)).
|
||||
* Add COLLATE support for Nullable, LowCardinality, Array and Tuple, where nested type is String. Also refactor the code associated with collations in ColumnString.cpp. [#16273](https://github.com/ClickHouse/ClickHouse/pull/16273) ([Kruglov Pavel](https://github.com/Avogar)).
|
||||
* New `tcpPort` function returns TCP port listened by this server. [#17134](https://github.com/ClickHouse/ClickHouse/pull/17134) ([Ivan](https://github.com/abyss7)).
|
||||
* Add new math functions: `acosh`, `asinh`, `atan2`, `atanh`, `cosh`, `hypot`, `log1p`, `sinh`. [#16636](https://github.com/ClickHouse/ClickHouse/pull/16636) ([Konstantin Malanchev](https://github.com/hombit)).
|
||||
* Possibility to distribute the merges between different replicas. Introduces the `execute_merges_on_single_replica_time_threshold` mergetree setting. [#16424](https://github.com/ClickHouse/ClickHouse/pull/16424) ([filimonov](https://github.com/filimonov)).
|
||||
* Add setting `aggregate_functions_null_for_empty` for SQL standard compatibility. This option will rewrite all aggregate functions in a query, adding -OrNull suffix to them. Implements [10273](https://github.com/ClickHouse/ClickHouse/issues/10273). [#16123](https://github.com/ClickHouse/ClickHouse/pull/16123) ([flynn](https://github.com/ucasFL)).
|
||||
* Updated DateTime, DateTime64 parsing to accept string Date literal format. [#16040](https://github.com/ClickHouse/ClickHouse/pull/16040) ([Maksim Kita](https://github.com/kitaisreal)).
|
||||
* Make it possible to change the path to history file in `clickhouse-client` using the `--history_file` parameter. [#15960](https://github.com/ClickHouse/ClickHouse/pull/15960) ([Maksim Kita](https://github.com/kitaisreal)).
|
||||
|
||||
#### Bug Fix
|
||||
|
||||
* Fix the issue when server can stop accepting connections in very rare cases. [#17542](https://github.com/ClickHouse/ClickHouse/pull/17542) ([Amos Bird](https://github.com/amosbird)).
|
||||
* Fixed `Function not implemented` error when executing `RENAME` query in `Atomic` database with ClickHouse running on Windows Subsystem for Linux. Fixes [#17661](https://github.com/ClickHouse/ClickHouse/issues/17661). [#17664](https://github.com/ClickHouse/ClickHouse/pull/17664) ([tavplubix](https://github.com/tavplubix)).
|
||||
* Do not restore parts from WAL if `in_memory_parts_enable_wal` is disabled. [#17802](https://github.com/ClickHouse/ClickHouse/pull/17802) ([detailyang](https://github.com/detailyang)).
|
||||
* fix incorrect initialization of `max_compress_block_size` of MergeTreeWriterSettings with `min_compress_block_size`. [#17833](https://github.com/ClickHouse/ClickHouse/pull/17833) ([flynn](https://github.com/ucasFL)).
|
||||
* Exception message about max table size to drop was displayed incorrectly. [#17764](https://github.com/ClickHouse/ClickHouse/pull/17764) ([alexey-milovidov](https://github.com/alexey-milovidov)).
|
||||
* Fixed possible segfault when there is not enough space when inserting into `Distributed` table. [#17737](https://github.com/ClickHouse/ClickHouse/pull/17737) ([tavplubix](https://github.com/tavplubix)).
|
||||
* Fixed problem when ClickHouse fails to resume connection to MySQL servers. [#17681](https://github.com/ClickHouse/ClickHouse/pull/17681) ([Alexander Kazakov](https://github.com/Akazz)).
|
||||
* In might be determined incorrectly if cluster is circular- (cross-) replicated or not when executing `ON CLUSTER` query due to race condition when `pool_size` > 1. It's fixed. [#17640](https://github.com/ClickHouse/ClickHouse/pull/17640) ([tavplubix](https://github.com/tavplubix)).
|
||||
* Exception `fmt::v7::format_error` can be logged in background for MergeTree tables. This fixes [#17613](https://github.com/ClickHouse/ClickHouse/issues/17613). [#17615](https://github.com/ClickHouse/ClickHouse/pull/17615) ([alexey-milovidov](https://github.com/alexey-milovidov)).
|
||||
* When clickhouse-client is used in interactive mode with multiline queries, single line comment was erronously extended till the end of query. This fixes [#13654](https://github.com/ClickHouse/ClickHouse/issues/13654). [#17565](https://github.com/ClickHouse/ClickHouse/pull/17565) ([alexey-milovidov](https://github.com/alexey-milovidov)).
|
||||
* Fix alter query hang when the corresponding mutation was killed on the different replica. Fixes [#16953](https://github.com/ClickHouse/ClickHouse/issues/16953). [#17499](https://github.com/ClickHouse/ClickHouse/pull/17499) ([alesapin](https://github.com/alesapin)).
|
||||
* Fix issue when mark cache size was underestimated by clickhouse. It may happen when there are a lot of tiny files with marks. [#17496](https://github.com/ClickHouse/ClickHouse/pull/17496) ([alesapin](https://github.com/alesapin)).
|
||||
* Fix `ORDER BY` with enabled setting `optimize_redundant_functions_in_order_by`. [#17471](https://github.com/ClickHouse/ClickHouse/pull/17471) ([Anton Popov](https://github.com/CurtizJ)).
|
||||
* Fix duplicates after `DISTINCT` which were possible because of incorrect optimization. Fixes [#17294](https://github.com/ClickHouse/ClickHouse/issues/17294). [#17296](https://github.com/ClickHouse/ClickHouse/pull/17296) ([li chengxiang](https://github.com/chengxianglibra)). [#17439](https://github.com/ClickHouse/ClickHouse/pull/17439) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
|
||||
* Fix crash while reading from `JOIN` table with `LowCardinality` types. Fixes [#17228](https://github.com/ClickHouse/ClickHouse/issues/17228). [#17397](https://github.com/ClickHouse/ClickHouse/pull/17397) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
|
||||
* fix `toInt256(inf)` stack overflow. Int256 is an experimental feature. Closed [#17235](https://github.com/ClickHouse/ClickHouse/issues/17235). [#17257](https://github.com/ClickHouse/ClickHouse/pull/17257) ([flynn](https://github.com/ucasFL)).
|
||||
* Fix possible `Unexpected packet Data received from client` error logged for Distributed queries with `LIMIT`. [#17254](https://github.com/ClickHouse/ClickHouse/pull/17254) ([Azat Khuzhin](https://github.com/azat)).
|
||||
* Fix set index invalidation when there are const columns in the subquery. This fixes [#17246](https://github.com/ClickHouse/ClickHouse/issues/17246). [#17249](https://github.com/ClickHouse/ClickHouse/pull/17249) ([Amos Bird](https://github.com/amosbird)).
|
||||
* Fix possible wrong index analysis when the types of the index comparison are different. This fixes [#17122](https://github.com/ClickHouse/ClickHouse/issues/17122). [#17145](https://github.com/ClickHouse/ClickHouse/pull/17145) ([Amos Bird](https://github.com/amosbird)).
|
||||
* Fix ColumnConst comparison which leads to crash. This fixed [#17088](https://github.com/ClickHouse/ClickHouse/issues/17088) . [#17135](https://github.com/ClickHouse/ClickHouse/pull/17135) ([Amos Bird](https://github.com/amosbird)).
|
||||
* Multiple fixed for MaterializeMySQL (experimental feature). Fixes [#16923](https://github.com/ClickHouse/ClickHouse/issues/16923) Fixes [#15883](https://github.com/ClickHouse/ClickHouse/issues/15883) Fix MaterializeMySQL SYNC failure when the modify MySQL binlog_checksum. [#17091](https://github.com/ClickHouse/ClickHouse/pull/17091) ([Winter Zhang](https://github.com/zhang2014)).
|
||||
* Fix bug when `ON CLUSTER` queries may hang forever for non-leader ReplicatedMergeTreeTables. [#17089](https://github.com/ClickHouse/ClickHouse/pull/17089) ([alesapin](https://github.com/alesapin)).
|
||||
* Fixed crash on `CREATE TABLE ... AS some_table` query when `some_table` was created `AS table_function()` Fixes [#16944](https://github.com/ClickHouse/ClickHouse/issues/16944). [#17072](https://github.com/ClickHouse/ClickHouse/pull/17072) ([tavplubix](https://github.com/tavplubix)).
|
||||
* Bug unfinished implementation for funciton fuzzBits, related issue: [#16980](https://github.com/ClickHouse/ClickHouse/issues/16980). [#17051](https://github.com/ClickHouse/ClickHouse/pull/17051) ([hexiaoting](https://github.com/hexiaoting)).
|
||||
* Fix LLVM's libunwind in the case when CFA register is RAX. This is the [bug](https://bugs.llvm.org/show_bug.cgi?id=48186) in [LLVM's libunwind](https://github.com/llvm/llvm-project/tree/master/libunwind). We already have workarounds for this bug. [#17046](https://github.com/ClickHouse/ClickHouse/pull/17046) ([alexey-milovidov](https://github.com/alexey-milovidov)).
|
||||
* Avoid unnecessary network errors for remote queries which may be cancelled while execution, like queries with `LIMIT`. [#17006](https://github.com/ClickHouse/ClickHouse/pull/17006) ([Azat Khuzhin](https://github.com/azat)).
|
||||
* Fix `optimize_distributed_group_by_sharding_key` setting (that is disabled by default) for query with OFFSET only. [#16996](https://github.com/ClickHouse/ClickHouse/pull/16996) ([Azat Khuzhin](https://github.com/azat)).
|
||||
* Fix for Merge tables over Distributed tables with JOIN. [#16993](https://github.com/ClickHouse/ClickHouse/pull/16993) ([Azat Khuzhin](https://github.com/azat)).
|
||||
* Fixed wrong result in big integers (128, 256 bit) when casting from double. Big integers support is experimental. [#16986](https://github.com/ClickHouse/ClickHouse/pull/16986) ([Mike](https://github.com/myrrc)).
|
||||
* Fix possible server crash after `ALTER TABLE ... MODIFY COLUMN ... NewType` when `SELECT` have `WHERE` expression on altering column and alter doesn't finished yet. [#16968](https://github.com/ClickHouse/ClickHouse/pull/16968) ([Amos Bird](https://github.com/amosbird)).
|
||||
* Blame info was not calculated correctly in `clickhouse-git-import`. [#16959](https://github.com/ClickHouse/ClickHouse/pull/16959) ([alexey-milovidov](https://github.com/alexey-milovidov)).
|
||||
* Fix order by optimization with monotonous functions. Fixes [#16107](https://github.com/ClickHouse/ClickHouse/issues/16107). [#16956](https://github.com/ClickHouse/ClickHouse/pull/16956) ([Anton Popov](https://github.com/CurtizJ)).
|
||||
* Fix optimization of group by with enabled setting `optimize_aggregators_of_group_by_keys` and joins. Fixes [#12604](https://github.com/ClickHouse/ClickHouse/issues/12604). [#16951](https://github.com/ClickHouse/ClickHouse/pull/16951) ([Anton Popov](https://github.com/CurtizJ)).
|
||||
* Fix possible error `Illegal type of argument` for queries with `ORDER BY`. Fixes [#16580](https://github.com/ClickHouse/ClickHouse/issues/16580). [#16928](https://github.com/ClickHouse/ClickHouse/pull/16928) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
|
||||
* Fix strange code in InterpreterShowAccessQuery. [#16866](https://github.com/ClickHouse/ClickHouse/pull/16866) ([tavplubix](https://github.com/tavplubix)).
|
||||
* Prevent clickhouse server crashes when using the function `timeSeriesGroupSum`. The function is removed from newer ClickHouse releases. [#16865](https://github.com/ClickHouse/ClickHouse/pull/16865) ([filimonov](https://github.com/filimonov)).
|
||||
* Fix rare silent crashes when query profiler is on and ClickHouse is installed on OS with glibc version that has (supposedly) broken asynchronous unwind tables for some functions. This fixes [#15301](https://github.com/ClickHouse/ClickHouse/issues/15301). This fixes [#13098](https://github.com/ClickHouse/ClickHouse/issues/13098). [#16846](https://github.com/ClickHouse/ClickHouse/pull/16846) ([alexey-milovidov](https://github.com/alexey-milovidov)).
|
||||
* Fix crash when using `any` without any arguments. This is for [#16803](https://github.com/ClickHouse/ClickHouse/issues/16803) . cc @azat. [#16826](https://github.com/ClickHouse/ClickHouse/pull/16826) ([Amos Bird](https://github.com/amosbird)).
|
||||
* If no memory can be allocated while writing table metadata on disk, broken metadata file can be written. [#16772](https://github.com/ClickHouse/ClickHouse/pull/16772) ([alexey-milovidov](https://github.com/alexey-milovidov)).
|
||||
* Fix trivial query optimization with partition predicate. [#16767](https://github.com/ClickHouse/ClickHouse/pull/16767) ([Azat Khuzhin](https://github.com/azat)).
|
||||
* Fix `IN` operator over several columns and tuples with enabled `transform_null_in` setting. Fixes [#15310](https://github.com/ClickHouse/ClickHouse/issues/15310). [#16722](https://github.com/ClickHouse/ClickHouse/pull/16722) ([Anton Popov](https://github.com/CurtizJ)).
|
||||
* Return number of affected rows for INSERT queries via MySQL protocol. Previously ClickHouse used to always return 0, it's fixed. Fixes [#16605](https://github.com/ClickHouse/ClickHouse/issues/16605). [#16715](https://github.com/ClickHouse/ClickHouse/pull/16715) ([Winter Zhang](https://github.com/zhang2014)).
|
||||
* Fix remote query failure when using 'if' suffix aggregate function. Fixes [#16574](https://github.com/ClickHouse/ClickHouse/issues/16574) Fixes [#16231](https://github.com/ClickHouse/ClickHouse/issues/16231) [#16610](https://github.com/ClickHouse/ClickHouse/pull/16610) ([Winter Zhang](https://github.com/zhang2014)).
|
||||
* Fix inconsistent behavior caused by `select_sequential_consistency` for optimized trivial count query and system.tables. [#16309](https://github.com/ClickHouse/ClickHouse/pull/16309) ([Hao Chen](https://github.com/haoch)).
|
||||
|
||||
#### Improvement
|
||||
|
||||
* Remove empty parts after they were pruned by TTL, mutation, or collapsing merge algorithm. [#16895](https://github.com/ClickHouse/ClickHouse/pull/16895) ([Anton Popov](https://github.com/CurtizJ)).
|
||||
* Enable compact format of directories for asynchronous sends in Distributed tables: `use_compact_format_in_distributed_parts_names` is set to 1 by default. [#16788](https://github.com/ClickHouse/ClickHouse/pull/16788) ([Azat Khuzhin](https://github.com/azat)).
|
||||
* Abort multipart upload if no data was written to S3. [#16840](https://github.com/ClickHouse/ClickHouse/pull/16840) ([Pavel Kovalenko](https://github.com/Jokser)).
|
||||
* Reresolve the IP of the `format_avro_schema_registry_url` in case of errors. [#16985](https://github.com/ClickHouse/ClickHouse/pull/16985) ([filimonov](https://github.com/filimonov)).
|
||||
* Mask password in data_path in the system.distribution_queue. [#16727](https://github.com/ClickHouse/ClickHouse/pull/16727) ([Azat Khuzhin](https://github.com/azat)).
|
||||
* Throw error when use column transformer replaces non existing column. [#16183](https://github.com/ClickHouse/ClickHouse/pull/16183) ([hexiaoting](https://github.com/hexiaoting)).
|
||||
* Turn off parallel parsing when there is no enough memory for all threads to work simultaneously. Also there could be exceptions like "Memory limit exceeded" when somebody will try to insert extremely huge rows (> min_chunk_bytes_for_parallel_parsing), because each piece to parse has to be independent set of strings (one or more). [#16721](https://github.com/ClickHouse/ClickHouse/pull/16721) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
|
||||
* Install script should always create subdirs in config folders. This is only relevant for Docker build with custom config. [#16936](https://github.com/ClickHouse/ClickHouse/pull/16936) ([filimonov](https://github.com/filimonov)).
|
||||
* Correct grammar in error message in JSONEachRow, JSONCompactEachRow, and RegexpRow input formats. [#17205](https://github.com/ClickHouse/ClickHouse/pull/17205) ([nico piderman](https://github.com/sneako)).
|
||||
* Set default `host` and `port` parameters for `SOURCE(CLICKHOUSE(...))` to current instance and set default `user` value to `'default'`. [#16997](https://github.com/ClickHouse/ClickHouse/pull/16997) ([vdimir](https://github.com/vdimir)).
|
||||
* Throw an informative error message when doing `ATTACH/DETACH TABLE <DICTIONARY>`. Before this PR, `detach table <dict>` works but leads to an ill-formed in-memory metadata. [#16885](https://github.com/ClickHouse/ClickHouse/pull/16885) ([Amos Bird](https://github.com/amosbird)).
|
||||
* Add cutToFirstSignificantSubdomainWithWWW(). [#16845](https://github.com/ClickHouse/ClickHouse/pull/16845) ([Azat Khuzhin](https://github.com/azat)).
|
||||
* Server refused to startup with exception message if wrong config is given (`metric_log`.`collect_interval_milliseconds` is missing). [#16815](https://github.com/ClickHouse/ClickHouse/pull/16815) ([Ivan](https://github.com/abyss7)).
|
||||
* Better exception message when configuration for distributed DDL is absent. This fixes [#5075](https://github.com/ClickHouse/ClickHouse/issues/5075). [#16769](https://github.com/ClickHouse/ClickHouse/pull/16769) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
|
||||
* Usability improvement: better suggestions in syntax error message when `CODEC` expression is misplaced in `CREATE TABLE` query. This fixes [#12493](https://github.com/ClickHouse/ClickHouse/issues/12493). [#16768](https://github.com/ClickHouse/ClickHouse/pull/16768) ([alexey-milovidov](https://github.com/alexey-milovidov)).
|
||||
* Remove empty directories for async INSERT at start of Distributed engine. [#16729](https://github.com/ClickHouse/ClickHouse/pull/16729) ([Azat Khuzhin](https://github.com/azat)).
|
||||
* Workaround for use S3 with nginx server as proxy. Nginx currenty does not accept urls with empty path like `http://domain.com?delete`, but vanilla aws-sdk-cpp produces this kind of urls. This commit uses patched aws-sdk-cpp version, which makes urls with "/" as path in this cases, like `http://domain.com/?delete`. [#16709](https://github.com/ClickHouse/ClickHouse/pull/16709) ([ianton-ru](https://github.com/ianton-ru)).
|
||||
* Allow `reinterpretAs*` functions to work for integers and floats of the same size. Implements [16640](https://github.com/ClickHouse/ClickHouse/issues/16640). [#16657](https://github.com/ClickHouse/ClickHouse/pull/16657) ([flynn](https://github.com/ucasFL)).
|
||||
* Now, `<auxiliary_zookeepers>` configuration can be changed in `config.xml` and reloaded without server startup. [#16627](https://github.com/ClickHouse/ClickHouse/pull/16627) ([Amos Bird](https://github.com/amosbird)).
|
||||
* Support SNI in https connections to remote resources. This will allow to connect to Cloudflare servers that require SNI. This fixes [#10055](https://github.com/ClickHouse/ClickHouse/issues/10055). [#16252](https://github.com/ClickHouse/ClickHouse/pull/16252) ([alexey-milovidov](https://github.com/alexey-milovidov)).
|
||||
* Make it possible to connect to `clickhouse-server` secure endpoint which requires SNI. This is possible when `clickhouse-server` is hosted behind TLS proxy. [#16938](https://github.com/ClickHouse/ClickHouse/pull/16938) ([filimonov](https://github.com/filimonov)).
|
||||
* Fix possible stack overflow if a loop of materialized views is created. This closes [#15732](https://github.com/ClickHouse/ClickHouse/issues/15732). [#16048](https://github.com/ClickHouse/ClickHouse/pull/16048) ([alexey-milovidov](https://github.com/alexey-milovidov)).
|
||||
* Simplify the implementation of background tasks processing for the MergeTree table engines family. There should be no visible changes for user. [#15983](https://github.com/ClickHouse/ClickHouse/pull/15983) ([alesapin](https://github.com/alesapin)).
|
||||
* Improvement for MaterializeMySQL (experimental feature). Throw exception about right sync privileges when MySQL sync user has error privileges. [#15977](https://github.com/ClickHouse/ClickHouse/pull/15977) ([TCeason](https://github.com/TCeason)).
|
||||
* Made `indexOf()` use BloomFilter. [#14977](https://github.com/ClickHouse/ClickHouse/pull/14977) ([achimbab](https://github.com/achimbab)).
|
||||
|
||||
#### Performance Improvement
|
||||
|
||||
* Use Floyd-Rivest algorithm, it is the best for the ClickHouse use case of partial sorting. Bechmarks are in https://github.com/danlark1/miniselect and [here](https://drive.google.com/drive/folders/1DHEaeXgZuX6AJ9eByeZ8iQVQv0ueP8XM). [#16825](https://github.com/ClickHouse/ClickHouse/pull/16825) ([Danila Kutenin](https://github.com/danlark1)).
|
||||
* Now `ReplicatedMergeTree` tree engines family uses a separate thread pool for replicated fetches. Size of the pool limited by setting `background_fetches_pool_size` which can be tuned with a server restart. The default value of the setting is 3 and it means that the maximum amount of parallel fetches is equal to 3 (and it allows to utilize 10G network). Fixes #520. [#16390](https://github.com/ClickHouse/ClickHouse/pull/16390) ([alesapin](https://github.com/alesapin)).
|
||||
* Fixed uncontrolled growth of the state of `quantileTDigest`. [#16680](https://github.com/ClickHouse/ClickHouse/pull/16680) ([hrissan](https://github.com/hrissan)).
|
||||
* Add `VIEW` subquery description to `EXPLAIN`. Limit push down optimisation for `VIEW`. Add local replicas of `Distributed` to query plan. [#14936](https://github.com/ClickHouse/ClickHouse/pull/14936) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
|
||||
* Fix optimize_read_in_order/optimize_aggregation_in_order with max_threads > 0 and expression in ORDER BY. [#16637](https://github.com/ClickHouse/ClickHouse/pull/16637) ([Azat Khuzhin](https://github.com/azat)).
|
||||
* Fix performance of reading from `Merge` tables over huge number of `MergeTree` tables. Fixes [#7748](https://github.com/ClickHouse/ClickHouse/issues/7748). [#16988](https://github.com/ClickHouse/ClickHouse/pull/16988) ([Anton Popov](https://github.com/CurtizJ)).
|
||||
* Now we can safely prune partitions with exact match. Useful case: Suppose table is partitioned by `intHash64(x) % 100` and the query has condition on `intHash64(x) % 100` verbatim, not on x. [#16253](https://github.com/ClickHouse/ClickHouse/pull/16253) ([Amos Bird](https://github.com/amosbird)).
|
||||
|
||||
#### Experimental Feature
|
||||
|
||||
* Add `EmbeddedRocksDB` table engine (can be used for dictionaries). [#15073](https://github.com/ClickHouse/ClickHouse/pull/15073) ([sundyli](https://github.com/sundy-li)).
|
||||
|
||||
#### Build/Testing/Packaging Improvement
|
||||
|
||||
* Improvements in test coverage building images. [#17233](https://github.com/ClickHouse/ClickHouse/pull/17233) ([alesapin](https://github.com/alesapin)).
|
||||
* Update embedded timezone data to version 2020d (also update cctz to the latest master). [#17204](https://github.com/ClickHouse/ClickHouse/pull/17204) ([filimonov](https://github.com/filimonov)).
|
||||
* Fix UBSan report in Poco. This closes [#12719](https://github.com/ClickHouse/ClickHouse/issues/12719). [#16765](https://github.com/ClickHouse/ClickHouse/pull/16765) ([alexey-milovidov](https://github.com/alexey-milovidov)).
|
||||
* Do not instrument 3rd-party libraries with UBSan. [#16764](https://github.com/ClickHouse/ClickHouse/pull/16764) ([alexey-milovidov](https://github.com/alexey-milovidov)).
|
||||
* Fix UBSan report in cache dictionaries. This closes [#12641](https://github.com/ClickHouse/ClickHouse/issues/12641). [#16763](https://github.com/ClickHouse/ClickHouse/pull/16763) ([alexey-milovidov](https://github.com/alexey-milovidov)).
|
||||
* Fix UBSan report when trying to convert infinite floating point number to integer. This closes [#14190](https://github.com/ClickHouse/ClickHouse/issues/14190). [#16677](https://github.com/ClickHouse/ClickHouse/pull/16677) ([alexey-milovidov](https://github.com/alexey-milovidov)).
|
||||
|
||||
|
||||
## ClickHouse release 20.11
|
||||
|
||||
### ClickHouse release v20.11.3.3-stable, 2020-11-13
|
||||
|
@ -41,9 +41,10 @@ if (SANITIZE)
|
||||
if (COMPILER_CLANG)
|
||||
set (TSAN_FLAGS "${TSAN_FLAGS} -fsanitize-blacklist=${CMAKE_SOURCE_DIR}/tests/tsan_suppressions.txt")
|
||||
else()
|
||||
message (WARNING "TSAN suppressions was not passed to the compiler (since the compiler is not clang)")
|
||||
message (WARNING "Use the following command to pass them manually:")
|
||||
message (WARNING " export TSAN_OPTIONS=\"$TSAN_OPTIONS suppressions=${CMAKE_SOURCE_DIR}/tests/tsan_suppressions.txt\"")
|
||||
set (MESSAGE "TSAN suppressions was not passed to the compiler (since the compiler is not clang)\n")
|
||||
set (MESSAGE "${MESSAGE}Use the following command to pass them manually:\n")
|
||||
set (MESSAGE "${MESSAGE} export TSAN_OPTIONS=\"$TSAN_OPTIONS suppressions=${CMAKE_SOURCE_DIR}/tests/tsan_suppressions.txt\"")
|
||||
message (WARNING "${MESSAGE}")
|
||||
endif()
|
||||
|
||||
|
||||
@ -57,8 +58,18 @@ if (SANITIZE)
|
||||
endif ()
|
||||
|
||||
elseif (SANITIZE STREQUAL "undefined")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SAN_FLAGS} -fsanitize=undefined -fno-sanitize-recover=all -fno-sanitize=float-divide-by-zero -fsanitize-blacklist=${CMAKE_SOURCE_DIR}/tests/ubsan_suppressions.txt")
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SAN_FLAGS} -fsanitize=undefined -fno-sanitize-recover=all -fno-sanitize=float-divide-by-zero -fsanitize-blacklist=${CMAKE_SOURCE_DIR}/tests/ubsan_suppressions.txt")
|
||||
set (UBSAN_FLAGS "-fsanitize=undefined -fno-sanitize-recover=all -fno-sanitize=float-divide-by-zero")
|
||||
if (COMPILER_CLANG)
|
||||
set (UBSAN_FLAGS "${UBSAN_FLAGS} -fsanitize-blacklist=${CMAKE_SOURCE_DIR}/tests/ubsan_suppressions.txt")
|
||||
else()
|
||||
set (MESSAGE "UBSAN suppressions was not passed to the compiler (since the compiler is not clang)\n")
|
||||
set (MESSAGE "${MESSAGE}Use the following command to pass them manually:\n")
|
||||
set (MESSAGE "${MESSAGE} export UBSAN_OPTIONS=\"$UBSAN_OPTIONS suppressions=${CMAKE_SOURCE_DIR}/tests/ubsan_suppressions.txt\"")
|
||||
message (WARNING "${MESSAGE}")
|
||||
endif()
|
||||
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SAN_FLAGS} ${UBSAN_FLAGS}")
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SAN_FLAGS} ${UBSAN_FLAGS}")
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined")
|
||||
endif()
|
||||
|
2
contrib/librdkafka
vendored
2
contrib/librdkafka
vendored
@ -1 +1 @@
|
||||
Subproject commit 9902bc4fb18bb441fa55ca154b341cdda191e5d3
|
||||
Subproject commit f2f6616419d567c9198aef0d1133a2e9b4f02276
|
2
contrib/libunwind
vendored
2
contrib/libunwind
vendored
@ -1 +1 @@
|
||||
Subproject commit 7d78d3618910752c256b2b58c3895f4efea47fac
|
||||
Subproject commit 8fe25d7dc70f2a4ea38c3e5a33fa9d4199b67a5a
|
@ -1,6 +1,6 @@
|
||||
FROM ubuntu:19.10
|
||||
FROM ubuntu:20.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive LLVM_VERSION=10
|
||||
ENV DEBIAN_FRONTEND=noninteractive LLVM_VERSION=11
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install ca-certificates lsb-release wget gnupg apt-transport-https \
|
||||
|
@ -4,7 +4,7 @@ set -e
|
||||
#ccache -s # uncomment to display CCache statistics
|
||||
mkdir -p /server/build_docker
|
||||
cd /server/build_docker
|
||||
cmake -G Ninja /server "-DCMAKE_C_COMPILER=$(command -v gcc-9)" "-DCMAKE_CXX_COMPILER=$(command -v g++-9)"
|
||||
cmake -G Ninja /server "-DCMAKE_C_COMPILER=$(command -v clang-11)" "-DCMAKE_CXX_COMPILER=$(command -v clang++-11)"
|
||||
|
||||
# Set the number of build jobs to the half of number of virtual CPU cores (rounded up).
|
||||
# By default, ninja use all virtual CPU cores, that leads to very high memory consumption without much improvement in build time.
|
||||
|
@ -148,6 +148,10 @@ def parse_env_variables(build_type, compiler, sanitizer, package_type, image_typ
|
||||
|
||||
if split_binary:
|
||||
cmake_flags.append('-DUSE_STATIC_LIBRARIES=0 -DSPLIT_SHARED_LIBRARIES=1 -DCLICKHOUSE_SPLIT_BINARY=1')
|
||||
# We can't always build utils because it requires too much space, but
|
||||
# we have to build them at least in some way in CI. The split build is
|
||||
# probably the least heavy disk-wise.
|
||||
cmake_flags.append('-DENABLE_UTILS=1')
|
||||
|
||||
if clang_tidy:
|
||||
cmake_flags.append('-DENABLE_CLANG_TIDY=1')
|
||||
|
@ -15,6 +15,8 @@ For more information and documentation see https://clickhouse.yandex/.
|
||||
$ docker run -d --name some-clickhouse-server --ulimit nofile=262144:262144 yandex/clickhouse-server
|
||||
```
|
||||
|
||||
By default ClickHouse will be accessible only via docker network. See the [networking section below](#networking).
|
||||
|
||||
### connect to it from a native client
|
||||
```bash
|
||||
$ docker run -it --rm --link some-clickhouse-server:clickhouse-server yandex/clickhouse-client --host clickhouse-server
|
||||
@ -22,6 +24,70 @@ $ docker run -it --rm --link some-clickhouse-server:clickhouse-server yandex/cli
|
||||
|
||||
More information about [ClickHouse client](https://clickhouse.yandex/docs/en/interfaces/cli/).
|
||||
|
||||
### connect to it using curl
|
||||
|
||||
```bash
|
||||
echo "SELECT 'Hello, ClickHouse!'" | docker run -i --rm --link some-clickhouse-server:clickhouse-server curlimages/curl 'http://clickhouse-server:8123/?query=' -s --data-binary @-
|
||||
```
|
||||
More information about [ClickHouse HTTP Interface](https://clickhouse.tech/docs/en/interfaces/http/).
|
||||
|
||||
### stopping / removing the containter
|
||||
|
||||
```bash
|
||||
$ docker stop some-clickhouse-server
|
||||
$ docker rm some-clickhouse-server
|
||||
```
|
||||
|
||||
### networking
|
||||
|
||||
You can expose you ClickHouse running in docker by [mapping particular port](https://docs.docker.com/config/containers/container-networking/) from inside container to a host ports:
|
||||
|
||||
```bash
|
||||
$ docker run -d -p 18123:8123 -p19000:9000 --name some-clickhouse-server --ulimit nofile=262144:262144 yandex/clickhouse-server
|
||||
$ echo 'SELECT version()' | curl 'http://localhost:18123/' --data-binary @-
|
||||
20.12.3.3
|
||||
```
|
||||
|
||||
or by allowing container to use [host ports directly](https://docs.docker.com/network/host/) using `--network=host` (also allows archiving better network performance):
|
||||
|
||||
```bash
|
||||
$ docker run -d --network=host --name some-clickhouse-server --ulimit nofile=262144:262144 yandex/clickhouse-server
|
||||
$ echo 'SELECT version()' | curl 'http://localhost:8123/' --data-binary @-
|
||||
20.12.3.3
|
||||
```
|
||||
|
||||
### Volumes
|
||||
|
||||
Typically you may want to mount the following folders inside your container to archieve persistency:
|
||||
|
||||
* `/var/lib/clickhouse/` - main folder where ClickHouse stores the data
|
||||
* `/val/log/clickhouse-server/` - logs
|
||||
|
||||
```bash
|
||||
$ docker run -d \
|
||||
-v $(realpath ./ch_data):/var/lib/clickhouse/ \
|
||||
-v $(realpath ./ch_logs):/var/log/clickhouse-server/ \
|
||||
--name some-clickhouse-server --ulimit nofile=262144:262144 yandex/clickhouse-server
|
||||
```
|
||||
|
||||
You may also want to mount:
|
||||
|
||||
* `/etc/clickhouse-server/config.d/*.xml` - files with server configuration adjustmenets
|
||||
* `/etc/clickhouse-server/usert.d/*.xml` - files with use settings adjustmenets
|
||||
* `/docker-entrypoint-initdb.d/` - folder with database initialization scripts (see below).
|
||||
|
||||
### Linux capabilities
|
||||
|
||||
ClickHouse has some advanced functionality which requite enabling several [linux capabilities](https://man7.org/linux/man-pages/man7/capabilities.7.html).
|
||||
|
||||
It is optional and can be enabled using the following [docker command line agruments](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities):
|
||||
|
||||
```bash
|
||||
$ docker run -d \
|
||||
--cap-add=SYS_NICE --cap-add=NET_ADMIN --cap-add=IPC_LOCK \
|
||||
--name some-clickhouse-server --ulimit nofile=262144:262144 yandex/clickhouse-server
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
Container exposes 8123 port for [HTTP interface](https://clickhouse.yandex/docs/en/interfaces/http_interface/) and 9000 port for [native client](https://clickhouse.yandex/docs/en/interfaces/tcp/).
|
||||
|
@ -3,6 +3,7 @@
|
||||
<mysql_port remove="remove"/>
|
||||
<interserver_http_port remove="remove"/>
|
||||
<tcp_with_proxy_port remove="remove"/>
|
||||
<test_keeper_server remove="remove"/>
|
||||
<listen_host>::</listen_host>
|
||||
|
||||
<logger>
|
||||
|
@ -35,10 +35,12 @@ $ cd ClickHouse
|
||||
|
||||
## Build ClickHouse {#build-clickhouse}
|
||||
|
||||
> Please note: ClickHouse doesn't support build with native Apple Clang compiler, we need use clang from LLVM.
|
||||
|
||||
``` bash
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ cmake .. -DCMAKE_CXX_COMPILER=`which clang++` -DCMAKE_C_COMPILER=`which clang`
|
||||
$ cmake ..-DCMAKE_C_COMPILER=`brew --prefix llvm`/bin/clang -DCMAKE_CXX_COMPILER=`brew --prefix llvm`/bin/clang++ -DCMAKE_PREFIX_PATH=`brew --prefix llvm`
|
||||
$ ninja
|
||||
$ cd ..
|
||||
```
|
||||
|
@ -253,8 +253,8 @@ Developing ClickHouse often requires loading realistic datasets. It is particula
|
||||
|
||||
sudo apt install wget xz-utils
|
||||
|
||||
wget https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz
|
||||
wget https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz
|
||||
wget https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz
|
||||
wget https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz
|
||||
|
||||
xz -v -d hits_v1.tsv.xz
|
||||
xz -v -d visits_v1.tsv.xz
|
||||
|
@ -577,7 +577,7 @@ If a function captures ownership of an object created in the heap, make the argu
|
||||
|
||||
**14.** Return values.
|
||||
|
||||
In most cases, just use `return`. Do not write `[return std::move(res)]{.strike}`.
|
||||
In most cases, just use `return`. Do not write `return std::move(res)`.
|
||||
|
||||
If the function allocates an object on heap and returns it, use `shared_ptr` or `unique_ptr`.
|
||||
|
||||
@ -671,7 +671,7 @@ Always use `#pragma once` instead of include guards.
|
||||
**24.** Do not use `trailing return type` for functions unless necessary.
|
||||
|
||||
``` cpp
|
||||
[auto f() -> void;]{.strike}
|
||||
auto f() -> void
|
||||
```
|
||||
|
||||
**25.** Declaration and initialization of variables.
|
||||
|
@ -6,7 +6,7 @@ toc_priority: 101
|
||||
|
||||
# Can I Use ClickHouse As a Key-Value Storage? {#can-i-use-clickhouse-as-a-key-value-storage}
|
||||
|
||||
The short answer is **“no”**. The key-value workload is among top positions in the list of cases when NOT{.text-danger} to use ClickHouse. It’s an [OLAP](../../faq/general/olap.md) system after all, while there are many excellent key-value storage systems out there.
|
||||
The short answer is **“no”**. The key-value workload is among top positions in the list of cases when **NOT**{.text-danger} to use ClickHouse. It’s an [OLAP](../../faq/general/olap.md) system after all, while there are many excellent key-value storage systems out there.
|
||||
|
||||
However, there might be situations where it still makes sense to use ClickHouse for key-value-like queries. Usually, it’s some low-budget products where the main workload is analytical in nature and fits ClickHouse well, but there’s also some secondary process that needs a key-value pattern with not so high request throughput and without strict latency requirements. If you had an unlimited budget, you would have installed a secondary key-value database for thus secondary workload, but in reality, there’s an additional cost of maintaining one more storage system (monitoring, backups, etc.) which might be desirable to avoid.
|
||||
|
||||
|
@ -10,6 +10,7 @@ This section describes how to obtain example datasets and import them into Click
|
||||
|
||||
The list of documented datasets:
|
||||
|
||||
- [GitHub Events](../../getting-started/example-datasets/github-events.md)
|
||||
- [Anonymized Yandex.Metrica Dataset](../../getting-started/example-datasets/metrica.md)
|
||||
- [Star Schema Benchmark](../../getting-started/example-datasets/star-schema.md)
|
||||
- [WikiStat](../../getting-started/example-datasets/wikistat.md)
|
||||
|
@ -7,14 +7,14 @@ toc_title: Yandex.Metrica Data
|
||||
|
||||
Dataset consists of two tables containing anonymized data about hits (`hits_v1`) and visits (`visits_v1`) of Yandex.Metrica. You can read more about Yandex.Metrica in [ClickHouse history](../../introduction/history.md) section.
|
||||
|
||||
The dataset consists of two tables, either of them can be downloaded as a compressed `tsv.xz` file or as prepared partitions. In addition to that, an extended version of the `hits` table containing 100 million rows is available as TSV at https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_100m_obfuscated_v1.tsv.xz and as prepared partitions at https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_100m_obfuscated_v1.tar.xz.
|
||||
The dataset consists of two tables, either of them can be downloaded as a compressed `tsv.xz` file or as prepared partitions. In addition to that, an extended version of the `hits` table containing 100 million rows is available as TSV at https://datasets.clickhouse.tech/hits/tsv/hits_100m_obfuscated_v1.tsv.xz and as prepared partitions at https://datasets.clickhouse.tech/hits/partitions/hits_100m_obfuscated_v1.tar.xz.
|
||||
|
||||
## Obtaining Tables from Prepared Partitions {#obtaining-tables-from-prepared-partitions}
|
||||
|
||||
Download and import hits table:
|
||||
|
||||
``` bash
|
||||
curl -O https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_v1.tar
|
||||
curl -O https://datasets.clickhouse.tech/hits/partitions/hits_v1.tar
|
||||
tar xvf hits_v1.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
# check permissions on unpacked data, fix if required
|
||||
sudo service clickhouse-server restart
|
||||
@ -24,7 +24,7 @@ clickhouse-client --query "SELECT COUNT(*) FROM datasets.hits_v1"
|
||||
Download and import visits:
|
||||
|
||||
``` bash
|
||||
curl -O https://clickhouse-datasets.s3.yandex.net/visits/partitions/visits_v1.tar
|
||||
curl -O https://datasets.clickhouse.tech/visits/partitions/visits_v1.tar
|
||||
tar xvf visits_v1.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
# check permissions on unpacked data, fix if required
|
||||
sudo service clickhouse-server restart
|
||||
@ -36,7 +36,10 @@ clickhouse-client --query "SELECT COUNT(*) FROM datasets.visits_v1"
|
||||
Download and import hits from compressed TSV file:
|
||||
|
||||
``` bash
|
||||
curl https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
# Validate the checksum
|
||||
md5sum hits_v1.tsv
|
||||
# Checksum should be equal to: f3631b6295bf06989c1437491f7592cb
|
||||
# now create table
|
||||
clickhouse-client --query "CREATE DATABASE IF NOT EXISTS datasets"
|
||||
clickhouse-client --query "CREATE TABLE datasets.hits_v1 ( WatchID UInt64, JavaEnable UInt8, Title String, GoodEvent Int16, EventTime DateTime, EventDate Date, CounterID UInt32, ClientIP UInt32, ClientIP6 FixedString(16), RegionID UInt32, UserID UInt64, CounterClass Int8, OS UInt8, UserAgent UInt8, URL String, Referer String, URLDomain String, RefererDomain String, Refresh UInt8, IsRobot UInt8, RefererCategories Array(UInt16), URLCategories Array(UInt16), URLRegions Array(UInt32), RefererRegions Array(UInt32), ResolutionWidth UInt16, ResolutionHeight UInt16, ResolutionDepth UInt8, FlashMajor UInt8, FlashMinor UInt8, FlashMinor2 String, NetMajor UInt8, NetMinor UInt8, UserAgentMajor UInt16, UserAgentMinor FixedString(2), CookieEnable UInt8, JavascriptEnable UInt8, IsMobile UInt8, MobilePhone UInt8, MobilePhoneModel String, Params String, IPNetworkID UInt32, TraficSourceID Int8, SearchEngineID UInt16, SearchPhrase String, AdvEngineID UInt8, IsArtifical UInt8, WindowClientWidth UInt16, WindowClientHeight UInt16, ClientTimeZone Int16, ClientEventTime DateTime, SilverlightVersion1 UInt8, SilverlightVersion2 UInt8, SilverlightVersion3 UInt32, SilverlightVersion4 UInt16, PageCharset String, CodeVersion UInt32, IsLink UInt8, IsDownload UInt8, IsNotBounce UInt8, FUniqID UInt64, HID UInt32, IsOldCounter UInt8, IsEvent UInt8, IsParameter UInt8, DontCountHits UInt8, WithHash UInt8, HitColor FixedString(1), UTCEventTime DateTime, Age UInt8, Sex UInt8, Income UInt8, Interests UInt16, Robotness UInt8, GeneralInterests Array(UInt16), RemoteIP UInt32, RemoteIP6 FixedString(16), WindowName Int32, OpenerName Int32, HistoryLength Int16, BrowserLanguage FixedString(2), BrowserCountry FixedString(2), SocialNetwork String, SocialAction String, HTTPError UInt16, SendTiming Int32, DNSTiming Int32, ConnectTiming Int32, ResponseStartTiming Int32, ResponseEndTiming Int32, FetchTiming Int32, RedirectTiming Int32, DOMInteractiveTiming Int32, DOMContentLoadedTiming Int32, DOMCompleteTiming Int32, LoadEventStartTiming Int32, LoadEventEndTiming Int32, NSToDOMContentLoadedTiming Int32, FirstPaintTiming Int32, RedirectCount Int8, SocialSourceNetworkID UInt8, SocialSourcePage String, ParamPrice Int64, ParamOrderID String, ParamCurrency FixedString(3), ParamCurrencyID UInt16, GoalsReached Array(UInt32), OpenstatServiceName String, OpenstatCampaignID String, OpenstatAdID String, OpenstatSourceID String, UTMSource String, UTMMedium String, UTMCampaign String, UTMContent String, UTMTerm String, FromTag String, HasGCLID UInt8, RefererHash UInt64, URLHash UInt64, CLID UInt32, YCLID UInt64, ShareService String, ShareURL String, ShareTitle String, ParsedParams Nested(Key1 String, Key2 String, Key3 String, Key4 String, Key5 String, ValueDouble Float64), IslandID FixedString(16), RequestNum UInt32, RequestTry UInt8) ENGINE = MergeTree() PARTITION BY toYYYYMM(EventDate) ORDER BY (CounterID, EventDate, intHash32(UserID)) SAMPLE BY intHash32(UserID) SETTINGS index_granularity = 8192"
|
||||
@ -50,7 +53,10 @@ clickhouse-client --query "SELECT COUNT(*) FROM datasets.hits_v1"
|
||||
Download and import visits from compressed tsv-file:
|
||||
|
||||
``` bash
|
||||
curl https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
# Validate the checksum
|
||||
md5sum visits_v1.tsv
|
||||
# Checksum should be equal to: 6dafe1a0f24e59e3fc2d0fed85601de6
|
||||
# now create table
|
||||
clickhouse-client --query "CREATE DATABASE IF NOT EXISTS datasets"
|
||||
clickhouse-client --query "CREATE TABLE datasets.visits_v1 ( CounterID UInt32, StartDate Date, Sign Int8, IsNew UInt8, VisitID UInt64, UserID UInt64, StartTime DateTime, Duration UInt32, UTCStartTime DateTime, PageViews Int32, Hits Int32, IsBounce UInt8, Referer String, StartURL String, RefererDomain String, StartURLDomain String, EndURL String, LinkURL String, IsDownload UInt8, TraficSourceID Int8, SearchEngineID UInt16, SearchPhrase String, AdvEngineID UInt8, PlaceID Int32, RefererCategories Array(UInt16), URLCategories Array(UInt16), URLRegions Array(UInt32), RefererRegions Array(UInt32), IsYandex UInt8, GoalReachesDepth Int32, GoalReachesURL Int32, GoalReachesAny Int32, SocialSourceNetworkID UInt8, SocialSourcePage String, MobilePhoneModel String, ClientEventTime DateTime, RegionID UInt32, ClientIP UInt32, ClientIP6 FixedString(16), RemoteIP UInt32, RemoteIP6 FixedString(16), IPNetworkID UInt32, SilverlightVersion3 UInt32, CodeVersion UInt32, ResolutionWidth UInt16, ResolutionHeight UInt16, UserAgentMajor UInt16, UserAgentMinor UInt16, WindowClientWidth UInt16, WindowClientHeight UInt16, SilverlightVersion2 UInt8, SilverlightVersion4 UInt16, FlashVersion3 UInt16, FlashVersion4 UInt16, ClientTimeZone Int16, OS UInt8, UserAgent UInt8, ResolutionDepth UInt8, FlashMajor UInt8, FlashMinor UInt8, NetMajor UInt8, NetMinor UInt8, MobilePhone UInt8, SilverlightVersion1 UInt8, Age UInt8, Sex UInt8, Income UInt8, JavaEnable UInt8, CookieEnable UInt8, JavascriptEnable UInt8, IsMobile UInt8, BrowserLanguage UInt16, BrowserCountry UInt16, Interests UInt16, Robotness UInt8, GeneralInterests Array(UInt16), Params Array(String), Goals Nested(ID UInt32, Serial UInt32, EventTime DateTime, Price Int64, OrderID String, CurrencyID UInt32), WatchIDs Array(UInt64), ParamSumPrice Int64, ParamCurrency FixedString(3), ParamCurrencyID UInt16, ClickLogID UInt64, ClickEventID Int32, ClickGoodEvent Int32, ClickEventTime DateTime, ClickPriorityID Int32, ClickPhraseID Int32, ClickPageID Int32, ClickPlaceID Int32, ClickTypeID Int32, ClickResourceID Int32, ClickCost UInt32, ClickClientIP UInt32, ClickDomainID UInt32, ClickURL String, ClickAttempt UInt8, ClickOrderID UInt32, ClickBannerID UInt32, ClickMarketCategoryID UInt32, ClickMarketPP UInt32, ClickMarketCategoryName String, ClickMarketPPName String, ClickAWAPSCampaignName String, ClickPageName String, ClickTargetType UInt16, ClickTargetPhraseID UInt64, ClickContextType UInt8, ClickSelectType Int8, ClickOptions String, ClickGroupBannerID Int32, OpenstatServiceName String, OpenstatCampaignID String, OpenstatAdID String, OpenstatSourceID String, UTMSource String, UTMMedium String, UTMCampaign String, UTMContent String, UTMTerm String, FromTag String, HasGCLID UInt8, FirstVisit DateTime, PredLastVisit Date, LastVisit Date, TotalVisits UInt32, TraficSource Nested(ID Int8, SearchEngineID UInt16, AdvEngineID UInt8, PlaceID UInt16, SocialSourceNetworkID UInt8, Domain String, SearchPhrase String, SocialSourcePage String), Attendance FixedString(16), CLID UInt32, YCLID UInt64, NormalizedRefererHash UInt64, SearchPhraseHash UInt64, RefererDomainHash UInt64, NormalizedStartURLHash UInt64, StartURLDomainHash UInt64, NormalizedEndURLHash UInt64, TopLevelDomain UInt64, URLScheme UInt64, OpenstatServiceNameHash UInt64, OpenstatCampaignIDHash UInt64, OpenstatAdIDHash UInt64, OpenstatSourceIDHash UInt64, UTMSourceHash UInt64, UTMMediumHash UInt64, UTMCampaignHash UInt64, UTMContentHash UInt64, UTMTermHash UInt64, FromHash UInt64, WebVisorEnabled UInt8, WebVisorActivity UInt32, ParsedParams Nested(Key1 String, Key2 String, Key3 String, Key4 String, Key5 String, ValueDouble Float64), Market Nested(Type UInt8, GoalID UInt32, OrderID String, OrderPrice Int64, PP UInt32, DirectPlaceID UInt32, DirectOrderID UInt32, DirectBannerID UInt32, GoodID String, GoodName String, GoodQuantity Int32, GoodPrice Int64), IslandID FixedString(16)) ENGINE = CollapsingMergeTree(Sign) PARTITION BY toYYYYMM(StartDate) ORDER BY (CounterID, StartDate, intHash32(UserID), VisitID) SAMPLE BY intHash32(UserID) SETTINGS index_granularity = 8192"
|
||||
|
@ -283,7 +283,7 @@ Among other things, you can run the OPTIMIZE query on MergeTree. But it’s not
|
||||
## Download of Prepared Partitions {#download-of-prepared-partitions}
|
||||
|
||||
``` bash
|
||||
$ curl -O https://clickhouse-datasets.s3.yandex.net/trips_mergetree/partitions/trips_mergetree.tar
|
||||
$ curl -O https://datasets.clickhouse.tech/trips_mergetree/partitions/trips_mergetree.tar
|
||||
$ tar xvf trips_mergetree.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
$ # check permissions of unpacked data, fix if required
|
||||
$ sudo service clickhouse-server restart
|
||||
|
@ -154,7 +154,7 @@ $ for i in *.zip; do echo $i; unzip -cq $i '*.csv' | sed 's/\.00//g' | clickhous
|
||||
## Download of Prepared Partitions {#download-of-prepared-partitions}
|
||||
|
||||
``` bash
|
||||
$ curl -O https://clickhouse-datasets.s3.yandex.net/ontime/partitions/ontime.tar
|
||||
$ curl -O https://datasets.clickhouse.tech/ontime/partitions/ontime.tar
|
||||
$ tar xvf ontime.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
$ # check permissions of unpacked data, fix if required
|
||||
$ sudo service clickhouse-server restart
|
||||
|
@ -85,8 +85,8 @@ Now it’s time to fill our ClickHouse server with some sample data. In this tut
|
||||
### Download and Extract Table Data {#download-and-extract-table-data}
|
||||
|
||||
``` bash
|
||||
curl https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
```
|
||||
|
||||
The extracted files are about 10GB in size.
|
||||
|
@ -103,6 +103,7 @@ toc_title: Adopters
|
||||
| <a href="https://www.teralytics.net/" class="favicon">Teralytics</a> | Mobility | Analytics | — | — | [Tech blog](https://www.teralytics.net/knowledge-hub/visualizing-mobility-data-the-scalability-challenge) |
|
||||
| <a href="https://www.tencent.com" class="favicon">Tencent</a> | Big Data | Data processing | — | — | [Slides in Chinese, October 2018](https://github.com/ClickHouse/clickhouse-presentations/blob/master/meetup19/5.%20ClickHouse大数据集群应用_李俊飞腾讯网媒事业部.pdf) |
|
||||
| <a href="https://www.tencent.com" class="favicon">Tencent</a> | Messaging | Logging | — | — | [Talk in Chinese, November 2019](https://youtu.be/T-iVQRuw-QY?t=5050) |
|
||||
| <a href="https://www.tencentmusic.com/" class="favicon">Tencent Music Entertainment (TME)</a> | BigData | Data processing | — | — | [Blog in Chinese, June 2020](https://cloud.tencent.com/developer/article/1637840) |
|
||||
| <a href="https://trafficstars.com/" class="favicon">Traffic Stars</a> | AD network | — | — | — | [Slides in Russian, May 2018](https://github.com/ClickHouse/clickhouse-presentations/blob/master/meetup15/lightning/ninja.pdf) |
|
||||
| <a href="https://www.uber.com" class="favicon">Uber</a> | Taxi | Logging | — | — | [Slides, February 2020](https://presentations.clickhouse.tech/meetup40/uber.pdf) |
|
||||
| <a href="https://vk.com" class="favicon">VKontakte</a> | Social Network | Statistics, Logging | — | — | [Slides in Russian, August 2018](https://github.com/ClickHouse/clickhouse-presentations/blob/master/meetup17/3_vk.pdf) |
|
||||
|
@ -27,7 +27,7 @@ wget https://raw.githubusercontent.com/ClickHouse/ClickHouse/master/benchmark/cl
|
||||
```
|
||||
6. Download test data according to the [Yandex.Metrica dataset](../getting-started/example-datasets/metrica.md) instruction (“hits” table containing 100 million rows).
|
||||
```bash
|
||||
wget https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_100m_obfuscated_v1.tar.xz
|
||||
wget https://datasets.clickhouse.tech/hits/partitions/hits_100m_obfuscated_v1.tar.xz
|
||||
tar xvf hits_100m_obfuscated_v1.tar.xz -C .
|
||||
mv hits_100m_obfuscated_v1/* .
|
||||
```
|
||||
|
@ -1093,9 +1093,14 @@ See the section “WITH TOTALS modifier”.
|
||||
|
||||
## max_parallel_replicas {#settings-max_parallel_replicas}
|
||||
|
||||
The maximum number of replicas for each shard when executing a query.
|
||||
For consistency (to get different parts of the same data split), this option only works when the sampling key is set.
|
||||
Replica lag is not controlled.
|
||||
The maximum number of replicas for each shard when executing a query. In limited circumstances, this can make a query faster by executing it on more servers. This setting is only useful for replicated tables with a sampling key. There are cases where performance will not improve or even worsen:
|
||||
|
||||
- the position of the sampling key in the partitioning key's order doesn't allow efficient range scans
|
||||
- adding a sampling key to the table makes filtering by other columns less efficient
|
||||
- the sampling key is an expression that is expensive to calculate
|
||||
- the cluster's latency distribution has a long tail, so that querying more servers increases the query's overall latency
|
||||
|
||||
In addition, this setting will produce incorrect results when joins or subqueries are involved, and all tables don't meet certain conditions. See [Distributed Subqueries and max_parallel_replicas](../../sql-reference/operators/in.md/#max_parallel_replica-subqueries) for more details.
|
||||
|
||||
## compile {#compile}
|
||||
|
||||
|
@ -39,4 +39,8 @@ data_compressed_bytes: 499
|
||||
last_exception:
|
||||
```
|
||||
|
||||
**See also**
|
||||
|
||||
- [Distributed table engine](../../engines/table-engines/special/distributed.md)
|
||||
|
||||
[Original article](https://clickhouse.tech/docs/en/operations/system_tables/distribution_queue) <!--hide-->
|
||||
|
@ -24,58 +24,58 @@ The following table lists cases when query feature works in ClickHouse, but beha
|
||||
| Feature ID | Feature Name | Status | Comment |
|
||||
|------------|--------------------------------------------------------------------------------------------------------------------------|----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| **E011** | **Numeric data types** | **Partial**{.text-warning} | |
|
||||
| E011-01 | INTEGER and SMALLINT data types | Yes{.text-success} | |
|
||||
| E011-02 | REAL, DOUBLE PRECISION and FLOAT data types data types | Partial{.text-warning} | `FLOAT(<binary_precision>)`, `REAL` and `DOUBLE PRECISION` are not supported |
|
||||
| E011-03 | DECIMAL and NUMERIC data types | Partial{.text-warning} | Only `DECIMAL(p,s)` is supported, not `NUMERIC` |
|
||||
| E011-04 | Arithmetic operators | Yes{.text-success} | |
|
||||
| E011-05 | Numeric comparison | Yes{.text-success} | |
|
||||
| E011-06 | Implicit casting among the numeric data types | No{.text-danger} | ANSI SQL allows arbitrary implicit cast between numeric types, while ClickHouse relies on functions having multiple overloads instead of implicit cast |
|
||||
| E011-01 | INTEGER and SMALLINT data types | Yes {.text-success} | |
|
||||
| E011-02 | REAL, DOUBLE PRECISION and FLOAT data types data types | Partial {.text-warning} | `FLOAT(<binary_precision>)`, `REAL` and `DOUBLE PRECISION` are not supported |
|
||||
| E011-03 | DECIMAL and NUMERIC data types | Partial {.text-warning} | Only `DECIMAL(p,s)` is supported, not `NUMERIC` |
|
||||
| E011-04 | Arithmetic operators | Yes {.text-success} | |
|
||||
| E011-05 | Numeric comparison | Yes {.text-success} | |
|
||||
| E011-06 | Implicit casting among the numeric data types | No {.text-danger} | ANSI SQL allows arbitrary implicit cast between numeric types, while ClickHouse relies on functions having multiple overloads instead of implicit cast |
|
||||
| **E021** | **Character string types** | **Partial**{.text-warning} | |
|
||||
| E021-01 | CHARACTER data type | No{.text-danger} | |
|
||||
| E021-02 | CHARACTER VARYING data type | No{.text-danger} | `String` behaves similarly, but without length limit in parentheses |
|
||||
| E021-03 | Character literals | Partial{.text-warning} | No automatic concatenation of consecutive literals and character set support |
|
||||
| E021-04 | CHARACTER_LENGTH function | Partial{.text-warning} | No `USING` clause |
|
||||
| E021-05 | OCTET_LENGTH function | No{.text-danger} | `LENGTH` behaves similarly |
|
||||
| E021-06 | SUBSTRING | Partial{.text-warning} | No support for `SIMILAR` and `ESCAPE` clauses, no `SUBSTRING_REGEX` variant |
|
||||
| E021-07 | Character concatenation | Partial{.text-warning} | No `COLLATE` clause |
|
||||
| E021-08 | UPPER and LOWER functions | Yes{.text-success} | |
|
||||
| E021-09 | TRIM function | Yes{.text-success} | |
|
||||
| E021-10 | Implicit casting among the fixed-length and variable-length character string types | No{.text-danger} | ANSI SQL allows arbitrary implicit cast between string types, while ClickHouse relies on functions having multiple overloads instead of implicit cast |
|
||||
| E021-11 | POSITION function | Partial{.text-warning} | No support for `IN` and `USING` clauses, no `POSITION_REGEX` variant |
|
||||
| E021-12 | Character comparison | Yes{.text-success} | |
|
||||
| E021-01 | CHARACTER data type | No {.text-danger} | |
|
||||
| E021-02 | CHARACTER VARYING data type | No {.text-danger} | `String` behaves similarly, but without length limit in parentheses |
|
||||
| E021-03 | Character literals | Partial {.text-warning} | No automatic concatenation of consecutive literals and character set support |
|
||||
| E021-04 | CHARACTER_LENGTH function | Partial {.text-warning} | No `USING` clause |
|
||||
| E021-05 | OCTET_LENGTH function | No {.text-danger} | `LENGTH` behaves similarly |
|
||||
| E021-06 | SUBSTRING | Partial {.text-warning} | No support for `SIMILAR` and `ESCAPE` clauses, no `SUBSTRING_REGEX` variant |
|
||||
| E021-07 | Character concatenation | Partial {.text-warning} | No `COLLATE` clause |
|
||||
| E021-08 | UPPER and LOWER functions | Yes {.text-success} | |
|
||||
| E021-09 | TRIM function | Yes {.text-success} | |
|
||||
| E021-10 | Implicit casting among the fixed-length and variable-length character string types | No {.text-danger} | ANSI SQL allows arbitrary implicit cast between string types, while ClickHouse relies on functions having multiple overloads instead of implicit cast |
|
||||
| E021-11 | POSITION function | Partial {.text-warning} | No support for `IN` and `USING` clauses, no `POSITION_REGEX` variant |
|
||||
| E021-12 | Character comparison | Yes {.text-success} | |
|
||||
| **E031** | **Identifiers** | **Partial**{.text-warning} | |
|
||||
| E031-01 | Delimited identifiers | Partial{.text-warning} | Unicode literal support is limited |
|
||||
| E031-02 | Lower case identifiers | Yes{.text-success} | |
|
||||
| E031-03 | Trailing underscore | Yes{.text-success} | |
|
||||
| E031-01 | Delimited identifiers | Partial {.text-warning} | Unicode literal support is limited |
|
||||
| E031-02 | Lower case identifiers | Yes {.text-success} | |
|
||||
| E031-03 | Trailing underscore | Yes {.text-success} | |
|
||||
| **E051** | **Basic query specification** | **Partial**{.text-warning} | |
|
||||
| E051-01 | SELECT DISTINCT | Yes{.text-success} | |
|
||||
| E051-02 | GROUP BY clause | Yes{.text-success} | |
|
||||
| E051-04 | GROUP BY can contain columns not in `<select list>` | Yes{.text-success} | |
|
||||
| E051-05 | Select items can be renamed | Yes{.text-success} | |
|
||||
| E051-06 | HAVING clause | Yes{.text-success} | |
|
||||
| E051-07 | Qualified \* in select list | Yes{.text-success} | |
|
||||
| E051-08 | Correlation name in the FROM clause | Yes{.text-success} | |
|
||||
| E051-09 | Rename columns in the FROM clause | No{.text-danger} | |
|
||||
| E051-01 | SELECT DISTINCT | Yes {.text-success} | |
|
||||
| E051-02 | GROUP BY clause | Yes {.text-success} | |
|
||||
| E051-04 | GROUP BY can contain columns not in `<select list>` | Yes {.text-success} | |
|
||||
| E051-05 | Select items can be renamed | Yes {.text-success} | |
|
||||
| E051-06 | HAVING clause | Yes {.text-success} | |
|
||||
| E051-07 | Qualified \* in select list | Yes {.text-success} | |
|
||||
| E051-08 | Correlation name in the FROM clause | Yes {.text-success} | |
|
||||
| E051-09 | Rename columns in the FROM clause | No {.text-danger} | |
|
||||
| **E061** | **Basic predicates and search conditions** | **Partial**{.text-warning} | |
|
||||
| E061-01 | Comparison predicate | Yes{.text-success} | |
|
||||
| E061-02 | BETWEEN predicate | Partial{.text-warning} | No `SYMMETRIC` and `ASYMMETRIC` clause |
|
||||
| E061-03 | IN predicate with list of values | Yes{.text-success} | |
|
||||
| E061-04 | LIKE predicate | Yes{.text-success} | |
|
||||
| E061-05 | LIKE predicate: ESCAPE clause | No{.text-danger} | |
|
||||
| E061-06 | NULL predicate | Yes{.text-success} | |
|
||||
| E061-07 | Quantified comparison predicate | No{.text-danger} | |
|
||||
| E061-08 | EXISTS predicate | No{.text-danger} | |
|
||||
| E061-09 | Subqueries in comparison predicate | Yes{.text-success} | |
|
||||
| E061-11 | Subqueries in IN predicate | Yes{.text-success} | |
|
||||
| E061-12 | Subqueries in quantified comparison predicate | No{.text-danger} | |
|
||||
| E061-13 | Correlated subqueries | No{.text-danger} | |
|
||||
| E061-14 | Search condition | Yes{.text-success} | |
|
||||
| E061-01 | Comparison predicate | Yes {.text-success} | |
|
||||
| E061-02 | BETWEEN predicate | Partial {.text-warning} | No `SYMMETRIC` and `ASYMMETRIC` clause |
|
||||
| E061-03 | IN predicate with list of values | Yes {.text-success} | |
|
||||
| E061-04 | LIKE predicate | Yes {.text-success} | |
|
||||
| E061-05 | LIKE predicate: ESCAPE clause | No {.text-danger} | |
|
||||
| E061-06 | NULL predicate | Yes {.text-success} | |
|
||||
| E061-07 | Quantified comparison predicate | No {.text-danger} | |
|
||||
| E061-08 | EXISTS predicate | No {.text-danger} | |
|
||||
| E061-09 | Subqueries in comparison predicate | Yes {.text-success} | |
|
||||
| E061-11 | Subqueries in IN predicate | Yes {.text-success} | |
|
||||
| E061-12 | Subqueries in quantified comparison predicate | No {.text-danger} | |
|
||||
| E061-13 | Correlated subqueries | No {.text-danger} | |
|
||||
| E061-14 | Search condition | Yes {.text-success} | |
|
||||
| **E071** | **Basic query expressions** | **Partial**{.text-warning} | |
|
||||
| E071-01 | UNION DISTINCT table operator | No{.text-danger} | |
|
||||
| E071-02 | UNION ALL table operator | Yes{.text-success} | |
|
||||
| E071-03 | EXCEPT DISTINCT table operator | No{.text-danger} | |
|
||||
| E071-05 | Columns combined via table operators need not have exactly the same data type | Yes{.text-success} | |
|
||||
| E071-06 | Table operators in subqueries | Yes{.text-success} | |
|
||||
| E071-01 | UNION DISTINCT table operator | No {.text-danger} | |
|
||||
| E071-02 | UNION ALL table operator | Yes {.text-success} | |
|
||||
| E071-03 | EXCEPT DISTINCT table operator | No {.text-danger} | |
|
||||
| E071-05 | Columns combined via table operators need not have exactly the same data type | Yes {.text-success} | |
|
||||
| E071-06 | Table operators in subqueries | Yes {.text-success} | |
|
||||
| **E081** | **Basic privileges** | **Partial**{.text-warning} | Work in progress |
|
||||
| E081-01 | SELECT privilege at the table level | | |
|
||||
| E081-02 | DELETE privilege | | |
|
||||
@ -88,102 +88,102 @@ The following table lists cases when query feature works in ClickHouse, but beha
|
||||
| E081-09 | USAGE privilege | | |
|
||||
| E081-10 | EXECUTE privilege | | |
|
||||
| **E091** | **Set functions** | **Yes**{.text-success} | |
|
||||
| E091-01 | AVG | Yes{.text-success} | |
|
||||
| E091-02 | COUNT | Yes{.text-success} | |
|
||||
| E091-03 | MAX | Yes{.text-success} | |
|
||||
| E091-04 | MIN | Yes{.text-success} | |
|
||||
| E091-05 | SUM | Yes{.text-success} | |
|
||||
| E091-06 | ALL quantifier | No{.text-danger} | |
|
||||
| E091-07 | DISTINCT quantifier | Partial{.text-warning} | Not all aggregate functions supported |
|
||||
| E091-01 | AVG | Yes {.text-success} | |
|
||||
| E091-02 | COUNT | Yes {.text-success} | |
|
||||
| E091-03 | MAX | Yes {.text-success} | |
|
||||
| E091-04 | MIN | Yes {.text-success} | |
|
||||
| E091-05 | SUM | Yes {.text-success} | |
|
||||
| E091-06 | ALL quantifier | No {.text-danger} | |
|
||||
| E091-07 | DISTINCT quantifier | Partial {.text-warning} | Not all aggregate functions supported |
|
||||
| **E101** | **Basic data manipulation** | **Partial**{.text-warning} | |
|
||||
| E101-01 | INSERT statement | Yes{.text-success} | Note: primary key in ClickHouse does not imply the `UNIQUE` constraint |
|
||||
| E101-03 | Searched UPDATE statement | No{.text-danger} | There’s an `ALTER UPDATE` statement for batch data modification |
|
||||
| E101-04 | Searched DELETE statement | No{.text-danger} | There’s an `ALTER DELETE` statement for batch data removal |
|
||||
| E101-01 | INSERT statement | Yes {.text-success} | Note: primary key in ClickHouse does not imply the `UNIQUE` constraint |
|
||||
| E101-03 | Searched UPDATE statement | No {.text-danger} | There’s an `ALTER UPDATE` statement for batch data modification |
|
||||
| E101-04 | Searched DELETE statement | No {.text-danger} | There’s an `ALTER DELETE` statement for batch data removal |
|
||||
| **E111** | **Single row SELECT statement** | **No**{.text-danger} | |
|
||||
| **E121** | **Basic cursor support** | **No**{.text-danger} | |
|
||||
| E121-01 | DECLARE CURSOR | No{.text-danger} | |
|
||||
| E121-02 | ORDER BY columns need not be in select list | No{.text-danger} | |
|
||||
| E121-03 | Value expressions in ORDER BY clause | No{.text-danger} | |
|
||||
| E121-04 | OPEN statement | No{.text-danger} | |
|
||||
| E121-06 | Positioned UPDATE statement | No{.text-danger} | |
|
||||
| E121-07 | Positioned DELETE statement | No{.text-danger} | |
|
||||
| E121-08 | CLOSE statement | No{.text-danger} | |
|
||||
| E121-10 | FETCH statement: implicit NEXT | No{.text-danger} | |
|
||||
| E121-17 | WITH HOLD cursors | No{.text-danger} | |
|
||||
| E121-01 | DECLARE CURSOR | No {.text-danger} | |
|
||||
| E121-02 | ORDER BY columns need not be in select list | No {.text-danger} | |
|
||||
| E121-03 | Value expressions in ORDER BY clause | No {.text-danger} | |
|
||||
| E121-04 | OPEN statement | No {.text-danger} | |
|
||||
| E121-06 | Positioned UPDATE statement | No {.text-danger} | |
|
||||
| E121-07 | Positioned DELETE statement | No {.text-danger} | |
|
||||
| E121-08 | CLOSE statement | No {.text-danger} | |
|
||||
| E121-10 | FETCH statement: implicit NEXT | No {.text-danger} | |
|
||||
| E121-17 | WITH HOLD cursors | No {.text-danger} | |
|
||||
| **E131** | **Null value support (nulls in lieu of values)** | **Partial**{.text-warning} | Some restrictions apply |
|
||||
| **E141** | **Basic integrity constraints** | **Partial**{.text-warning} | |
|
||||
| E141-01 | NOT NULL constraints | Yes{.text-success} | Note: `NOT NULL` is implied for table columns by default |
|
||||
| E141-02 | UNIQUE constraint of NOT NULL columns | No{.text-danger} | |
|
||||
| E141-03 | PRIMARY KEY constraints | No{.text-danger} | |
|
||||
| E141-04 | Basic FOREIGN KEY constraint with the NO ACTION default for both referential delete action and referential update action | No{.text-danger} | |
|
||||
| E141-06 | CHECK constraint | Yes{.text-success} | |
|
||||
| E141-07 | Column defaults | Yes{.text-success} | |
|
||||
| E141-08 | NOT NULL inferred on PRIMARY KEY | Yes{.text-success} | |
|
||||
| E141-10 | Names in a foreign key can be specified in any order | No{.text-danger} | |
|
||||
| E141-01 | NOT NULL constraints | Yes {.text-success} | Note: `NOT NULL` is implied for table columns by default |
|
||||
| E141-02 | UNIQUE constraint of NOT NULL columns | No {.text-danger} | |
|
||||
| E141-03 | PRIMARY KEY constraints | No {.text-danger} | |
|
||||
| E141-04 | Basic FOREIGN KEY constraint with the NO ACTION default for both referential delete action and referential update action | No {.text-danger} | |
|
||||
| E141-06 | CHECK constraint | Yes {.text-success} | |
|
||||
| E141-07 | Column defaults | Yes {.text-success} | |
|
||||
| E141-08 | NOT NULL inferred on PRIMARY KEY | Yes {.text-success} | |
|
||||
| E141-10 | Names in a foreign key can be specified in any order | No {.text-danger} | |
|
||||
| **E151** | **Transaction support** | **No**{.text-danger} | |
|
||||
| E151-01 | COMMIT statement | No{.text-danger} | |
|
||||
| E151-02 | ROLLBACK statement | No{.text-danger} | |
|
||||
| E151-01 | COMMIT statement | No {.text-danger} | |
|
||||
| E151-02 | ROLLBACK statement | No {.text-danger} | |
|
||||
| **E152** | **Basic SET TRANSACTION statement** | **No**{.text-danger} | |
|
||||
| E152-01 | SET TRANSACTION statement: ISOLATION LEVEL SERIALIZABLE clause | No{.text-danger} | |
|
||||
| E152-02 | SET TRANSACTION statement: READ ONLY and READ WRITE clauses | No{.text-danger} | |
|
||||
| E152-01 | SET TRANSACTION statement: ISOLATION LEVEL SERIALIZABLE clause | No {.text-danger} | |
|
||||
| E152-02 | SET TRANSACTION statement: READ ONLY and READ WRITE clauses | No {.text-danger} | |
|
||||
| **E153** | **Updatable queries with subqueries** | **No**{.text-danger} | |
|
||||
| **E161** | **SQL comments using leading double minus** | **Yes**{.text-success} | |
|
||||
| **E171** | **SQLSTATE support** | **No**{.text-danger} | |
|
||||
| **E182** | **Host language binding** | **No**{.text-danger} | |
|
||||
| **F031** | **Basic schema manipulation** | **Partial**{.text-warning} | |
|
||||
| F031-01 | CREATE TABLE statement to create persistent base tables | Partial{.text-warning} | No `SYSTEM VERSIONING`, `ON COMMIT`, `GLOBAL`, `LOCAL`, `PRESERVE`, `DELETE`, `REF IS`, `WITH OPTIONS`, `UNDER`, `LIKE`, `PERIOD FOR` clauses and no support for user resolved data types |
|
||||
| F031-02 | CREATE VIEW statement | Partial{.text-warning} | No `RECURSIVE`, `CHECK`, `UNDER`, `WITH OPTIONS` clauses and no support for user resolved data types |
|
||||
| F031-03 | GRANT statement | Yes{.text-success} | |
|
||||
| F031-04 | ALTER TABLE statement: ADD COLUMN clause | Partial{.text-warning} | No support for `GENERATED` clause and system time period |
|
||||
| F031-13 | DROP TABLE statement: RESTRICT clause | No{.text-danger} | |
|
||||
| F031-16 | DROP VIEW statement: RESTRICT clause | No{.text-danger} | |
|
||||
| F031-19 | REVOKE statement: RESTRICT clause | No{.text-danger} | |
|
||||
| F031-01 | CREATE TABLE statement to create persistent base tables | Partial {.text-warning} | No `SYSTEM VERSIONING`, `ON COMMIT`, `GLOBAL`, `LOCAL`, `PRESERVE`, `DELETE`, `REF IS`, `WITH OPTIONS`, `UNDER`, `LIKE`, `PERIOD FOR` clauses and no support for user resolved data types |
|
||||
| F031-02 | CREATE VIEW statement | Partial {.text-warning} | No `RECURSIVE`, `CHECK`, `UNDER`, `WITH OPTIONS` clauses and no support for user resolved data types |
|
||||
| F031-03 | GRANT statement | Yes {.text-success} | |
|
||||
| F031-04 | ALTER TABLE statement: ADD COLUMN clause | Partial {.text-warning} | No support for `GENERATED` clause and system time period |
|
||||
| F031-13 | DROP TABLE statement: RESTRICT clause | No {.text-danger} | |
|
||||
| F031-16 | DROP VIEW statement: RESTRICT clause | No {.text-danger} | |
|
||||
| F031-19 | REVOKE statement: RESTRICT clause | No {.text-danger} | |
|
||||
| **F041** | **Basic joined table** | **Partial**{.text-warning} | |
|
||||
| F041-01 | Inner join (but not necessarily the INNER keyword) | Yes{.text-success} | |
|
||||
| F041-02 | INNER keyword | Yes{.text-success} | |
|
||||
| F041-03 | LEFT OUTER JOIN | Yes{.text-success} | |
|
||||
| F041-04 | RIGHT OUTER JOIN | Yes{.text-success} | |
|
||||
| F041-05 | Outer joins can be nested | Yes{.text-success} | |
|
||||
| F041-07 | The inner table in a left or right outer join can also be used in an inner join | Yes{.text-success} | |
|
||||
| F041-08 | All comparison operators are supported (rather than just =) | No{.text-danger} | |
|
||||
| F041-01 | Inner join (but not necessarily the INNER keyword) | Yes {.text-success} | |
|
||||
| F041-02 | INNER keyword | Yes {.text-success} | |
|
||||
| F041-03 | LEFT OUTER JOIN | Yes {.text-success} | |
|
||||
| F041-04 | RIGHT OUTER JOIN | Yes {.text-success} | |
|
||||
| F041-05 | Outer joins can be nested | Yes {.text-success} | |
|
||||
| F041-07 | The inner table in a left or right outer join can also be used in an inner join | Yes {.text-success} | |
|
||||
| F041-08 | All comparison operators are supported (rather than just =) | No {.text-danger} | |
|
||||
| **F051** | **Basic date and time** | **Partial**{.text-warning} | |
|
||||
| F051-01 | DATE data type (including support of DATE literal) | Partial{.text-warning} | No literal |
|
||||
| F051-02 | TIME data type (including support of TIME literal) with fractional seconds precision of at least 0 | No{.text-danger} | |
|
||||
| F051-03 | TIMESTAMP data type (including support of TIMESTAMP literal) with fractional seconds precision of at least 0 and 6 | No{.text-danger} | `DateTime64` time provides similar functionality |
|
||||
| F051-04 | Comparison predicate on DATE, TIME, and TIMESTAMP data types | Partial{.text-warning} | Only one data type available |
|
||||
| F051-05 | Explicit CAST between datetime types and character string types | Yes{.text-success} | |
|
||||
| F051-06 | CURRENT_DATE | No{.text-danger} | `today()` is similar |
|
||||
| F051-07 | LOCALTIME | No{.text-danger} | `now()` is similar |
|
||||
| F051-08 | LOCALTIMESTAMP | No{.text-danger} | |
|
||||
| F051-01 | DATE data type (including support of DATE literal) | Partial {.text-warning} | No literal |
|
||||
| F051-02 | TIME data type (including support of TIME literal) with fractional seconds precision of at least 0 | No {.text-danger} | |
|
||||
| F051-03 | TIMESTAMP data type (including support of TIMESTAMP literal) with fractional seconds precision of at least 0 and 6 | No {.text-danger} | `DateTime64` time provides similar functionality |
|
||||
| F051-04 | Comparison predicate on DATE, TIME, and TIMESTAMP data types | Partial {.text-warning} | Only one data type available |
|
||||
| F051-05 | Explicit CAST between datetime types and character string types | Yes {.text-success} | |
|
||||
| F051-06 | CURRENT_DATE | No {.text-danger} | `today()` is similar |
|
||||
| F051-07 | LOCALTIME | No {.text-danger} | `now()` is similar |
|
||||
| F051-08 | LOCALTIMESTAMP | No {.text-danger} | |
|
||||
| **F081** | **UNION and EXCEPT in views** | **Partial**{.text-warning} | |
|
||||
| **F131** | **Grouped operations** | **Partial**{.text-warning} | |
|
||||
| F131-01 | WHERE, GROUP BY, and HAVING clauses supported in queries with grouped views | Yes{.text-success} | |
|
||||
| F131-02 | Multiple tables supported in queries with grouped views | Yes{.text-success} | |
|
||||
| F131-03 | Set functions supported in queries with grouped views | Yes{.text-success} | |
|
||||
| F131-04 | Subqueries with GROUP BY and HAVING clauses and grouped views | Yes{.text-success} | |
|
||||
| F131-05 | Single row SELECT with GROUP BY and HAVING clauses and grouped views | No{.text-danger} | |
|
||||
| F131-01 | WHERE, GROUP BY, and HAVING clauses supported in queries with grouped views | Yes {.text-success} | |
|
||||
| F131-02 | Multiple tables supported in queries with grouped views | Yes {.text-success} | |
|
||||
| F131-03 | Set functions supported in queries with grouped views | Yes {.text-success} | |
|
||||
| F131-04 | Subqueries with GROUP BY and HAVING clauses and grouped views | Yes {.text-success} | |
|
||||
| F131-05 | Single row SELECT with GROUP BY and HAVING clauses and grouped views | No {.text-danger} | |
|
||||
| **F181** | **Multiple module support** | **No**{.text-danger} | |
|
||||
| **F201** | **CAST function** | **Yes**{.text-success} | |
|
||||
| **F221** | **Explicit defaults** | **No**{.text-danger} | |
|
||||
| **F261** | **CASE expression** | **Yes**{.text-success} | |
|
||||
| F261-01 | Simple CASE | Yes{.text-success} | |
|
||||
| F261-02 | Searched CASE | Yes{.text-success} | |
|
||||
| F261-03 | NULLIF | Yes{.text-success} | |
|
||||
| F261-04 | COALESCE | Yes{.text-success} | |
|
||||
| F261-01 | Simple CASE | Yes {.text-success} | |
|
||||
| F261-02 | Searched CASE | Yes {.text-success} | |
|
||||
| F261-03 | NULLIF | Yes {.text-success} | |
|
||||
| F261-04 | COALESCE | Yes {.text-success} | |
|
||||
| **F311** | **Schema definition statement** | **Partial**{.text-warning} | |
|
||||
| F311-01 | CREATE SCHEMA | No{.text-danger} | |
|
||||
| F311-02 | CREATE TABLE for persistent base tables | Yes{.text-success} | |
|
||||
| F311-03 | CREATE VIEW | Yes{.text-success} | |
|
||||
| F311-04 | CREATE VIEW: WITH CHECK OPTION | No{.text-danger} | |
|
||||
| F311-05 | GRANT statement | Yes{.text-success} | |
|
||||
| F311-01 | CREATE SCHEMA | No {.text-danger} | |
|
||||
| F311-02 | CREATE TABLE for persistent base tables | Yes {.text-success} | |
|
||||
| F311-03 | CREATE VIEW | Yes {.text-success} | |
|
||||
| F311-04 | CREATE VIEW: WITH CHECK OPTION | No {.text-danger} | |
|
||||
| F311-05 | GRANT statement | Yes {.text-success} | |
|
||||
| **F471** | **Scalar subquery values** | **Yes**{.text-success} | |
|
||||
| **F481** | **Expanded NULL predicate** | **Yes**{.text-success} | |
|
||||
| **F812** | **Basic flagging** | **No**{.text-danger} | |
|
||||
| **S011** | **Distinct data types** | | |
|
||||
| **T321** | **Basic SQL-invoked routines** | **No**{.text-danger} | |
|
||||
| T321-01 | User-defined functions with no overloading | No{.text-danger} | |
|
||||
| T321-02 | User-defined stored procedures with no overloading | No{.text-danger} | |
|
||||
| T321-03 | Function invocation | No{.text-danger} | |
|
||||
| T321-04 | CALL statement | No{.text-danger} | |
|
||||
| T321-05 | RETURN statement | No{.text-danger} | |
|
||||
| T321-01 | User-defined functions with no overloading | No {.text-danger} | |
|
||||
| T321-02 | User-defined stored procedures with no overloading | No {.text-danger} | |
|
||||
| T321-03 | Function invocation | No {.text-danger} | |
|
||||
| T321-04 | CALL statement | No {.text-danger} | |
|
||||
| T321-05 | RETURN statement | No {.text-danger} | |
|
||||
| **T631** | **IN predicate with one list element** | **Yes**{.text-success} | |
|
||||
|
@ -57,3 +57,5 @@ Functions:
|
||||
- [A Magical Mystery Tour of the LowCardinality Data Type](https://www.altinity.com/blog/2019/3/27/low-cardinality).
|
||||
- [Reducing Clickhouse Storage Cost with the Low Cardinality Type – Lessons from an Instana Engineer](https://www.instana.com/blog/reducing-clickhouse-storage-cost-with-the-low-cardinality-type-lessons-from-an-instana-engineer/).
|
||||
- [String Optimization (video presentation in Russian)](https://youtu.be/rqf-ILRgBdY?list=PL0Z2YDlm0b3iwXCpEFiOOYmwXzVmjJfEt). [Slides in English](https://github.com/yandex/clickhouse-presentations/raw/master/meetup19/string_optimization.pdf).
|
||||
|
||||
[Original article](https://clickhouse.tech/docs/en/sql-reference/data-types/lowcardinality/) <!--hide-->
|
||||
|
@ -197,3 +197,25 @@ This is more optimal than using the normal IN. However, keep the following point
|
||||
5. If you need to use GLOBAL IN often, plan the location of the ClickHouse cluster so that a single group of replicas resides in no more than one data center with a fast network between them, so that a query can be processed entirely within a single data center.
|
||||
|
||||
It also makes sense to specify a local table in the `GLOBAL IN` clause, in case this local table is only available on the requestor server and you want to use data from it on remote servers.
|
||||
|
||||
### Distributed Subqueries and max_parallel_replicas {#max_parallel_replica-subqueries}
|
||||
|
||||
When max_parallel_replicas is greater than 1, distributed queries are further transformed. For example, the following:
|
||||
|
||||
```sql
|
||||
SEELECT CounterID, count() FROM distributed_table_1 WHERE UserID IN (SELECT UserID FROM local_table_2 WHERE CounterID < 100)
|
||||
SETTINGS max_parallel_replicas=3
|
||||
```
|
||||
|
||||
is transformed on each server into
|
||||
|
||||
```sql
|
||||
SELECT CounterID, count() FROM local_table_1 WHERE UserID IN (SELECT UserID FROM local_table_2 WHERE CounterID < 100)
|
||||
SETTINGS parallel_replicas_count=3, parallel_replicas_offset=M
|
||||
```
|
||||
|
||||
where M is between 1 and 3 depending on which replica the local query is executing on. These settings affect every MergeTree-family table in the query and have the same effect as applying `SAMPLE 1/3 OFFSET (M-1)/3` on each table.
|
||||
|
||||
Therefore adding the max_parallel_replicas setting will only produce correct results if both tables have the same replication scheme and are sampled by UserID or a subkey of it. In particular, if local_table_2 does not have a sampling key, incorrect results will be produced. The same rule applies to JOIN.
|
||||
|
||||
One workaround if local_table_2 doesn't meet the requirements, is to use `GLOBAL IN` or `GLOBAL JOIN`.
|
||||
|
@ -56,10 +56,188 @@ When floating point numbers are sorted, NaNs are separate from the other values.
|
||||
|
||||
## Collation Support {#collation-support}
|
||||
|
||||
For sorting by String values, you can specify collation (comparison). Example: `ORDER BY SearchPhrase COLLATE 'tr'` - for sorting by keyword in ascending order, using the Turkish alphabet, case insensitive, assuming that strings are UTF-8 encoded. `COLLATE` can be specified or not for each expression in ORDER BY independently. If `ASC` or `DESC` is specified, `COLLATE` is specified after it. When using `COLLATE`, sorting is always case-insensitive.
|
||||
For sorting by [String](../../../sql-reference/data-types/string.md) values, you can specify collation (comparison). Example: `ORDER BY SearchPhrase COLLATE 'tr'` - for sorting by keyword in ascending order, using the Turkish alphabet, case insensitive, assuming that strings are UTF-8 encoded. `COLLATE` can be specified or not for each expression in ORDER BY independently. If `ASC` or `DESC` is specified, `COLLATE` is specified after it. When using `COLLATE`, sorting is always case-insensitive.
|
||||
|
||||
Collate is supported in [LowCardinality](../../../sql-reference/data-types/lowcardinality.md), [Nullable](../../../sql-reference/data-types/nullable.md), [Array](../../../sql-reference/data-types/array.md) and [Tuple](../../../sql-reference/data-types/tuple.md).
|
||||
|
||||
We only recommend using `COLLATE` for final sorting of a small number of rows, since sorting with `COLLATE` is less efficient than normal sorting by bytes.
|
||||
|
||||
## Collation Examples {#collation-examples}
|
||||
|
||||
Example only with [String](../../../sql-reference/data-types/string.md) values:
|
||||
|
||||
Input table:
|
||||
|
||||
``` text
|
||||
┌─x─┬─s────┐
|
||||
│ 1 │ bca │
|
||||
│ 2 │ ABC │
|
||||
│ 3 │ 123a │
|
||||
│ 4 │ abc │
|
||||
│ 5 │ BCA │
|
||||
└───┴──────┘
|
||||
```
|
||||
|
||||
Query:
|
||||
|
||||
```sql
|
||||
SELECT * FROM collate_test ORDER BY s ASC COLLATE 'en';
|
||||
```
|
||||
|
||||
Result:
|
||||
|
||||
``` text
|
||||
┌─x─┬─s────┐
|
||||
│ 3 │ 123a │
|
||||
│ 4 │ abc │
|
||||
│ 2 │ ABC │
|
||||
│ 1 │ bca │
|
||||
│ 5 │ BCA │
|
||||
└───┴──────┘
|
||||
```
|
||||
|
||||
Example with [Nullable](../../../sql-reference/data-types/nullable.md):
|
||||
|
||||
Input table:
|
||||
|
||||
``` text
|
||||
┌─x─┬─s────┐
|
||||
│ 1 │ bca │
|
||||
│ 2 │ ᴺᵁᴸᴸ │
|
||||
│ 3 │ ABC │
|
||||
│ 4 │ 123a │
|
||||
│ 5 │ abc │
|
||||
│ 6 │ ᴺᵁᴸᴸ │
|
||||
│ 7 │ BCA │
|
||||
└───┴──────┘
|
||||
```
|
||||
|
||||
Query:
|
||||
|
||||
```sql
|
||||
SELECT * FROM collate_test ORDER BY s ASC COLLATE 'en';
|
||||
```
|
||||
|
||||
Result:
|
||||
|
||||
``` text
|
||||
┌─x─┬─s────┐
|
||||
│ 4 │ 123a │
|
||||
│ 5 │ abc │
|
||||
│ 3 │ ABC │
|
||||
│ 1 │ bca │
|
||||
│ 7 │ BCA │
|
||||
│ 6 │ ᴺᵁᴸᴸ │
|
||||
│ 2 │ ᴺᵁᴸᴸ │
|
||||
└───┴──────┘
|
||||
```
|
||||
|
||||
Example with [Array](../../../sql-reference/data-types/array.md):
|
||||
|
||||
Input table:
|
||||
|
||||
``` text
|
||||
┌─x─┬─s─────────────┐
|
||||
│ 1 │ ['Z'] │
|
||||
│ 2 │ ['z'] │
|
||||
│ 3 │ ['a'] │
|
||||
│ 4 │ ['A'] │
|
||||
│ 5 │ ['z','a'] │
|
||||
│ 6 │ ['z','a','a'] │
|
||||
│ 7 │ [''] │
|
||||
└───┴───────────────┘
|
||||
```
|
||||
|
||||
Query:
|
||||
|
||||
```sql
|
||||
SELECT * FROM collate_test ORDER BY s ASC COLLATE 'en';
|
||||
```
|
||||
|
||||
Result:
|
||||
|
||||
``` text
|
||||
┌─x─┬─s─────────────┐
|
||||
│ 7 │ [''] │
|
||||
│ 3 │ ['a'] │
|
||||
│ 4 │ ['A'] │
|
||||
│ 2 │ ['z'] │
|
||||
│ 5 │ ['z','a'] │
|
||||
│ 6 │ ['z','a','a'] │
|
||||
│ 1 │ ['Z'] │
|
||||
└───┴───────────────┘
|
||||
```
|
||||
|
||||
Example with [LowCardinality](../../../sql-reference/data-types/lowcardinality.md) string:
|
||||
|
||||
Input table:
|
||||
|
||||
```text
|
||||
┌─x─┬─s───┐
|
||||
│ 1 │ Z │
|
||||
│ 2 │ z │
|
||||
│ 3 │ a │
|
||||
│ 4 │ A │
|
||||
│ 5 │ za │
|
||||
│ 6 │ zaa │
|
||||
│ 7 │ │
|
||||
└───┴─────┘
|
||||
```
|
||||
|
||||
Query:
|
||||
|
||||
```sql
|
||||
SELECT * FROM collate_test ORDER BY s ASC COLLATE 'en';
|
||||
```
|
||||
|
||||
Result:
|
||||
|
||||
```text
|
||||
┌─x─┬─s───┐
|
||||
│ 7 │ │
|
||||
│ 3 │ a │
|
||||
│ 4 │ A │
|
||||
│ 2 │ z │
|
||||
│ 1 │ Z │
|
||||
│ 5 │ za │
|
||||
│ 6 │ zaa │
|
||||
└───┴─────┘
|
||||
```
|
||||
|
||||
Example with [Tuple](../../../sql-reference/data-types/tuple.md):
|
||||
|
||||
```text
|
||||
┌─x─┬─s───────┐
|
||||
│ 1 │ (1,'Z') │
|
||||
│ 2 │ (1,'z') │
|
||||
│ 3 │ (1,'a') │
|
||||
│ 4 │ (2,'z') │
|
||||
│ 5 │ (1,'A') │
|
||||
│ 6 │ (2,'Z') │
|
||||
│ 7 │ (2,'A') │
|
||||
└───┴─────────┘
|
||||
```
|
||||
|
||||
Query:
|
||||
|
||||
```sql
|
||||
SELECT * FROM collate_test ORDER BY s ASC COLLATE 'en';
|
||||
```
|
||||
|
||||
Result:
|
||||
|
||||
```text
|
||||
┌─x─┬─s───────┐
|
||||
│ 3 │ (1,'a') │
|
||||
│ 5 │ (1,'A') │
|
||||
│ 2 │ (1,'z') │
|
||||
│ 1 │ (1,'Z') │
|
||||
│ 7 │ (2,'A') │
|
||||
│ 4 │ (2,'z') │
|
||||
│ 6 │ (2,'Z') │
|
||||
└───┴─────────┘
|
||||
```
|
||||
|
||||
## Implementation Details {#implementation-details}
|
||||
|
||||
Less RAM is used if a small enough [LIMIT](../../../sql-reference/statements/select/limit.md) is specified in addition to `ORDER BY`. Otherwise, the amount of memory spent is proportional to the volume of data for sorting. For distributed query processing, if [GROUP BY](../../../sql-reference/statements/select/group-by.md) is omitted, sorting is partially done on remote servers, and the results are merged on the requestor server. This means that for distributed sorting, the volume of data to sort can be greater than the amount of memory on a single server.
|
||||
|
@ -257,8 +257,8 @@ El desarrollo de ClickHouse a menudo requiere cargar conjuntos de datos realista
|
||||
|
||||
sudo apt install wget xz-utils
|
||||
|
||||
wget https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz
|
||||
wget https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz
|
||||
wget https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz
|
||||
wget https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz
|
||||
|
||||
xz -v -d hits_v1.tsv.xz
|
||||
xz -v -d visits_v1.tsv.xz
|
||||
|
@ -579,7 +579,7 @@ Si una función captura la propiedad de un objeto creado en el montón, cree el
|
||||
|
||||
**14.** Valores devueltos.
|
||||
|
||||
En la mayoría de los casos, sólo tiene que utilizar `return`. No escribir `[return std::move(res)]{.strike}`.
|
||||
En la mayoría de los casos, sólo tiene que utilizar `return`. No escribir `return std::move(res)`.
|
||||
|
||||
Si la función asigna un objeto en el montón y lo devuelve, use `shared_ptr` o `unique_ptr`.
|
||||
|
||||
@ -673,7 +673,7 @@ Utilice siempre `#pragma once` en lugar de incluir guardias.
|
||||
**24.** No use `trailing return type` para funciones a menos que sea necesario.
|
||||
|
||||
``` cpp
|
||||
[auto f() -> void;]{.strike}
|
||||
auto f() -> void
|
||||
```
|
||||
|
||||
**25.** Declaración e inicialización de variables.
|
||||
|
@ -9,14 +9,14 @@ toc_title: El Yandex.Metrica Datos
|
||||
|
||||
El conjunto de datos consta de dos tablas que contienen datos anónimos sobre los hits (`hits_v1`) y visitas (`visits_v1`) el Yandex.Métrica. Puedes leer más sobre Yandex.Metrica en [Historial de ClickHouse](../../introduction/history.md) apartado.
|
||||
|
||||
El conjunto de datos consta de dos tablas, cualquiera de ellas se puede descargar como `tsv.xz` o como particiones preparadas. Además, una versión extendida de la `hits` La tabla que contiene 100 millones de filas está disponible como TSV en https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_100m_obfuscated_v1.tsv.xz y como particiones preparadas en https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_100m_obfuscated_v1.tar.xz.
|
||||
El conjunto de datos consta de dos tablas, cualquiera de ellas se puede descargar como `tsv.xz` o como particiones preparadas. Además, una versión extendida de la `hits` La tabla que contiene 100 millones de filas está disponible como TSV en https://datasets.clickhouse.tech/hits/tsv/hits_100m_obfuscated_v1.tsv.xz y como particiones preparadas en https://datasets.clickhouse.tech/hits/partitions/hits_100m_obfuscated_v1.tar.xz.
|
||||
|
||||
## Obtención de tablas a partir de particiones preparadas {#obtaining-tables-from-prepared-partitions}
|
||||
|
||||
Descargar e importar tabla de hits:
|
||||
|
||||
``` bash
|
||||
curl -O https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_v1.tar
|
||||
curl -O https://datasets.clickhouse.tech/hits/partitions/hits_v1.tar
|
||||
tar xvf hits_v1.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
# check permissions on unpacked data, fix if required
|
||||
sudo service clickhouse-server restart
|
||||
@ -26,7 +26,7 @@ clickhouse-client --query "SELECT COUNT(*) FROM datasets.hits_v1"
|
||||
Descargar e importar visitas:
|
||||
|
||||
``` bash
|
||||
curl -O https://clickhouse-datasets.s3.yandex.net/visits/partitions/visits_v1.tar
|
||||
curl -O https://datasets.clickhouse.tech/visits/partitions/visits_v1.tar
|
||||
tar xvf visits_v1.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
# check permissions on unpacked data, fix if required
|
||||
sudo service clickhouse-server restart
|
||||
@ -38,7 +38,7 @@ clickhouse-client --query "SELECT COUNT(*) FROM datasets.visits_v1"
|
||||
Descargar e importar hits desde un archivo TSV comprimido:
|
||||
|
||||
``` bash
|
||||
curl https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
# now create table
|
||||
clickhouse-client --query "CREATE DATABASE IF NOT EXISTS datasets"
|
||||
clickhouse-client --query "CREATE TABLE datasets.hits_v1 ( WatchID UInt64, JavaEnable UInt8, Title String, GoodEvent Int16, EventTime DateTime, EventDate Date, CounterID UInt32, ClientIP UInt32, ClientIP6 FixedString(16), RegionID UInt32, UserID UInt64, CounterClass Int8, OS UInt8, UserAgent UInt8, URL String, Referer String, URLDomain String, RefererDomain String, Refresh UInt8, IsRobot UInt8, RefererCategories Array(UInt16), URLCategories Array(UInt16), URLRegions Array(UInt32), RefererRegions Array(UInt32), ResolutionWidth UInt16, ResolutionHeight UInt16, ResolutionDepth UInt8, FlashMajor UInt8, FlashMinor UInt8, FlashMinor2 String, NetMajor UInt8, NetMinor UInt8, UserAgentMajor UInt16, UserAgentMinor FixedString(2), CookieEnable UInt8, JavascriptEnable UInt8, IsMobile UInt8, MobilePhone UInt8, MobilePhoneModel String, Params String, IPNetworkID UInt32, TraficSourceID Int8, SearchEngineID UInt16, SearchPhrase String, AdvEngineID UInt8, IsArtifical UInt8, WindowClientWidth UInt16, WindowClientHeight UInt16, ClientTimeZone Int16, ClientEventTime DateTime, SilverlightVersion1 UInt8, SilverlightVersion2 UInt8, SilverlightVersion3 UInt32, SilverlightVersion4 UInt16, PageCharset String, CodeVersion UInt32, IsLink UInt8, IsDownload UInt8, IsNotBounce UInt8, FUniqID UInt64, HID UInt32, IsOldCounter UInt8, IsEvent UInt8, IsParameter UInt8, DontCountHits UInt8, WithHash UInt8, HitColor FixedString(1), UTCEventTime DateTime, Age UInt8, Sex UInt8, Income UInt8, Interests UInt16, Robotness UInt8, GeneralInterests Array(UInt16), RemoteIP UInt32, RemoteIP6 FixedString(16), WindowName Int32, OpenerName Int32, HistoryLength Int16, BrowserLanguage FixedString(2), BrowserCountry FixedString(2), SocialNetwork String, SocialAction String, HTTPError UInt16, SendTiming Int32, DNSTiming Int32, ConnectTiming Int32, ResponseStartTiming Int32, ResponseEndTiming Int32, FetchTiming Int32, RedirectTiming Int32, DOMInteractiveTiming Int32, DOMContentLoadedTiming Int32, DOMCompleteTiming Int32, LoadEventStartTiming Int32, LoadEventEndTiming Int32, NSToDOMContentLoadedTiming Int32, FirstPaintTiming Int32, RedirectCount Int8, SocialSourceNetworkID UInt8, SocialSourcePage String, ParamPrice Int64, ParamOrderID String, ParamCurrency FixedString(3), ParamCurrencyID UInt16, GoalsReached Array(UInt32), OpenstatServiceName String, OpenstatCampaignID String, OpenstatAdID String, OpenstatSourceID String, UTMSource String, UTMMedium String, UTMCampaign String, UTMContent String, UTMTerm String, FromTag String, HasGCLID UInt8, RefererHash UInt64, URLHash UInt64, CLID UInt32, YCLID UInt64, ShareService String, ShareURL String, ShareTitle String, ParsedParams Nested(Key1 String, Key2 String, Key3 String, Key4 String, Key5 String, ValueDouble Float64), IslandID FixedString(16), RequestNum UInt32, RequestTry UInt8) ENGINE = MergeTree() PARTITION BY toYYYYMM(EventDate) ORDER BY (CounterID, EventDate, intHash32(UserID)) SAMPLE BY intHash32(UserID) SETTINGS index_granularity = 8192"
|
||||
@ -52,7 +52,7 @@ clickhouse-client --query "SELECT COUNT(*) FROM datasets.hits_v1"
|
||||
Descargue e importe visitas desde un archivo tsv comprimido:
|
||||
|
||||
``` bash
|
||||
curl https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
# now create table
|
||||
clickhouse-client --query "CREATE DATABASE IF NOT EXISTS datasets"
|
||||
clickhouse-client --query "CREATE TABLE datasets.visits_v1 ( CounterID UInt32, StartDate Date, Sign Int8, IsNew UInt8, VisitID UInt64, UserID UInt64, StartTime DateTime, Duration UInt32, UTCStartTime DateTime, PageViews Int32, Hits Int32, IsBounce UInt8, Referer String, StartURL String, RefererDomain String, StartURLDomain String, EndURL String, LinkURL String, IsDownload UInt8, TraficSourceID Int8, SearchEngineID UInt16, SearchPhrase String, AdvEngineID UInt8, PlaceID Int32, RefererCategories Array(UInt16), URLCategories Array(UInt16), URLRegions Array(UInt32), RefererRegions Array(UInt32), IsYandex UInt8, GoalReachesDepth Int32, GoalReachesURL Int32, GoalReachesAny Int32, SocialSourceNetworkID UInt8, SocialSourcePage String, MobilePhoneModel String, ClientEventTime DateTime, RegionID UInt32, ClientIP UInt32, ClientIP6 FixedString(16), RemoteIP UInt32, RemoteIP6 FixedString(16), IPNetworkID UInt32, SilverlightVersion3 UInt32, CodeVersion UInt32, ResolutionWidth UInt16, ResolutionHeight UInt16, UserAgentMajor UInt16, UserAgentMinor UInt16, WindowClientWidth UInt16, WindowClientHeight UInt16, SilverlightVersion2 UInt8, SilverlightVersion4 UInt16, FlashVersion3 UInt16, FlashVersion4 UInt16, ClientTimeZone Int16, OS UInt8, UserAgent UInt8, ResolutionDepth UInt8, FlashMajor UInt8, FlashMinor UInt8, NetMajor UInt8, NetMinor UInt8, MobilePhone UInt8, SilverlightVersion1 UInt8, Age UInt8, Sex UInt8, Income UInt8, JavaEnable UInt8, CookieEnable UInt8, JavascriptEnable UInt8, IsMobile UInt8, BrowserLanguage UInt16, BrowserCountry UInt16, Interests UInt16, Robotness UInt8, GeneralInterests Array(UInt16), Params Array(String), Goals Nested(ID UInt32, Serial UInt32, EventTime DateTime, Price Int64, OrderID String, CurrencyID UInt32), WatchIDs Array(UInt64), ParamSumPrice Int64, ParamCurrency FixedString(3), ParamCurrencyID UInt16, ClickLogID UInt64, ClickEventID Int32, ClickGoodEvent Int32, ClickEventTime DateTime, ClickPriorityID Int32, ClickPhraseID Int32, ClickPageID Int32, ClickPlaceID Int32, ClickTypeID Int32, ClickResourceID Int32, ClickCost UInt32, ClickClientIP UInt32, ClickDomainID UInt32, ClickURL String, ClickAttempt UInt8, ClickOrderID UInt32, ClickBannerID UInt32, ClickMarketCategoryID UInt32, ClickMarketPP UInt32, ClickMarketCategoryName String, ClickMarketPPName String, ClickAWAPSCampaignName String, ClickPageName String, ClickTargetType UInt16, ClickTargetPhraseID UInt64, ClickContextType UInt8, ClickSelectType Int8, ClickOptions String, ClickGroupBannerID Int32, OpenstatServiceName String, OpenstatCampaignID String, OpenstatAdID String, OpenstatSourceID String, UTMSource String, UTMMedium String, UTMCampaign String, UTMContent String, UTMTerm String, FromTag String, HasGCLID UInt8, FirstVisit DateTime, PredLastVisit Date, LastVisit Date, TotalVisits UInt32, TraficSource Nested(ID Int8, SearchEngineID UInt16, AdvEngineID UInt8, PlaceID UInt16, SocialSourceNetworkID UInt8, Domain String, SearchPhrase String, SocialSourcePage String), Attendance FixedString(16), CLID UInt32, YCLID UInt64, NormalizedRefererHash UInt64, SearchPhraseHash UInt64, RefererDomainHash UInt64, NormalizedStartURLHash UInt64, StartURLDomainHash UInt64, NormalizedEndURLHash UInt64, TopLevelDomain UInt64, URLScheme UInt64, OpenstatServiceNameHash UInt64, OpenstatCampaignIDHash UInt64, OpenstatAdIDHash UInt64, OpenstatSourceIDHash UInt64, UTMSourceHash UInt64, UTMMediumHash UInt64, UTMCampaignHash UInt64, UTMContentHash UInt64, UTMTermHash UInt64, FromHash UInt64, WebVisorEnabled UInt8, WebVisorActivity UInt32, ParsedParams Nested(Key1 String, Key2 String, Key3 String, Key4 String, Key5 String, ValueDouble Float64), Market Nested(Type UInt8, GoalID UInt32, OrderID String, OrderPrice Int64, PP UInt32, DirectPlaceID UInt32, DirectOrderID UInt32, DirectBannerID UInt32, GoodID String, GoodName String, GoodQuantity Int32, GoodPrice Int64), IslandID FixedString(16)) ENGINE = CollapsingMergeTree(Sign) PARTITION BY toYYYYMM(StartDate) ORDER BY (CounterID, StartDate, intHash32(UserID), VisitID) SAMPLE BY intHash32(UserID) SETTINGS index_granularity = 8192"
|
||||
|
@ -285,7 +285,7 @@ Entre otras cosas, puede ejecutar la consulta OPTIMIZE en MergeTree. Pero no es
|
||||
## Descarga de Prepared Partitions {#download-of-prepared-partitions}
|
||||
|
||||
``` bash
|
||||
$ curl -O https://clickhouse-datasets.s3.yandex.net/trips_mergetree/partitions/trips_mergetree.tar
|
||||
$ curl -O https://datasets.clickhouse.tech/trips_mergetree/partitions/trips_mergetree.tar
|
||||
$ tar xvf trips_mergetree.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
$ # check permissions of unpacked data, fix if required
|
||||
$ sudo service clickhouse-server restart
|
||||
|
@ -156,7 +156,7 @@ $ for i in *.zip; do echo $i; unzip -cq $i '*.csv' | sed 's/\.00//g' | clickhous
|
||||
## Descarga de Prepared Partitions {#download-of-prepared-partitions}
|
||||
|
||||
``` bash
|
||||
$ curl -O https://clickhouse-datasets.s3.yandex.net/ontime/partitions/ontime.tar
|
||||
$ curl -O https://datasets.clickhouse.tech/ontime/partitions/ontime.tar
|
||||
$ tar xvf ontime.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
$ # check permissions of unpacked data, fix if required
|
||||
$ sudo service clickhouse-server restart
|
||||
|
@ -87,8 +87,8 @@ Ahora es el momento de llenar nuestro servidor ClickHouse con algunos datos de m
|
||||
### Descargar y extraer datos de tabla {#download-and-extract-table-data}
|
||||
|
||||
``` bash
|
||||
curl https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
```
|
||||
|
||||
Los archivos extraídos tienen un tamaño de aproximadamente 10 GB.
|
||||
|
@ -48,7 +48,7 @@ Con esta instrucción, puede ejecutar una prueba de rendimiento básica de Click
|
||||
|
||||
<!-- -->
|
||||
|
||||
wget https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_100m_obfuscated_v1.tar.xz
|
||||
wget https://datasets.clickhouse.tech/hits/partitions/hits_100m_obfuscated_v1.tar.xz
|
||||
tar xvf hits_100m_obfuscated_v1.tar.xz -C .
|
||||
mv hits_100m_obfuscated_v1/* .
|
||||
|
||||
|
@ -26,155 +26,155 @@ En la tabla siguiente se enumeran los casos en que la característica de consult
|
||||
| Feature ID | Nombre de la función | Estatus | Comentario |
|
||||
|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| **E011** | **Tipos de datos numéricos** | **Parcial**{.text-warning} | |
|
||||
| E011-01 | Tipos de datos INTEGER y SMALLINT | Sí{.text-success} | |
|
||||
| E011-02 | REAL, DOUBLE PRECISION y FLOAT tipos de datos tipos de datos | Parcial{.text-warning} | `FLOAT(<binary_precision>)`, `REAL` y `DOUBLE PRECISION` no son compatibles |
|
||||
| E011-03 | Tipos de datos DECIMAL y NUMERIC | Parcial{.text-warning} | Solo `DECIMAL(p,s)` es compatible, no `NUMERIC` |
|
||||
| E011-04 | Operadores aritméticos | Sí{.text-success} | |
|
||||
| E011-05 | Comparación numérica | Sí{.text-success} | |
|
||||
| E011-06 | Conversión implícita entre los tipos de datos numéricos | No{.text-danger} | ANSI SQL permite la conversión implícita arbitraria entre tipos numéricos, mientras que ClickHouse se basa en funciones que tienen múltiples sobrecargas en lugar de conversión implícita |
|
||||
| E011-01 | Tipos de datos INTEGER y SMALLINT | Sí {.text-success} | |
|
||||
| E011-02 | REAL, DOUBLE PRECISION y FLOAT tipos de datos tipos de datos | Parcial {.text-warning} | `FLOAT(<binary_precision>)`, `REAL` y `DOUBLE PRECISION` no son compatibles |
|
||||
| E011-03 | Tipos de datos DECIMAL y NUMERIC | Parcial {.text-warning} | Solo `DECIMAL(p,s)` es compatible, no `NUMERIC` |
|
||||
| E011-04 | Operadores aritméticos | Sí {.text-success} | |
|
||||
| E011-05 | Comparación numérica | Sí {.text-success} | |
|
||||
| E011-06 | Conversión implícita entre los tipos de datos numéricos | No {.text-danger} | ANSI SQL permite la conversión implícita arbitraria entre tipos numéricos, mientras que ClickHouse se basa en funciones que tienen múltiples sobrecargas en lugar de conversión implícita |
|
||||
| **E021** | **Tipos de cadena de caracteres** | **Parcial**{.text-warning} | |
|
||||
| E021-01 | Tipo de datos CHARACTER | No{.text-danger} | |
|
||||
| E021-02 | Tipo de datos CHARACTER VARYING | No{.text-danger} | `String` se comporta de manera similar, pero sin límite de longitud entre paréntesis |
|
||||
| E021-03 | Literales de caracteres | Parcial{.text-warning} | Sin concatenación automática de literales consecutivos y compatibilidad con el conjunto de caracteres |
|
||||
| E021-04 | Función CHARACTER_LENGTH | Parcial{.text-warning} | No `USING` clausula |
|
||||
| E021-05 | Función OCTET_LENGTH | No{.text-danger} | `LENGTH` se comporta de manera similar |
|
||||
| E021-06 | SUBSTRING | Parcial{.text-warning} | No hay soporte para `SIMILAR` y `ESCAPE` cláusulas, no `SUBSTRING_REGEX` variante |
|
||||
| E021-07 | Concatenación de caracteres | Parcial{.text-warning} | No `COLLATE` clausula |
|
||||
| E021-08 | Funciones SUPERIOR e INFERIOR | Sí{.text-success} | |
|
||||
| E021-09 | Función TRIM | Sí{.text-success} | |
|
||||
| E021-10 | Conversión implícita entre los tipos de cadena de caracteres de longitud fija y longitud variable | No{.text-danger} | ANSI SQL permite la conversión implícita arbitraria entre tipos de cadena, mientras que ClickHouse se basa en funciones que tienen múltiples sobrecargas en lugar de conversión implícita |
|
||||
| E021-11 | Función POSITION | Parcial{.text-warning} | No hay soporte para `IN` y `USING` cláusulas, no `POSITION_REGEX` variante |
|
||||
| E021-12 | Comparación de caracteres | Sí{.text-success} | |
|
||||
| E021-01 | Tipo de datos CHARACTER | No {.text-danger} | |
|
||||
| E021-02 | Tipo de datos CHARACTER VARYING | No {.text-danger} | `String` se comporta de manera similar, pero sin límite de longitud entre paréntesis |
|
||||
| E021-03 | Literales de caracteres | Parcial {.text-warning} | Sin concatenación automática de literales consecutivos y compatibilidad con el conjunto de caracteres |
|
||||
| E021-04 | Función CHARACTER_LENGTH | Parcial {.text-warning} | No `USING` clausula |
|
||||
| E021-05 | Función OCTET_LENGTH | No {.text-danger} | `LENGTH` se comporta de manera similar |
|
||||
| E021-06 | SUBSTRING | Parcial {.text-warning} | No hay soporte para `SIMILAR` y `ESCAPE` cláusulas, no `SUBSTRING_REGEX` variante |
|
||||
| E021-07 | Concatenación de caracteres | Parcial {.text-warning} | No `COLLATE` clausula |
|
||||
| E021-08 | Funciones SUPERIOR e INFERIOR | Sí {.text-success} | |
|
||||
| E021-09 | Función TRIM | Sí {.text-success} | |
|
||||
| E021-10 | Conversión implícita entre los tipos de cadena de caracteres de longitud fija y longitud variable | No {.text-danger} | ANSI SQL permite la conversión implícita arbitraria entre tipos de cadena, mientras que ClickHouse se basa en funciones que tienen múltiples sobrecargas en lugar de conversión implícita |
|
||||
| E021-11 | Función POSITION | Parcial {.text-warning} | No hay soporte para `IN` y `USING` cláusulas, no `POSITION_REGEX` variante |
|
||||
| E021-12 | Comparación de caracteres | Sí {.text-success} | |
|
||||
| **E031** | **Identificador** | **Parcial**{.text-warning} | |
|
||||
| E031-01 | Identificadores delimitados | Parcial{.text-warning} | El soporte literal Unicode es limitado |
|
||||
| E031-02 | Identificadores de minúsculas | Sí{.text-success} | |
|
||||
| E031-03 | Trailing subrayado | Sí{.text-success} | |
|
||||
| E031-01 | Identificadores delimitados | Parcial {.text-warning} | El soporte literal Unicode es limitado |
|
||||
| E031-02 | Identificadores de minúsculas | Sí {.text-success} | |
|
||||
| E031-03 | Trailing subrayado | Sí {.text-success} | |
|
||||
| **E051** | **Especificación básica de la consulta** | **Parcial**{.text-warning} | |
|
||||
| E051-01 | SELECT DISTINCT | Sí{.text-success} | |
|
||||
| E051-02 | Cláusula GROUP BY | Sí{.text-success} | |
|
||||
| E051-04 | GROUP BY puede contener columnas que no estén en `<select list>` | Sí{.text-success} | |
|
||||
| E051-05 | Los elementos seleccionados pueden ser renombrados | Sí{.text-success} | |
|
||||
| E051-06 | Cláusula HAVING | Sí{.text-success} | |
|
||||
| E051-07 | Calificado \* en la lista de selección | Sí{.text-success} | |
|
||||
| E051-08 | Nombre de correlación en la cláusula FROM | Sí{.text-success} | |
|
||||
| E051-09 | Cambiar el nombre de las columnas en la cláusula FROM | No{.text-danger} | |
|
||||
| E051-01 | SELECT DISTINCT | Sí {.text-success} | |
|
||||
| E051-02 | Cláusula GROUP BY | Sí {.text-success} | |
|
||||
| E051-04 | GROUP BY puede contener columnas que no estén en `<select list>` | Sí {.text-success} | |
|
||||
| E051-05 | Los elementos seleccionados pueden ser renombrados | Sí {.text-success} | |
|
||||
| E051-06 | Cláusula HAVING | Sí {.text-success} | |
|
||||
| E051-07 | Calificado \* en la lista de selección | Sí {.text-success} | |
|
||||
| E051-08 | Nombre de correlación en la cláusula FROM | Sí {.text-success} | |
|
||||
| E051-09 | Cambiar el nombre de las columnas en la cláusula FROM | No {.text-danger} | |
|
||||
| **E061** | **Predicados básicos y condiciones de búsqueda** | **Parcial**{.text-warning} | |
|
||||
| E061-01 | Predicado de comparación | Sí{.text-success} | |
|
||||
| E061-02 | ENTRE predicado | Parcial{.text-warning} | No `SYMMETRIC` y `ASYMMETRIC` clausula |
|
||||
| E061-03 | Predicado IN con lista de valores | Sí{.text-success} | |
|
||||
| E061-04 | COMO predicado | Sí{.text-success} | |
|
||||
| E061-05 | Predicado LIKE: cláusula ESCAPE | No{.text-danger} | |
|
||||
| E061-06 | Predicado NULL | Sí{.text-success} | |
|
||||
| E061-07 | Predicado de comparación cuantificado | No{.text-danger} | |
|
||||
| E061-08 | Predicado EXISTS | No{.text-danger} | |
|
||||
| E061-09 | Subconsultas en predicado de comparación | Sí{.text-success} | |
|
||||
| E061-11 | Subconsultas en el predicado IN | Sí{.text-success} | |
|
||||
| E061-12 | Subconsultas en predicado de comparación cuantificado | No{.text-danger} | |
|
||||
| E061-13 | Subconsultas correlacionadas | No{.text-danger} | |
|
||||
| E061-14 | Condición de búsqueda | Sí{.text-success} | |
|
||||
| E061-01 | Predicado de comparación | Sí {.text-success} | |
|
||||
| E061-02 | ENTRE predicado | Parcial {.text-warning} | No `SYMMETRIC` y `ASYMMETRIC` clausula |
|
||||
| E061-03 | Predicado IN con lista de valores | Sí {.text-success} | |
|
||||
| E061-04 | COMO predicado | Sí {.text-success} | |
|
||||
| E061-05 | Predicado LIKE: cláusula ESCAPE | No {.text-danger} | |
|
||||
| E061-06 | Predicado NULL | Sí {.text-success} | |
|
||||
| E061-07 | Predicado de comparación cuantificado | No {.text-danger} | |
|
||||
| E061-08 | Predicado EXISTS | No {.text-danger} | |
|
||||
| E061-09 | Subconsultas en predicado de comparación | Sí {.text-success} | |
|
||||
| E061-11 | Subconsultas en el predicado IN | Sí {.text-success} | |
|
||||
| E061-12 | Subconsultas en predicado de comparación cuantificado | No {.text-danger} | |
|
||||
| E061-13 | Subconsultas correlacionadas | No {.text-danger} | |
|
||||
| E061-14 | Condición de búsqueda | Sí {.text-success} | |
|
||||
| **E071** | **Expresiones de consulta básicas** | **Parcial**{.text-warning} | |
|
||||
| E071-01 | Operador de tabla UNION DISTINCT | No{.text-danger} | |
|
||||
| E071-02 | Operador de tabla UNION ALL | Sí{.text-success} | |
|
||||
| E071-03 | EXCEPTO operador de tabla DISTINCT | No{.text-danger} | |
|
||||
| E071-05 | Las columnas combinadas a través de operadores de tabla no necesitan tener exactamente el mismo tipo de datos | Sí{.text-success} | |
|
||||
| E071-06 | Operadores de tabla en subconsultas | Sí{.text-success} | |
|
||||
| E071-01 | Operador de tabla UNION DISTINCT | No {.text-danger} | |
|
||||
| E071-02 | Operador de tabla UNION ALL | Sí {.text-success} | |
|
||||
| E071-03 | EXCEPTO operador de tabla DISTINCT | No {.text-danger} | |
|
||||
| E071-05 | Las columnas combinadas a través de operadores de tabla no necesitan tener exactamente el mismo tipo de datos | Sí {.text-success} | |
|
||||
| E071-06 | Operadores de tabla en subconsultas | Sí {.text-success} | |
|
||||
| **E081** | **Privilegios básicos** | **Parcial**{.text-warning} | Trabajo en curso |
|
||||
| **E091** | **Establecer funciones** | **Sí**{.text-success} | |
|
||||
| E091-01 | AVG | Sí{.text-success} | |
|
||||
| E091-02 | COUNT | Sí{.text-success} | |
|
||||
| E091-03 | MAX | Sí{.text-success} | |
|
||||
| E091-04 | MIN | Sí{.text-success} | |
|
||||
| E091-05 | SUM | Sí{.text-success} | |
|
||||
| E091-06 | Cuantificador ALL | No{.text-danger} | |
|
||||
| E091-07 | Cuantificador DISTINCT | Parcial{.text-warning} | No se admiten todas las funciones agregadas |
|
||||
| E091-01 | AVG | Sí {.text-success} | |
|
||||
| E091-02 | COUNT | Sí {.text-success} | |
|
||||
| E091-03 | MAX | Sí {.text-success} | |
|
||||
| E091-04 | MIN | Sí {.text-success} | |
|
||||
| E091-05 | SUM | Sí {.text-success} | |
|
||||
| E091-06 | Cuantificador ALL | No {.text-danger} | |
|
||||
| E091-07 | Cuantificador DISTINCT | Parcial {.text-warning} | No se admiten todas las funciones agregadas |
|
||||
| **E101** | **Manipulación de datos básicos** | **Parcial**{.text-warning} | |
|
||||
| E101-01 | Instrucción INSERT | Sí{.text-success} | Nota: la clave principal en ClickHouse no implica el `UNIQUE` limitación |
|
||||
| E101-03 | Instrucción UPDATE buscada | No{.text-danger} | Hay una `ALTER UPDATE` declaración para la modificación de datos por lotes |
|
||||
| E101-04 | Instrucción DELETE buscada | No{.text-danger} | Hay una `ALTER DELETE` declaración para la eliminación de datos por lotes |
|
||||
| E101-01 | Instrucción INSERT | Sí {.text-success} | Nota: la clave principal en ClickHouse no implica el `UNIQUE` limitación |
|
||||
| E101-03 | Instrucción UPDATE buscada | No {.text-danger} | Hay una `ALTER UPDATE` declaración para la modificación de datos por lotes |
|
||||
| E101-04 | Instrucción DELETE buscada | No {.text-danger} | Hay una `ALTER DELETE` declaración para la eliminación de datos por lotes |
|
||||
| **E111** | **Instrucción SELECT de una sola fila** | **No**{.text-danger} | |
|
||||
| **E121** | **Soporte básico del cursor** | **No**{.text-danger} | |
|
||||
| E121-01 | DECLARE CURSOR | No{.text-danger} | |
|
||||
| E121-02 | Las columnas PEDIR POR no necesitan estar en la lista de selección | No{.text-danger} | |
|
||||
| E121-03 | Expresiones de valor en la cláusula ORDER BY | No{.text-danger} | |
|
||||
| E121-04 | Declaración ABIERTA | No{.text-danger} | |
|
||||
| E121-06 | Instrucción UPDATE posicionada | No{.text-danger} | |
|
||||
| E121-07 | Instrucción DELETE posicionada | No{.text-danger} | |
|
||||
| E121-08 | Declaración CERRAR | No{.text-danger} | |
|
||||
| E121-10 | Declaración FETCH: implícita NEXT | No{.text-danger} | |
|
||||
| E121-17 | CON Cursores HOLD | No{.text-danger} | |
|
||||
| E121-01 | DECLARE CURSOR | No {.text-danger} | |
|
||||
| E121-02 | Las columnas PEDIR POR no necesitan estar en la lista de selección | No {.text-danger} | |
|
||||
| E121-03 | Expresiones de valor en la cláusula ORDER BY | No {.text-danger} | |
|
||||
| E121-04 | Declaración ABIERTA | No {.text-danger} | |
|
||||
| E121-06 | Instrucción UPDATE posicionada | No {.text-danger} | |
|
||||
| E121-07 | Instrucción DELETE posicionada | No {.text-danger} | |
|
||||
| E121-08 | Declaración CERRAR | No {.text-danger} | |
|
||||
| E121-10 | Declaración FETCH: implícita NEXT | No {.text-danger} | |
|
||||
| E121-17 | CON Cursores HOLD | No {.text-danger} | |
|
||||
| **E131** | **Soporte de valor nulo (nulos en lugar de valores)** | **Parcial**{.text-warning} | Se aplican algunas restricciones |
|
||||
| **E141** | **Restricciones de integridad básicas** | **Parcial**{.text-warning} | |
|
||||
| E141-01 | Restricciones NOT NULL | Sí{.text-success} | Nota: `NOT NULL` está implícito para las columnas de tabla de forma predeterminada |
|
||||
| E141-02 | Restricción UNIQUE de columnas NOT NULL | No{.text-danger} | |
|
||||
| E141-03 | Restricciones PRIMARY KEY | No{.text-danger} | |
|
||||
| E141-04 | Restricción básica FOREIGN KEY con el valor predeterminado NO ACTION para la acción de eliminación referencial y la acción de actualización referencial | No{.text-danger} | |
|
||||
| E141-06 | Restricción CHECK | Sí{.text-success} | |
|
||||
| E141-07 | Valores predeterminados de columna | Sí{.text-success} | |
|
||||
| E141-08 | NO NULL inferido en CLAVE PRIMARIA | Sí{.text-success} | |
|
||||
| E141-10 | Los nombres de una clave externa se pueden especificar en cualquier orden | No{.text-danger} | |
|
||||
| E141-01 | Restricciones NOT NULL | Sí {.text-success} | Nota: `NOT NULL` está implícito para las columnas de tabla de forma predeterminada |
|
||||
| E141-02 | Restricción UNIQUE de columnas NOT NULL | No {.text-danger} | |
|
||||
| E141-03 | Restricciones PRIMARY KEY | No {.text-danger} | |
|
||||
| E141-04 | Restricción básica FOREIGN KEY con el valor predeterminado NO ACTION para la acción de eliminación referencial y la acción de actualización referencial | No {.text-danger} | |
|
||||
| E141-06 | Restricción CHECK | Sí {.text-success} | |
|
||||
| E141-07 | Valores predeterminados de columna | Sí {.text-success} | |
|
||||
| E141-08 | NO NULL inferido en CLAVE PRIMARIA | Sí {.text-success} | |
|
||||
| E141-10 | Los nombres de una clave externa se pueden especificar en cualquier orden | No {.text-danger} | |
|
||||
| **E151** | **Soporte de transacciones** | **No**{.text-danger} | |
|
||||
| E151-01 | Declaración COMMIT | No{.text-danger} | |
|
||||
| E151-02 | Instrucción ROLLBACK | No{.text-danger} | |
|
||||
| E151-01 | Declaración COMMIT | No {.text-danger} | |
|
||||
| E151-02 | Instrucción ROLLBACK | No {.text-danger} | |
|
||||
| **E152** | **Instrucción SET TRANSACTION básica** | **No**{.text-danger} | |
|
||||
| E152-01 | Instrucción SET TRANSACTION: cláusula ISOLATION LEVEL SERIALIZABLE | No{.text-danger} | |
|
||||
| E152-02 | Instrucción SET TRANSACTION: cláusulas READ ONLY y READ WRITE | No{.text-danger} | |
|
||||
| E152-01 | Instrucción SET TRANSACTION: cláusula ISOLATION LEVEL SERIALIZABLE | No {.text-danger} | |
|
||||
| E152-02 | Instrucción SET TRANSACTION: cláusulas READ ONLY y READ WRITE | No {.text-danger} | |
|
||||
| **E153** | **Consultas actualizables con subconsultas** | **No**{.text-danger} | |
|
||||
| **E161** | **Comentarios SQL usando doble menos inicial** | **Sí**{.text-success} | |
|
||||
| **E171** | **Soporte SQLSTATE** | **No**{.text-danger} | |
|
||||
| **E182** | **Enlace de idioma de host** | **No**{.text-danger} | |
|
||||
| **F031** | **Manipulación básica del esquema** | **Parcial**{.text-warning} | |
|
||||
| F031-01 | Instrucción CREATE TABLE para crear tablas base persistentes | Parcial{.text-warning} | No `SYSTEM VERSIONING`, `ON COMMIT`, `GLOBAL`, `LOCAL`, `PRESERVE`, `DELETE`, `REF IS`, `WITH OPTIONS`, `UNDER`, `LIKE`, `PERIOD FOR` cláusulas y sin soporte para tipos de datos resueltos por el usuario |
|
||||
| F031-02 | Instrucción CREATE VIEW | Parcial{.text-warning} | No `RECURSIVE`, `CHECK`, `UNDER`, `WITH OPTIONS` cláusulas y sin soporte para tipos de datos resueltos por el usuario |
|
||||
| F031-03 | Declaración GRANT | Sí{.text-success} | |
|
||||
| F031-04 | Sentencia ALTER TABLE: cláusula ADD COLUMN | Parcial{.text-warning} | No hay soporte para `GENERATED` cláusula y período de tiempo del sistema |
|
||||
| F031-13 | Instrucción DROP TABLE: cláusula RESTRICT | No{.text-danger} | |
|
||||
| F031-16 | Instrucción DROP VIEW: cláusula RESTRICT | No{.text-danger} | |
|
||||
| F031-19 | Declaración REVOKE: cláusula RESTRICT | No{.text-danger} | |
|
||||
| F031-01 | Instrucción CREATE TABLE para crear tablas base persistentes | Parcial {.text-warning} | No `SYSTEM VERSIONING`, `ON COMMIT`, `GLOBAL`, `LOCAL`, `PRESERVE`, `DELETE`, `REF IS`, `WITH OPTIONS`, `UNDER`, `LIKE`, `PERIOD FOR` cláusulas y sin soporte para tipos de datos resueltos por el usuario |
|
||||
| F031-02 | Instrucción CREATE VIEW | Parcial {.text-warning} | No `RECURSIVE`, `CHECK`, `UNDER`, `WITH OPTIONS` cláusulas y sin soporte para tipos de datos resueltos por el usuario |
|
||||
| F031-03 | Declaración GRANT | Sí {.text-success} | |
|
||||
| F031-04 | Sentencia ALTER TABLE: cláusula ADD COLUMN | Parcial {.text-warning} | No hay soporte para `GENERATED` cláusula y período de tiempo del sistema |
|
||||
| F031-13 | Instrucción DROP TABLE: cláusula RESTRICT | No {.text-danger} | |
|
||||
| F031-16 | Instrucción DROP VIEW: cláusula RESTRICT | No {.text-danger} | |
|
||||
| F031-19 | Declaración REVOKE: cláusula RESTRICT | No {.text-danger} | |
|
||||
| **F041** | **Tabla unida básica** | **Parcial**{.text-warning} | |
|
||||
| F041-01 | Unión interna (pero no necesariamente la palabra clave INNER) | Sí{.text-success} | |
|
||||
| F041-02 | Palabra clave INTERNA | Sí{.text-success} | |
|
||||
| F041-03 | LEFT OUTER JOIN | Sí{.text-success} | |
|
||||
| F041-04 | RIGHT OUTER JOIN | Sí{.text-success} | |
|
||||
| F041-05 | Las uniones externas se pueden anidar | Sí{.text-success} | |
|
||||
| F041-07 | La tabla interna en una combinación externa izquierda o derecha también se puede usar en una combinación interna | Sí{.text-success} | |
|
||||
| F041-08 | Todos los operadores de comparación son compatibles (en lugar de solo =) | No{.text-danger} | |
|
||||
| F041-01 | Unión interna (pero no necesariamente la palabra clave INNER) | Sí {.text-success} | |
|
||||
| F041-02 | Palabra clave INTERNA | Sí {.text-success} | |
|
||||
| F041-03 | LEFT OUTER JOIN | Sí {.text-success} | |
|
||||
| F041-04 | RIGHT OUTER JOIN | Sí {.text-success} | |
|
||||
| F041-05 | Las uniones externas se pueden anidar | Sí {.text-success} | |
|
||||
| F041-07 | La tabla interna en una combinación externa izquierda o derecha también se puede usar en una combinación interna | Sí {.text-success} | |
|
||||
| F041-08 | Todos los operadores de comparación son compatibles (en lugar de solo =) | No {.text-danger} | |
|
||||
| **F051** | **Fecha y hora básicas** | **Parcial**{.text-warning} | |
|
||||
| F051-01 | Tipo de datos DATE (incluido el soporte del literal DATE) | Parcial{.text-warning} | No literal |
|
||||
| F051-02 | Tipo de datos TIME (incluido el soporte del literal TIME) con una precisión de segundos fraccionarios de al menos 0 | No{.text-danger} | |
|
||||
| F051-03 | Tipo de datos TIMESTAMP (incluido el soporte del literal TIMESTAMP) con una precisión de segundos fraccionarios de al menos 0 y 6 | No{.text-danger} | `DateTime64` tiempo proporciona una funcionalidad similar |
|
||||
| F051-04 | Predicado de comparación en los tipos de datos DATE, TIME y TIMESTAMP | Parcial{.text-warning} | Sólo un tipo de datos disponible |
|
||||
| F051-05 | CAST explícito entre tipos de fecha y hora y tipos de cadena de caracteres | Sí{.text-success} | |
|
||||
| F051-06 | CURRENT_DATE | No{.text-danger} | `today()` es similar |
|
||||
| F051-07 | LOCALTIME | No{.text-danger} | `now()` es similar |
|
||||
| F051-08 | LOCALTIMESTAMP | No{.text-danger} | |
|
||||
| F051-01 | Tipo de datos DATE (incluido el soporte del literal DATE) | Parcial {.text-warning} | No literal |
|
||||
| F051-02 | Tipo de datos TIME (incluido el soporte del literal TIME) con una precisión de segundos fraccionarios de al menos 0 | No {.text-danger} | |
|
||||
| F051-03 | Tipo de datos TIMESTAMP (incluido el soporte del literal TIMESTAMP) con una precisión de segundos fraccionarios de al menos 0 y 6 | No {.text-danger} | `DateTime64` tiempo proporciona una funcionalidad similar |
|
||||
| F051-04 | Predicado de comparación en los tipos de datos DATE, TIME y TIMESTAMP | Parcial {.text-warning} | Sólo un tipo de datos disponible |
|
||||
| F051-05 | CAST explícito entre tipos de fecha y hora y tipos de cadena de caracteres | Sí {.text-success} | |
|
||||
| F051-06 | CURRENT_DATE | No {.text-danger} | `today()` es similar |
|
||||
| F051-07 | LOCALTIME | No {.text-danger} | `now()` es similar |
|
||||
| F051-08 | LOCALTIMESTAMP | No {.text-danger} | |
|
||||
| **F081** | **UNIÓN y EXCEPTO en vistas** | **Parcial**{.text-warning} | |
|
||||
| **F131** | **Operaciones agrupadas** | **Parcial**{.text-warning} | |
|
||||
| F131-01 | Cláusulas WHERE, GROUP BY y HAVING admitidas en consultas con vistas agrupadas | Sí{.text-success} | |
|
||||
| F131-02 | Múltiples tablas admitidas en consultas con vistas agrupadas | Sí{.text-success} | |
|
||||
| F131-03 | Establecer funciones admitidas en consultas con vistas agrupadas | Sí{.text-success} | |
|
||||
| F131-04 | Subconsultas con cláusulas GROUP BY y HAVING y vistas agrupadas | Sí{.text-success} | |
|
||||
| F131-05 | SELECCIONAR una sola fila con cláusulas GROUP BY y HAVING y vistas agrupadas | No{.text-danger} | |
|
||||
| F131-01 | Cláusulas WHERE, GROUP BY y HAVING admitidas en consultas con vistas agrupadas | Sí {.text-success} | |
|
||||
| F131-02 | Múltiples tablas admitidas en consultas con vistas agrupadas | Sí {.text-success} | |
|
||||
| F131-03 | Establecer funciones admitidas en consultas con vistas agrupadas | Sí {.text-success} | |
|
||||
| F131-04 | Subconsultas con cláusulas GROUP BY y HAVING y vistas agrupadas | Sí {.text-success} | |
|
||||
| F131-05 | SELECCIONAR una sola fila con cláusulas GROUP BY y HAVING y vistas agrupadas | No {.text-danger} | |
|
||||
| **F181** | **Múltiples módulos de apoyo** | **No**{.text-danger} | |
|
||||
| **F201** | **Función de fundición** | **Sí**{.text-success} | |
|
||||
| **F221** | **Valores predeterminados explícitos** | **No**{.text-danger} | |
|
||||
| **F261** | **Expresión CASE** | **Sí**{.text-success} | |
|
||||
| F261-01 | Caso simple | Sí{.text-success} | |
|
||||
| F261-02 | CASO buscado | Sí{.text-success} | |
|
||||
| F261-03 | NULLIF | Sí{.text-success} | |
|
||||
| F261-04 | COALESCE | Sí{.text-success} | |
|
||||
| F261-01 | Caso simple | Sí {.text-success} | |
|
||||
| F261-02 | CASO buscado | Sí {.text-success} | |
|
||||
| F261-03 | NULLIF | Sí {.text-success} | |
|
||||
| F261-04 | COALESCE | Sí {.text-success} | |
|
||||
| **F311** | **Instrucción de definición de esquema** | **Parcial**{.text-warning} | |
|
||||
| F311-01 | CREATE SCHEMA | No{.text-danger} | |
|
||||
| F311-02 | CREATE TABLE para tablas base persistentes | Sí{.text-success} | |
|
||||
| F311-03 | CREATE VIEW | Sí{.text-success} | |
|
||||
| F311-04 | CREATE VIEW: WITH CHECK OPTION | No{.text-danger} | |
|
||||
| F311-05 | Declaración GRANT | Sí{.text-success} | |
|
||||
| F311-01 | CREATE SCHEMA | No {.text-danger} | |
|
||||
| F311-02 | CREATE TABLE para tablas base persistentes | Sí {.text-success} | |
|
||||
| F311-03 | CREATE VIEW | Sí {.text-success} | |
|
||||
| F311-04 | CREATE VIEW: WITH CHECK OPTION | No {.text-danger} | |
|
||||
| F311-05 | Declaración GRANT | Sí {.text-success} | |
|
||||
| **F471** | **Valores escalares de la subconsulta** | **Sí**{.text-success} | |
|
||||
| **F481** | **Predicado NULL expandido** | **Sí**{.text-success} | |
|
||||
| **F812** | **Marcado básico** | **No**{.text-danger} | |
|
||||
| **T321** | **Rutinas básicas invocadas por SQL** | **No**{.text-danger} | |
|
||||
| T321-01 | Funciones definidas por el usuario sin sobrecarga | No{.text-danger} | |
|
||||
| T321-02 | Procedimientos almacenados definidos por el usuario sin sobrecarga | No{.text-danger} | |
|
||||
| T321-03 | Invocación de función | No{.text-danger} | |
|
||||
| T321-04 | Declaración de LLAMADA | No{.text-danger} | |
|
||||
| T321-05 | Declaración DEVOLUCIÓN | No{.text-danger} | |
|
||||
| T321-01 | Funciones definidas por el usuario sin sobrecarga | No {.text-danger} | |
|
||||
| T321-02 | Procedimientos almacenados definidos por el usuario sin sobrecarga | No {.text-danger} | |
|
||||
| T321-03 | Invocación de función | No {.text-danger} | |
|
||||
| T321-04 | Declaración de LLAMADA | No {.text-danger} | |
|
||||
| T321-05 | Declaración DEVOLUCIÓN | No {.text-danger} | |
|
||||
| **T631** | **Predicado IN con un elemento de lista** | **Sí**{.text-success} | |
|
||||
|
@ -259,8 +259,8 @@ KDevelop و QTCreator دیگر از جایگزین های بسیار خوبی ا
|
||||
|
||||
sudo apt install wget xz-utils
|
||||
|
||||
wget https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz
|
||||
wget https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz
|
||||
wget https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz
|
||||
wget https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz
|
||||
|
||||
xz -v -d hits_v1.tsv.xz
|
||||
xz -v -d visits_v1.tsv.xz
|
||||
|
@ -580,7 +580,7 @@ ready_any.set();
|
||||
|
||||
**14.** ارزش بازگشت.
|
||||
|
||||
در اکثر موارد فقط استفاده کنید `return`. ننویس `[return std::move(res)]{.strike}`.
|
||||
در اکثر موارد فقط استفاده کنید `return`. ننویس `return std::move(res)`.
|
||||
|
||||
اگر تابع یک شی در پشته اختصاص و بازده, استفاده `shared_ptr` یا `unique_ptr`.
|
||||
|
||||
@ -674,7 +674,7 @@ Loader() {}
|
||||
**24.** استفاده نشود `trailing return type` برای توابع مگر اینکه لازم باشد.
|
||||
|
||||
``` cpp
|
||||
[auto f() -> void;]{.strike}
|
||||
auto f() -> void
|
||||
```
|
||||
|
||||
**25.** اعلامیه و مقدار دهی اولیه از متغیرهای.
|
||||
|
@ -10,14 +10,14 @@ toc_title: "\u06CC\u0627\u0646\u062F\u06A9\u0633\u0627\u0637\u0644\u0627\u0639\u
|
||||
|
||||
مجموعه داده شامل دو جدول حاوی داده های ناشناس در مورد بازدید (`hits_v1`) و بازدیدکننده داشته است (`visits_v1`) یاندکس . متریکا شما می توانید اطلاعات بیشتر در مورد یاندکس به عنوان خوانده شده.متریکا در [تاریخچه کلیک](../../introduction/history.md) بخش.
|
||||
|
||||
مجموعه داده ها شامل دو جدول است که هر کدام می توانند به عنوان یک فشرده دانلود شوند `tsv.xz` فایل و یا به عنوان پارتیشن تهیه شده است. علاوه بر این, یک نسخه طولانی از `hits` جدول حاوی 100 میلیون ردیف به عنوان تسو در دسترس است https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_100m_obfuscated_v1.tsv.xz و به عنوان پارتیشن تهیه شده در https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_100m_obfuscated_v1.tar.xz.
|
||||
مجموعه داده ها شامل دو جدول است که هر کدام می توانند به عنوان یک فشرده دانلود شوند `tsv.xz` فایل و یا به عنوان پارتیشن تهیه شده است. علاوه بر این, یک نسخه طولانی از `hits` جدول حاوی 100 میلیون ردیف به عنوان تسو در دسترس است https://datasets.clickhouse.tech/hits/tsv/hits_100m_obfuscated_v1.tsv.xz و به عنوان پارتیشن تهیه شده در https://datasets.clickhouse.tech/hits/partitions/hits_100m_obfuscated_v1.tar.xz.
|
||||
|
||||
## اخذ جداول از پارتیشن های تهیه شده {#obtaining-tables-from-prepared-partitions}
|
||||
|
||||
دانلود و وارد کردن جدول بازدید:
|
||||
|
||||
``` bash
|
||||
curl -O https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_v1.tar
|
||||
curl -O https://datasets.clickhouse.tech/hits/partitions/hits_v1.tar
|
||||
tar xvf hits_v1.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
# check permissions on unpacked data, fix if required
|
||||
sudo service clickhouse-server restart
|
||||
@ -27,7 +27,7 @@ clickhouse-client --query "SELECT COUNT(*) FROM datasets.hits_v1"
|
||||
دانلود و وارد کردن بازدیدکننده داشته است:
|
||||
|
||||
``` bash
|
||||
curl -O https://clickhouse-datasets.s3.yandex.net/visits/partitions/visits_v1.tar
|
||||
curl -O https://datasets.clickhouse.tech/visits/partitions/visits_v1.tar
|
||||
tar xvf visits_v1.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
# check permissions on unpacked data, fix if required
|
||||
sudo service clickhouse-server restart
|
||||
@ -39,7 +39,7 @@ clickhouse-client --query "SELECT COUNT(*) FROM datasets.visits_v1"
|
||||
دانلود و وارد کردن بازدید از فایل تسو فشرده:
|
||||
|
||||
``` bash
|
||||
curl https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
# now create table
|
||||
clickhouse-client --query "CREATE DATABASE IF NOT EXISTS datasets"
|
||||
clickhouse-client --query "CREATE TABLE datasets.hits_v1 ( WatchID UInt64, JavaEnable UInt8, Title String, GoodEvent Int16, EventTime DateTime, EventDate Date, CounterID UInt32, ClientIP UInt32, ClientIP6 FixedString(16), RegionID UInt32, UserID UInt64, CounterClass Int8, OS UInt8, UserAgent UInt8, URL String, Referer String, URLDomain String, RefererDomain String, Refresh UInt8, IsRobot UInt8, RefererCategories Array(UInt16), URLCategories Array(UInt16), URLRegions Array(UInt32), RefererRegions Array(UInt32), ResolutionWidth UInt16, ResolutionHeight UInt16, ResolutionDepth UInt8, FlashMajor UInt8, FlashMinor UInt8, FlashMinor2 String, NetMajor UInt8, NetMinor UInt8, UserAgentMajor UInt16, UserAgentMinor FixedString(2), CookieEnable UInt8, JavascriptEnable UInt8, IsMobile UInt8, MobilePhone UInt8, MobilePhoneModel String, Params String, IPNetworkID UInt32, TraficSourceID Int8, SearchEngineID UInt16, SearchPhrase String, AdvEngineID UInt8, IsArtifical UInt8, WindowClientWidth UInt16, WindowClientHeight UInt16, ClientTimeZone Int16, ClientEventTime DateTime, SilverlightVersion1 UInt8, SilverlightVersion2 UInt8, SilverlightVersion3 UInt32, SilverlightVersion4 UInt16, PageCharset String, CodeVersion UInt32, IsLink UInt8, IsDownload UInt8, IsNotBounce UInt8, FUniqID UInt64, HID UInt32, IsOldCounter UInt8, IsEvent UInt8, IsParameter UInt8, DontCountHits UInt8, WithHash UInt8, HitColor FixedString(1), UTCEventTime DateTime, Age UInt8, Sex UInt8, Income UInt8, Interests UInt16, Robotness UInt8, GeneralInterests Array(UInt16), RemoteIP UInt32, RemoteIP6 FixedString(16), WindowName Int32, OpenerName Int32, HistoryLength Int16, BrowserLanguage FixedString(2), BrowserCountry FixedString(2), SocialNetwork String, SocialAction String, HTTPError UInt16, SendTiming Int32, DNSTiming Int32, ConnectTiming Int32, ResponseStartTiming Int32, ResponseEndTiming Int32, FetchTiming Int32, RedirectTiming Int32, DOMInteractiveTiming Int32, DOMContentLoadedTiming Int32, DOMCompleteTiming Int32, LoadEventStartTiming Int32, LoadEventEndTiming Int32, NSToDOMContentLoadedTiming Int32, FirstPaintTiming Int32, RedirectCount Int8, SocialSourceNetworkID UInt8, SocialSourcePage String, ParamPrice Int64, ParamOrderID String, ParamCurrency FixedString(3), ParamCurrencyID UInt16, GoalsReached Array(UInt32), OpenstatServiceName String, OpenstatCampaignID String, OpenstatAdID String, OpenstatSourceID String, UTMSource String, UTMMedium String, UTMCampaign String, UTMContent String, UTMTerm String, FromTag String, HasGCLID UInt8, RefererHash UInt64, URLHash UInt64, CLID UInt32, YCLID UInt64, ShareService String, ShareURL String, ShareTitle String, ParsedParams Nested(Key1 String, Key2 String, Key3 String, Key4 String, Key5 String, ValueDouble Float64), IslandID FixedString(16), RequestNum UInt32, RequestTry UInt8) ENGINE = MergeTree() PARTITION BY toYYYYMM(EventDate) ORDER BY (CounterID, EventDate, intHash32(UserID)) SAMPLE BY intHash32(UserID) SETTINGS index_granularity = 8192"
|
||||
@ -53,7 +53,7 @@ clickhouse-client --query "SELECT COUNT(*) FROM datasets.hits_v1"
|
||||
دانلود و واردات بازدیدکننده داشته است از فشرده فایل:
|
||||
|
||||
``` bash
|
||||
curl https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
# now create table
|
||||
clickhouse-client --query "CREATE DATABASE IF NOT EXISTS datasets"
|
||||
clickhouse-client --query "CREATE TABLE datasets.visits_v1 ( CounterID UInt32, StartDate Date, Sign Int8, IsNew UInt8, VisitID UInt64, UserID UInt64, StartTime DateTime, Duration UInt32, UTCStartTime DateTime, PageViews Int32, Hits Int32, IsBounce UInt8, Referer String, StartURL String, RefererDomain String, StartURLDomain String, EndURL String, LinkURL String, IsDownload UInt8, TraficSourceID Int8, SearchEngineID UInt16, SearchPhrase String, AdvEngineID UInt8, PlaceID Int32, RefererCategories Array(UInt16), URLCategories Array(UInt16), URLRegions Array(UInt32), RefererRegions Array(UInt32), IsYandex UInt8, GoalReachesDepth Int32, GoalReachesURL Int32, GoalReachesAny Int32, SocialSourceNetworkID UInt8, SocialSourcePage String, MobilePhoneModel String, ClientEventTime DateTime, RegionID UInt32, ClientIP UInt32, ClientIP6 FixedString(16), RemoteIP UInt32, RemoteIP6 FixedString(16), IPNetworkID UInt32, SilverlightVersion3 UInt32, CodeVersion UInt32, ResolutionWidth UInt16, ResolutionHeight UInt16, UserAgentMajor UInt16, UserAgentMinor UInt16, WindowClientWidth UInt16, WindowClientHeight UInt16, SilverlightVersion2 UInt8, SilverlightVersion4 UInt16, FlashVersion3 UInt16, FlashVersion4 UInt16, ClientTimeZone Int16, OS UInt8, UserAgent UInt8, ResolutionDepth UInt8, FlashMajor UInt8, FlashMinor UInt8, NetMajor UInt8, NetMinor UInt8, MobilePhone UInt8, SilverlightVersion1 UInt8, Age UInt8, Sex UInt8, Income UInt8, JavaEnable UInt8, CookieEnable UInt8, JavascriptEnable UInt8, IsMobile UInt8, BrowserLanguage UInt16, BrowserCountry UInt16, Interests UInt16, Robotness UInt8, GeneralInterests Array(UInt16), Params Array(String), Goals Nested(ID UInt32, Serial UInt32, EventTime DateTime, Price Int64, OrderID String, CurrencyID UInt32), WatchIDs Array(UInt64), ParamSumPrice Int64, ParamCurrency FixedString(3), ParamCurrencyID UInt16, ClickLogID UInt64, ClickEventID Int32, ClickGoodEvent Int32, ClickEventTime DateTime, ClickPriorityID Int32, ClickPhraseID Int32, ClickPageID Int32, ClickPlaceID Int32, ClickTypeID Int32, ClickResourceID Int32, ClickCost UInt32, ClickClientIP UInt32, ClickDomainID UInt32, ClickURL String, ClickAttempt UInt8, ClickOrderID UInt32, ClickBannerID UInt32, ClickMarketCategoryID UInt32, ClickMarketPP UInt32, ClickMarketCategoryName String, ClickMarketPPName String, ClickAWAPSCampaignName String, ClickPageName String, ClickTargetType UInt16, ClickTargetPhraseID UInt64, ClickContextType UInt8, ClickSelectType Int8, ClickOptions String, ClickGroupBannerID Int32, OpenstatServiceName String, OpenstatCampaignID String, OpenstatAdID String, OpenstatSourceID String, UTMSource String, UTMMedium String, UTMCampaign String, UTMContent String, UTMTerm String, FromTag String, HasGCLID UInt8, FirstVisit DateTime, PredLastVisit Date, LastVisit Date, TotalVisits UInt32, TraficSource Nested(ID Int8, SearchEngineID UInt16, AdvEngineID UInt8, PlaceID UInt16, SocialSourceNetworkID UInt8, Domain String, SearchPhrase String, SocialSourcePage String), Attendance FixedString(16), CLID UInt32, YCLID UInt64, NormalizedRefererHash UInt64, SearchPhraseHash UInt64, RefererDomainHash UInt64, NormalizedStartURLHash UInt64, StartURLDomainHash UInt64, NormalizedEndURLHash UInt64, TopLevelDomain UInt64, URLScheme UInt64, OpenstatServiceNameHash UInt64, OpenstatCampaignIDHash UInt64, OpenstatAdIDHash UInt64, OpenstatSourceIDHash UInt64, UTMSourceHash UInt64, UTMMediumHash UInt64, UTMCampaignHash UInt64, UTMContentHash UInt64, UTMTermHash UInt64, FromHash UInt64, WebVisorEnabled UInt8, WebVisorActivity UInt32, ParsedParams Nested(Key1 String, Key2 String, Key3 String, Key4 String, Key5 String, ValueDouble Float64), Market Nested(Type UInt8, GoalID UInt32, OrderID String, OrderPrice Int64, PP UInt32, DirectPlaceID UInt32, DirectOrderID UInt32, DirectBannerID UInt32, GoodID String, GoodName String, GoodQuantity Int32, GoodPrice Int64), IslandID FixedString(16)) ENGINE = CollapsingMergeTree(Sign) PARTITION BY toYYYYMM(StartDate) ORDER BY (CounterID, StartDate, intHash32(UserID), VisitID) SAMPLE BY intHash32(UserID) SETTINGS index_granularity = 8192"
|
||||
|
@ -286,7 +286,7 @@ SELECT formatReadableSize(sum(bytes)) FROM system.parts WHERE table = 'trips_mer
|
||||
## دانلود پارتیشن های تهیه شده {#download-of-prepared-partitions}
|
||||
|
||||
``` bash
|
||||
$ curl -O https://clickhouse-datasets.s3.yandex.net/trips_mergetree/partitions/trips_mergetree.tar
|
||||
$ curl -O https://datasets.clickhouse.tech/trips_mergetree/partitions/trips_mergetree.tar
|
||||
$ tar xvf trips_mergetree.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
$ # check permissions of unpacked data, fix if required
|
||||
$ sudo service clickhouse-server restart
|
||||
|
@ -156,7 +156,7 @@ $ for i in *.zip; do echo $i; unzip -cq $i '*.csv' | sed 's/\.00//g' | clickhous
|
||||
## دانلود پارتیشن های تهیه شده {#download-of-prepared-partitions}
|
||||
|
||||
``` bash
|
||||
$ curl -O https://clickhouse-datasets.s3.yandex.net/ontime/partitions/ontime.tar
|
||||
$ curl -O https://datasets.clickhouse.tech/ontime/partitions/ontime.tar
|
||||
$ tar xvf ontime.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
$ # check permissions of unpacked data, fix if required
|
||||
$ sudo service clickhouse-server restart
|
||||
|
@ -87,8 +87,8 @@ clickhouse-client --query='INSERT INTO table FORMAT TabSeparated' < data.tsv
|
||||
### دانلود و استخراج داده های جدول {#download-and-extract-table-data}
|
||||
|
||||
``` bash
|
||||
curl https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
```
|
||||
|
||||
فایل های استخراج شده حدود 10 گیگابایت است.
|
||||
|
@ -48,7 +48,7 @@ toc_title: "\u0633\u062E\u062A \u0627\u0641\u0632\u0627\u0631 \u062A\u0633\u062A
|
||||
|
||||
<!-- -->
|
||||
|
||||
wget https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_100m_obfuscated_v1.tar.xz
|
||||
wget https://datasets.clickhouse.tech/hits/partitions/hits_100m_obfuscated_v1.tar.xz
|
||||
tar xvf hits_100m_obfuscated_v1.tar.xz -C .
|
||||
mv hits_100m_obfuscated_v1/* .
|
||||
|
||||
|
@ -26,155 +26,155 @@ toc_title: "\u0633\u0627\u0632\u06AF\u0627\u0631\u06CC \u0627\u0646\u0633\u06CC"
|
||||
| Feature ID | نام ویژگی | وضعیت | توضیح |
|
||||
|------------|---------------------------------------------------------------------------------------------------|-------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| **E011** | **انواع داده های عددی** | **نسبی**{.text-warning} | |
|
||||
| E011-01 | عدد صحیح و SMALLINT انواع داده ها | بله{.text-success} | |
|
||||
| E011-02 | انواع داده های دقیق و دوگانه واقعی و شناور | نسبی{.text-warning} | `FLOAT(<binary_precision>)`, `REAL` و `DOUBLE PRECISION` پشتیبانی نمیشود |
|
||||
| E011-03 | دهدهی و انواع داده های عددی | نسبی{.text-warning} | فقط `DECIMAL(p,s)` پشتیبانی می شود, نه `NUMERIC` |
|
||||
| E011-04 | اپراتورهای ریاضی | بله{.text-success} | |
|
||||
| E011-05 | مقایسه عددی | بله{.text-success} | |
|
||||
| E011-06 | ریخته گری ضمنی در میان انواع داده های عددی | نه{.text-danger} | انسی گذاشتن اجازه می دهد تا بازیگران ضمنی دلخواه بین انواع عددی, در حالی که تاتر متکی بر توابع داشتن اضافه بار متعدد به جای بازیگران ضمنی |
|
||||
| E011-01 | عدد صحیح و SMALLINT انواع داده ها | بله {.text-success} | |
|
||||
| E011-02 | انواع داده های دقیق و دوگانه واقعی و شناور | نسبی {.text-warning} | `FLOAT(<binary_precision>)`, `REAL` و `DOUBLE PRECISION` پشتیبانی نمیشود |
|
||||
| E011-03 | دهدهی و انواع داده های عددی | نسبی {.text-warning} | فقط `DECIMAL(p,s)` پشتیبانی می شود, نه `NUMERIC` |
|
||||
| E011-04 | اپراتورهای ریاضی | بله {.text-success} | |
|
||||
| E011-05 | مقایسه عددی | بله {.text-success} | |
|
||||
| E011-06 | ریخته گری ضمنی در میان انواع داده های عددی | نه {.text-danger} | انسی گذاشتن اجازه می دهد تا بازیگران ضمنی دلخواه بین انواع عددی, در حالی که تاتر متکی بر توابع داشتن اضافه بار متعدد به جای بازیگران ضمنی |
|
||||
| **E021** | **انواع رشته شخصیت** | **نسبی**{.text-warning} | |
|
||||
| E021-01 | نوع دادههای نویسه | نه{.text-danger} | |
|
||||
| E021-02 | شخصیت های مختلف نوع داده ها | نه{.text-danger} | `String` رفتار مشابه, اما بدون محدودیت طول در پرانتز |
|
||||
| E021-03 | شخصیت literals | نسبی{.text-warning} | بدون الحاق خودکار از لیتر متوالی و شخصیت پشتیبانی مجموعه |
|
||||
| E021-04 | تابع _شخصی | نسبی{.text-warning} | نه `USING` بند |
|
||||
| E021-05 | تابع اکتبر | نه{.text-danger} | `LENGTH` رفتار مشابه |
|
||||
| E021-06 | SUBSTRING | نسبی{.text-warning} | هیچ پشتیبانی برای `SIMILAR` و `ESCAPE` بند نه `SUBSTRING_REGEX` گزینه |
|
||||
| E021-07 | الحاق شخصیت | نسبی{.text-warning} | نه `COLLATE` بند |
|
||||
| E021-08 | توابع بالا و پایین | بله{.text-success} | |
|
||||
| E021-09 | تابع اصلاح | بله{.text-success} | |
|
||||
| E021-10 | ریخته گری ضمنی در میان ثابت طول و متغیر طول انواع رشته شخصیت | نه{.text-danger} | انسی گذاشتن اجازه می دهد تا بازیگران ضمنی دلخواه بین انواع رشته, در حالی که تاتر متکی بر توابع داشتن اضافه بار متعدد به جای بازیگران ضمنی |
|
||||
| E021-11 | تابع موقعیت | نسبی{.text-warning} | هیچ پشتیبانی برای `IN` و `USING` بند نه `POSITION_REGEX` گزینه |
|
||||
| E021-12 | مقایسه شخصیت | بله{.text-success} | |
|
||||
| E021-01 | نوع دادههای نویسه | نه {.text-danger} | |
|
||||
| E021-02 | شخصیت های مختلف نوع داده ها | نه {.text-danger} | `String` رفتار مشابه, اما بدون محدودیت طول در پرانتز |
|
||||
| E021-03 | شخصیت literals | نسبی {.text-warning} | بدون الحاق خودکار از لیتر متوالی و شخصیت پشتیبانی مجموعه |
|
||||
| E021-04 | تابع _شخصی | نسبی {.text-warning} | نه `USING` بند |
|
||||
| E021-05 | تابع اکتبر | نه {.text-danger} | `LENGTH` رفتار مشابه |
|
||||
| E021-06 | SUBSTRING | نسبی {.text-warning} | هیچ پشتیبانی برای `SIMILAR` و `ESCAPE` بند نه `SUBSTRING_REGEX` گزینه |
|
||||
| E021-07 | الحاق شخصیت | نسبی {.text-warning} | نه `COLLATE` بند |
|
||||
| E021-08 | توابع بالا و پایین | بله {.text-success} | |
|
||||
| E021-09 | تابع اصلاح | بله {.text-success} | |
|
||||
| E021-10 | ریخته گری ضمنی در میان ثابت طول و متغیر طول انواع رشته شخصیت | نه {.text-danger} | انسی گذاشتن اجازه می دهد تا بازیگران ضمنی دلخواه بین انواع رشته, در حالی که تاتر متکی بر توابع داشتن اضافه بار متعدد به جای بازیگران ضمنی |
|
||||
| E021-11 | تابع موقعیت | نسبی {.text-warning} | هیچ پشتیبانی برای `IN` و `USING` بند نه `POSITION_REGEX` گزینه |
|
||||
| E021-12 | مقایسه شخصیت | بله {.text-success} | |
|
||||
| **E031** | **شناسهها** | **نسبی**{.text-warning} | |
|
||||
| E031-01 | شناسه های محدود | نسبی{.text-warning} | پشتیبانی تحت اللفظی یونیکد محدود است |
|
||||
| E031-02 | شناسه های مورد پایین | بله{.text-success} | |
|
||||
| E031-03 | انتهایی تاکید | بله{.text-success} | |
|
||||
| E031-01 | شناسه های محدود | نسبی {.text-warning} | پشتیبانی تحت اللفظی یونیکد محدود است |
|
||||
| E031-02 | شناسه های مورد پایین | بله {.text-success} | |
|
||||
| E031-03 | انتهایی تاکید | بله {.text-success} | |
|
||||
| **E051** | **مشخصات پرس و جو عمومی** | **نسبی**{.text-warning} | |
|
||||
| E051-01 | SELECT DISTINCT | بله{.text-success} | |
|
||||
| E051-02 | گروه بر اساس بند | بله{.text-success} | |
|
||||
| E051-04 | گروه توسط می تواند ستون ها را شامل نمی شود `<select list>` | بله{.text-success} | |
|
||||
| E051-05 | انتخاب موارد را می توان تغییر نام داد | بله{.text-success} | |
|
||||
| E051-06 | داشتن بند | بله{.text-success} | |
|
||||
| E051-07 | واجد شرایط \* در انتخاب لیست | بله{.text-success} | |
|
||||
| E051-08 | نام همبستگی در بند | بله{.text-success} | |
|
||||
| E051-09 | تغییر نام ستون ها در بند | نه{.text-danger} | |
|
||||
| E051-01 | SELECT DISTINCT | بله {.text-success} | |
|
||||
| E051-02 | گروه بر اساس بند | بله {.text-success} | |
|
||||
| E051-04 | گروه توسط می تواند ستون ها را شامل نمی شود `<select list>` | بله {.text-success} | |
|
||||
| E051-05 | انتخاب موارد را می توان تغییر نام داد | بله {.text-success} | |
|
||||
| E051-06 | داشتن بند | بله {.text-success} | |
|
||||
| E051-07 | واجد شرایط \* در انتخاب لیست | بله {.text-success} | |
|
||||
| E051-08 | نام همبستگی در بند | بله {.text-success} | |
|
||||
| E051-09 | تغییر نام ستون ها در بند | نه {.text-danger} | |
|
||||
| **E061** | **مخمصه عمومی و شرایط جستجو** | **نسبی**{.text-warning} | |
|
||||
| E061-01 | پیش فرض مقایسه | بله{.text-success} | |
|
||||
| E061-02 | بین پیش فرض | نسبی{.text-warning} | نه `SYMMETRIC` و `ASYMMETRIC` بند |
|
||||
| E061-03 | در گزاره با لیستی از ارزش ها | بله{.text-success} | |
|
||||
| E061-04 | مثل گزاره | بله{.text-success} | |
|
||||
| E061-05 | مانند گزاره: فرار بند | نه{.text-danger} | |
|
||||
| E061-06 | پیش فرض پوچ | بله{.text-success} | |
|
||||
| E061-07 | گزاره مقایسه کمی | نه{.text-danger} | |
|
||||
| E061-08 | پیش فرض وجود دارد | نه{.text-danger} | |
|
||||
| E061-09 | Subqueries در مقایسه گزاره | بله{.text-success} | |
|
||||
| E061-11 | در حال بارگذاری | بله{.text-success} | |
|
||||
| E061-12 | زیرمجموعه ها در پیش بینی مقایسه اندازه گیری شده | نه{.text-danger} | |
|
||||
| E061-13 | ارتباط subqueries | نه{.text-danger} | |
|
||||
| E061-14 | وضعیت جستجو | بله{.text-success} | |
|
||||
| E061-01 | پیش فرض مقایسه | بله {.text-success} | |
|
||||
| E061-02 | بین پیش فرض | نسبی {.text-warning} | نه `SYMMETRIC` و `ASYMMETRIC` بند |
|
||||
| E061-03 | در گزاره با لیستی از ارزش ها | بله {.text-success} | |
|
||||
| E061-04 | مثل گزاره | بله {.text-success} | |
|
||||
| E061-05 | مانند گزاره: فرار بند | نه {.text-danger} | |
|
||||
| E061-06 | پیش فرض پوچ | بله {.text-success} | |
|
||||
| E061-07 | گزاره مقایسه کمی | نه {.text-danger} | |
|
||||
| E061-08 | پیش فرض وجود دارد | نه {.text-danger} | |
|
||||
| E061-09 | Subqueries در مقایسه گزاره | بله {.text-success} | |
|
||||
| E061-11 | در حال بارگذاری | بله {.text-success} | |
|
||||
| E061-12 | زیرمجموعه ها در پیش بینی مقایسه اندازه گیری شده | نه {.text-danger} | |
|
||||
| E061-13 | ارتباط subqueries | نه {.text-danger} | |
|
||||
| E061-14 | وضعیت جستجو | بله {.text-success} | |
|
||||
| **E071** | **عبارتهای پرسوجو پایه** | **نسبی**{.text-warning} | |
|
||||
| E071-01 | اتحادیه اپراتور جدول مجزا | نه{.text-danger} | |
|
||||
| E071-02 | اتحادیه تمام اپراتور جدول | بله{.text-success} | |
|
||||
| E071-03 | به جز اپراتور جدول مجزا | نه{.text-danger} | |
|
||||
| E071-05 | ستون ترکیب از طریق اپراتورهای جدول نیاز دقیقا همان نوع داده ندارد | بله{.text-success} | |
|
||||
| E071-06 | اپراتورهای جدول در زیرمجموعه | بله{.text-success} | |
|
||||
| E071-01 | اتحادیه اپراتور جدول مجزا | نه {.text-danger} | |
|
||||
| E071-02 | اتحادیه تمام اپراتور جدول | بله {.text-success} | |
|
||||
| E071-03 | به جز اپراتور جدول مجزا | نه {.text-danger} | |
|
||||
| E071-05 | ستون ترکیب از طریق اپراتورهای جدول نیاز دقیقا همان نوع داده ندارد | بله {.text-success} | |
|
||||
| E071-06 | اپراتورهای جدول در زیرمجموعه | بله {.text-success} | |
|
||||
| **E081** | **امتیازات پایه** | **نسبی**{.text-warning} | کار در حال پیشرفت |
|
||||
| **E091** | **تنظیم توابع** | **بله**{.text-success} | |
|
||||
| E091-01 | AVG | بله{.text-success} | |
|
||||
| E091-02 | COUNT | بله{.text-success} | |
|
||||
| E091-03 | MAX | بله{.text-success} | |
|
||||
| E091-04 | MIN | بله{.text-success} | |
|
||||
| E091-05 | SUM | بله{.text-success} | |
|
||||
| E091-06 | همه کمی | نه{.text-danger} | |
|
||||
| E091-07 | کمی متمایز | نسبی{.text-warning} | همه توابع مجموع پشتیبانی |
|
||||
| E091-01 | AVG | بله {.text-success} | |
|
||||
| E091-02 | COUNT | بله {.text-success} | |
|
||||
| E091-03 | MAX | بله {.text-success} | |
|
||||
| E091-04 | MIN | بله {.text-success} | |
|
||||
| E091-05 | SUM | بله {.text-success} | |
|
||||
| E091-06 | همه کمی | نه {.text-danger} | |
|
||||
| E091-07 | کمی متمایز | نسبی {.text-warning} | همه توابع مجموع پشتیبانی |
|
||||
| **E101** | **دستکاری داده های پایه** | **نسبی**{.text-warning} | |
|
||||
| E101-01 | درج بیانیه | بله{.text-success} | توجه داشته باشید: کلید اصلی در خانه کلیک می کند به این معنی نیست `UNIQUE` محدودیت |
|
||||
| E101-03 | بیانیه به روز رسانی جستجو | نه{.text-danger} | یک `ALTER UPDATE` بیانیه ای برای اصلاح داده های دسته ای |
|
||||
| E101-04 | جستجو حذف بیانیه | نه{.text-danger} | یک `ALTER DELETE` بیانیه ای برای حذف داده های دسته ای |
|
||||
| E101-01 | درج بیانیه | بله {.text-success} | توجه داشته باشید: کلید اصلی در خانه کلیک می کند به این معنی نیست `UNIQUE` محدودیت |
|
||||
| E101-03 | بیانیه به روز رسانی جستجو | نه {.text-danger} | یک `ALTER UPDATE` بیانیه ای برای اصلاح داده های دسته ای |
|
||||
| E101-04 | جستجو حذف بیانیه | نه {.text-danger} | یک `ALTER DELETE` بیانیه ای برای حذف داده های دسته ای |
|
||||
| **E111** | **تک ردیف انتخاب بیانیه** | **نه**{.text-danger} | |
|
||||
| **E121** | **پشتیبانی عمومی مکان نما** | **نه**{.text-danger} | |
|
||||
| E121-01 | DECLARE CURSOR | نه{.text-danger} | |
|
||||
| E121-02 | سفارش ستون ها در لیست انتخاب نمی شود | نه{.text-danger} | |
|
||||
| E121-03 | عبارات ارزش به ترتیب توسط بند | نه{.text-danger} | |
|
||||
| E121-04 | بیانیه باز | نه{.text-danger} | |
|
||||
| E121-06 | بیانیه به روز رسانی موقعیت | نه{.text-danger} | |
|
||||
| E121-07 | موقعیت حذف بیانیه | نه{.text-danger} | |
|
||||
| E121-08 | بستن بیانیه | نه{.text-danger} | |
|
||||
| E121-10 | واکشی بیانیه: ضمنی بعدی | نه{.text-danger} | |
|
||||
| E121-17 | با نشانگر نگه دارید | نه{.text-danger} | |
|
||||
| E121-01 | DECLARE CURSOR | نه {.text-danger} | |
|
||||
| E121-02 | سفارش ستون ها در لیست انتخاب نمی شود | نه {.text-danger} | |
|
||||
| E121-03 | عبارات ارزش به ترتیب توسط بند | نه {.text-danger} | |
|
||||
| E121-04 | بیانیه باز | نه {.text-danger} | |
|
||||
| E121-06 | بیانیه به روز رسانی موقعیت | نه {.text-danger} | |
|
||||
| E121-07 | موقعیت حذف بیانیه | نه {.text-danger} | |
|
||||
| E121-08 | بستن بیانیه | نه {.text-danger} | |
|
||||
| E121-10 | واکشی بیانیه: ضمنی بعدی | نه {.text-danger} | |
|
||||
| E121-17 | با نشانگر نگه دارید | نه {.text-danger} | |
|
||||
| **E131** | **پشتیبانی ارزش صفر (صفر به جای ارزش)** | **نسبی**{.text-warning} | برخی از محدودیت ها اعمال می شود |
|
||||
| **E141** | **محدودیت یکپارچگی عمومی** | **نسبی**{.text-warning} | |
|
||||
| E141-01 | محدودیت NOT NULL | بله{.text-success} | یادداشت: `NOT NULL` برای ستون های جدول به طور پیش فرض ضمنی |
|
||||
| E141-02 | محدودیت منحصر به فرد از ستون تهی نیست | نه{.text-danger} | |
|
||||
| E141-03 | محدودیت های کلیدی اولیه | نه{.text-danger} | |
|
||||
| E141-04 | محدودیت کلید خارجی عمومی با هیچ پیش فرض اقدام برای هر دو عمل حذف ارجاعی و عمل به روز رسانی ارجاعی | نه{.text-danger} | |
|
||||
| E141-06 | بررسی محدودیت | بله{.text-success} | |
|
||||
| E141-07 | پیشفرض ستون | بله{.text-success} | |
|
||||
| E141-08 | تهی نیست استنباط در کلید اولیه | بله{.text-success} | |
|
||||
| E141-10 | نام در یک کلید خارجی را می توان در هر سفارش مشخص شده است | نه{.text-danger} | |
|
||||
| E141-01 | محدودیت NOT NULL | بله {.text-success} | یادداشت: `NOT NULL` برای ستون های جدول به طور پیش فرض ضمنی |
|
||||
| E141-02 | محدودیت منحصر به فرد از ستون تهی نیست | نه {.text-danger} | |
|
||||
| E141-03 | محدودیت های کلیدی اولیه | نه {.text-danger} | |
|
||||
| E141-04 | محدودیت کلید خارجی عمومی با هیچ پیش فرض اقدام برای هر دو عمل حذف ارجاعی و عمل به روز رسانی ارجاعی | نه {.text-danger} | |
|
||||
| E141-06 | بررسی محدودیت | بله {.text-success} | |
|
||||
| E141-07 | پیشفرض ستون | بله {.text-success} | |
|
||||
| E141-08 | تهی نیست استنباط در کلید اولیه | بله {.text-success} | |
|
||||
| E141-10 | نام در یک کلید خارجی را می توان در هر سفارش مشخص شده است | نه {.text-danger} | |
|
||||
| **E151** | **پشتیبانی تراکنش** | **نه**{.text-danger} | |
|
||||
| E151-01 | بیانیه متعهد | نه{.text-danger} | |
|
||||
| E151-02 | بیانیه عقبگرد | نه{.text-danger} | |
|
||||
| E151-01 | بیانیه متعهد | نه {.text-danger} | |
|
||||
| E151-02 | بیانیه عقبگرد | نه {.text-danger} | |
|
||||
| **E152** | **بیانیه معامله عمومی مجموعه** | **نه**{.text-danger} | |
|
||||
| E152-01 | مجموعه بیانیه معامله: جداسازی سطح SERIALIZABLE بند | نه{.text-danger} | |
|
||||
| E152-02 | تنظیم بیانیه معامله: فقط خواندن و خواندن نوشتن جملات | نه{.text-danger} | |
|
||||
| E152-01 | مجموعه بیانیه معامله: جداسازی سطح SERIALIZABLE بند | نه {.text-danger} | |
|
||||
| E152-02 | تنظیم بیانیه معامله: فقط خواندن و خواندن نوشتن جملات | نه {.text-danger} | |
|
||||
| **E153** | **نمایش داده شد بهروز با زیرمجموعه** | **نه**{.text-danger} | |
|
||||
| **E161** | **گذاشتن نظرات با استفاده از منجر منهای دو** | **بله**{.text-success} | |
|
||||
| **E171** | **SQLSTATE پشتیبانی** | **نه**{.text-danger} | |
|
||||
| **E182** | **اتصال زبان میزبان** | **نه**{.text-danger} | |
|
||||
| **F031** | **دستکاری طرح اولیه** | **نسبی**{.text-warning} | |
|
||||
| F031-01 | ایجاد بیانیه جدول برای ایجاد جداول پایه مداوم | نسبی{.text-warning} | نه `SYSTEM VERSIONING`, `ON COMMIT`, `GLOBAL`, `LOCAL`, `PRESERVE`, `DELETE`, `REF IS`, `WITH OPTIONS`, `UNDER`, `LIKE`, `PERIOD FOR` بند و هیچ پشتیبانی برای کاربر حل و فصل انواع داده ها |
|
||||
| F031-02 | ایجاد نمایش بیانیه | نسبی{.text-warning} | نه `RECURSIVE`, `CHECK`, `UNDER`, `WITH OPTIONS` بند و هیچ پشتیبانی برای کاربر حل و فصل انواع داده ها |
|
||||
| F031-03 | بیانیه گرانت | بله{.text-success} | |
|
||||
| F031-04 | تغییر بیانیه جدول: اضافه کردن بند ستون | نسبی{.text-warning} | هیچ پشتیبانی برای `GENERATED` بند و مدت زمان سیستم |
|
||||
| F031-13 | بیانیه جدول قطره: محدود کردن بند | نه{.text-danger} | |
|
||||
| F031-16 | قطره مشاهده بیانیه: محدود بند | نه{.text-danger} | |
|
||||
| F031-19 | لغو بیانیه: محدود کردن بند | نه{.text-danger} | |
|
||||
| F031-01 | ایجاد بیانیه جدول برای ایجاد جداول پایه مداوم | نسبی {.text-warning} | نه `SYSTEM VERSIONING`, `ON COMMIT`, `GLOBAL`, `LOCAL`, `PRESERVE`, `DELETE`, `REF IS`, `WITH OPTIONS`, `UNDER`, `LIKE`, `PERIOD FOR` بند و هیچ پشتیبانی برای کاربر حل و فصل انواع داده ها |
|
||||
| F031-02 | ایجاد نمایش بیانیه | نسبی {.text-warning} | نه `RECURSIVE`, `CHECK`, `UNDER`, `WITH OPTIONS` بند و هیچ پشتیبانی برای کاربر حل و فصل انواع داده ها |
|
||||
| F031-03 | بیانیه گرانت | بله {.text-success} | |
|
||||
| F031-04 | تغییر بیانیه جدول: اضافه کردن بند ستون | نسبی {.text-warning} | هیچ پشتیبانی برای `GENERATED` بند و مدت زمان سیستم |
|
||||
| F031-13 | بیانیه جدول قطره: محدود کردن بند | نه {.text-danger} | |
|
||||
| F031-16 | قطره مشاهده بیانیه: محدود بند | نه {.text-danger} | |
|
||||
| F031-19 | لغو بیانیه: محدود کردن بند | نه {.text-danger} | |
|
||||
| **F041** | **جدول پیوست عمومی** | **نسبی**{.text-warning} | |
|
||||
| F041-01 | عضویت داخلی (اما نه لزوما کلمه کلیدی درونی) | بله{.text-success} | |
|
||||
| F041-02 | کلیدواژه داخلی | بله{.text-success} | |
|
||||
| F041-03 | LEFT OUTER JOIN | بله{.text-success} | |
|
||||
| F041-04 | RIGHT OUTER JOIN | بله{.text-success} | |
|
||||
| F041-05 | بیرونی می پیوندد می توان تو در تو | بله{.text-success} | |
|
||||
| F041-07 | جدول درونی در بیرونی چپ یا راست عضویت نیز می تواند مورد استفاده قرار گیرد در عضویت درونی | بله{.text-success} | |
|
||||
| F041-08 | همه اپراتورهای مقایسه پشتیبانی می شوند (و نه فقط =) | نه{.text-danger} | |
|
||||
| **F051** | **تاریخ پایه و زمان** | **نسبی**{.text-warning} | |
|
||||
| F051-01 | تاریخ نوع داده (از جمله پشتیبانی از تاریخ تحت اللفظی) | نسبی{.text-warning} | بدون تحت اللفظی |
|
||||
| F051-02 | نوع داده زمان (از جمله پشتیبانی از زمان تحت اللفظی) با دقت ثانیه کسری حداقل 0 | نه{.text-danger} | |
|
||||
| F051-03 | نوع داده برچسب زمان (از جمله پشتیبانی از تحت اللفظی برچسب زمان) با دقت ثانیه کسری از حداقل 0 و 6 | نه{.text-danger} | `DateTime64` زمان فراهم می کند قابلیت های مشابه |
|
||||
| F051-04 | مقایسه گزاره در تاریخ, زمان, و انواع داده های برچسب زمان | نسبی{.text-warning} | فقط یک نوع داده موجود است |
|
||||
| F051-05 | بازیگران صریح و روشن بین انواع تاریخ ساعت و انواع رشته شخصیت | بله{.text-success} | |
|
||||
| F051-06 | CURRENT_DATE | نه{.text-danger} | `today()` مشابه است |
|
||||
| F051-07 | LOCALTIME | نه{.text-danger} | `now()` مشابه است |
|
||||
| F051-08 | LOCALTIMESTAMP | نه{.text-danger} | |
|
||||
| F041-01 | عضویت داخلی (اما نه لزوما کلمه کلیدی درونی) | بله {.text-success} | |
|
||||
| F041-02 | کلیدواژه داخلی | بله {.text-success} | |
|
||||
| F041-03 | LEFT OUTER JOIN | بله {.text-success} | |
|
||||
| F041-04 | RIGHT OUTER JOIN | بله {.text-success} | |
|
||||
| F041-05 | بیرونی می پیوندد می توان تو در تو | بله {.text-success} | |
|
||||
| F041-07 | جدول درونی در بیرونی چپ یا راست عضویت نیز می تواند مورد استفاده قرار گیرد در عضویت درونی | بله {.text-success} | |
|
||||
| F041-08 | همه اپراتورهای مقایسه پشتیبانی می شوند (و نه فقط =) | نه {.text-danger} | |
|
||||
| **F051** | **تاریخ پایه و زمان** | **نسبی** {.text-warning} | |
|
||||
| F051-01 | تاریخ نوع داده (از جمله پشتیبانی از تاریخ تحت اللفظی) | نسبی {.text-warning} | بدون تحت اللفظی |
|
||||
| F051-02 | نوع داده زمان (از جمله پشتیبانی از زمان تحت اللفظی) با دقت ثانیه کسری حداقل 0 | نه {.text-danger} | |
|
||||
| F051-03 | نوع داده برچسب زمان (از جمله پشتیبانی از تحت اللفظی برچسب زمان) با دقت ثانیه کسری از حداقل 0 و 6 | نه {.text-danger} | `DateTime64` زمان فراهم می کند قابلیت های مشابه |
|
||||
| F051-04 | مقایسه گزاره در تاریخ, زمان, و انواع داده های برچسب زمان | نسبی {.text-warning} | فقط یک نوع داده موجود است |
|
||||
| F051-05 | بازیگران صریح و روشن بین انواع تاریخ ساعت و انواع رشته شخصیت | بله {.text-success} | |
|
||||
| F051-06 | CURRENT_DATE | نه {.text-danger} | `today()` مشابه است |
|
||||
| F051-07 | LOCALTIME | نه {.text-danger} | `now()` مشابه است |
|
||||
| F051-08 | LOCALTIMESTAMP | نه {.text-danger} | |
|
||||
| **F081** | **اتحادیه و به جز در دیدگاه** | **نسبی**{.text-warning} | |
|
||||
| **F131** | **عملیات گروه بندی شده** | **نسبی**{.text-warning} | |
|
||||
| F131-01 | جایی که, گروه های, و داشتن بند در نمایش داده شد با نمایش گروه بندی پشتیبانی | بله{.text-success} | |
|
||||
| F131-02 | جداول چندگانه در نمایش داده شد با نمایش گروه بندی پشتیبانی می شود | بله{.text-success} | |
|
||||
| F131-03 | تنظیم توابع پشتیبانی شده در نمایش داده شد با نمایش گروه بندی می شوند | بله{.text-success} | |
|
||||
| F131-04 | Subqueries با گروه و داشتن بند و گروه بندی views | بله{.text-success} | |
|
||||
| F131-05 | تک ردیف با گروه و داشتن بند و دیدگاه های گروه بندی شده را انتخاب کنید | نه{.text-danger} | |
|
||||
| F131-01 | جایی که, گروه های, و داشتن بند در نمایش داده شد با نمایش گروه بندی پشتیبانی | بله {.text-success} | |
|
||||
| F131-02 | جداول چندگانه در نمایش داده شد با نمایش گروه بندی پشتیبانی می شود | بله {.text-success} | |
|
||||
| F131-03 | تنظیم توابع پشتیبانی شده در نمایش داده شد با نمایش گروه بندی می شوند | بله {.text-success} | |
|
||||
| F131-04 | Subqueries با گروه و داشتن بند و گروه بندی views | بله {.text-success} | |
|
||||
| F131-05 | تک ردیف با گروه و داشتن بند و دیدگاه های گروه بندی شده را انتخاب کنید | نه {.text-danger} | |
|
||||
| **F181** | **پشتیبانی از ماژول های متعدد** | **نه**{.text-danger} | |
|
||||
| **F201** | **تابع بازیگران** | **بله**{.text-success} | |
|
||||
| **F221** | **پیش فرض های صریح** | **نه**{.text-danger} | |
|
||||
| **F261** | **عبارت مورد** | **بله**{.text-success} | |
|
||||
| F261-01 | مورد ساده | بله{.text-success} | |
|
||||
| F261-02 | مورد جستجو | بله{.text-success} | |
|
||||
| F261-03 | NULLIF | بله{.text-success} | |
|
||||
| F261-04 | COALESCE | بله{.text-success} | |
|
||||
| F261-01 | مورد ساده | بله {.text-success} | |
|
||||
| F261-02 | مورد جستجو | بله {.text-success} | |
|
||||
| F261-03 | NULLIF | بله {.text-success} | |
|
||||
| F261-04 | COALESCE | بله {.text-success} | |
|
||||
| **F311** | **بیانیه تعریف طرح** | **نسبی**{.text-warning} | |
|
||||
| F311-01 | CREATE SCHEMA | نه{.text-danger} | |
|
||||
| F311-02 | ایجاد جدول برای جداول پایه مداوم | بله{.text-success} | |
|
||||
| F311-03 | CREATE VIEW | بله{.text-success} | |
|
||||
| F311-04 | CREATE VIEW: WITH CHECK OPTION | نه{.text-danger} | |
|
||||
| F311-05 | بیانیه گرانت | بله{.text-success} | |
|
||||
| F311-01 | CREATE SCHEMA | نه {.text-danger} | |
|
||||
| F311-02 | ایجاد جدول برای جداول پایه مداوم | بله {.text-success} | |
|
||||
| F311-03 | CREATE VIEW | بله {.text-success} | |
|
||||
| F311-04 | CREATE VIEW: WITH CHECK OPTION | نه {.text-danger} | |
|
||||
| F311-05 | بیانیه گرانت | بله {.text-success} | |
|
||||
| **F471** | **مقادیر زیر مقیاس** | **بله**{.text-success} | |
|
||||
| **F481** | **پیش فرض صفر گسترش یافته است** | **بله**{.text-success} | |
|
||||
| **F812** | **عمومی ضعیف** | **نه**{.text-danger} | |
|
||||
| **T321** | **روال عمومی گذاشتن استناد** | **نه**{.text-danger} | |
|
||||
| T321-01 | توابع تعریف شده توسط کاربر بدون اضافه بار | نه{.text-danger} | |
|
||||
| T321-02 | روش های ذخیره شده تعریف شده توسط کاربر بدون اضافه بار | نه{.text-danger} | |
|
||||
| T321-03 | فراخوانی تابع | نه{.text-danger} | |
|
||||
| T321-04 | بیانیه تماس | نه{.text-danger} | |
|
||||
| T321-05 | بیانیه بازگشت | نه{.text-danger} | |
|
||||
| T321-01 | توابع تعریف شده توسط کاربر بدون اضافه بار | نه {.text-danger} | |
|
||||
| T321-02 | روش های ذخیره شده تعریف شده توسط کاربر بدون اضافه بار | نه {.text-danger} | |
|
||||
| T321-03 | فراخوانی تابع | نه {.text-danger} | |
|
||||
| T321-04 | بیانیه تماس | نه {.text-danger} | |
|
||||
| T321-05 | بیانیه بازگشت | نه {.text-danger} | |
|
||||
| **T631** | **در گزاره با یک عنصر لیست** | **بله**{.text-success} | |
|
||||
|
@ -257,8 +257,8 @@ Le développement de ClickHouse nécessite souvent le chargement d'ensembles de
|
||||
|
||||
sudo apt install wget xz-utils
|
||||
|
||||
wget https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz
|
||||
wget https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz
|
||||
wget https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz
|
||||
wget https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz
|
||||
|
||||
xz -v -d hits_v1.tsv.xz
|
||||
xz -v -d visits_v1.tsv.xz
|
||||
|
@ -579,7 +579,7 @@ Si une fonction capture la propriété d'un objet créé dans le tas, définisse
|
||||
|
||||
**14.** Les valeurs de retour.
|
||||
|
||||
Dans la plupart des cas, il suffit d'utiliser `return`. Ne pas écrire `[return std::move(res)]{.strike}`.
|
||||
Dans la plupart des cas, il suffit d'utiliser `return`. Ne pas écrire `return std::move(res)`.
|
||||
|
||||
Si la fonction alloue un objet sur le tas et le renvoie, utilisez `shared_ptr` ou `unique_ptr`.
|
||||
|
||||
@ -673,7 +673,7 @@ Toujours utiliser `#pragma once` au lieu d'inclure des gardes.
|
||||
**24.** Ne pas utiliser de `trailing return type` pour les fonctions, sauf si nécessaire.
|
||||
|
||||
``` cpp
|
||||
[auto f() -> void;]{.strike}
|
||||
auto f() -> void
|
||||
```
|
||||
|
||||
**25.** Déclaration et initialisation des variables.
|
||||
|
@ -9,14 +9,14 @@ toc_title: "Yandex.Metrica De Donn\xE9es"
|
||||
|
||||
Dataset se compose de deux tables contenant des données anonymisées sur les hits (`hits_v1`) et les visites (`visits_v1`) de Yandex.Metrica. Vous pouvez en savoir plus sur Yandex.Metrica dans [Histoire de ClickHouse](../../introduction/history.md) section.
|
||||
|
||||
L'ensemble de données se compose de deux tables, l'une d'elles peut être téléchargée sous forme compressée `tsv.xz` fichier ou comme partitions préparées. En outre, une version étendue de l' `hits` table contenant 100 millions de lignes est disponible comme TSV à https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_100m_obfuscated_v1.tsv.xz et comme partitions préparées à https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_100m_obfuscated_v1.tar.xz.
|
||||
L'ensemble de données se compose de deux tables, l'une d'elles peut être téléchargée sous forme compressée `tsv.xz` fichier ou comme partitions préparées. En outre, une version étendue de l' `hits` table contenant 100 millions de lignes est disponible comme TSV à https://datasets.clickhouse.tech/hits/tsv/hits_100m_obfuscated_v1.tsv.xz et comme partitions préparées à https://datasets.clickhouse.tech/hits/partitions/hits_100m_obfuscated_v1.tar.xz.
|
||||
|
||||
## Obtention de Tables à partir de Partitions préparées {#obtaining-tables-from-prepared-partitions}
|
||||
|
||||
Télécharger et importer la table hits:
|
||||
|
||||
``` bash
|
||||
curl -O https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_v1.tar
|
||||
curl -O https://datasets.clickhouse.tech/hits/partitions/hits_v1.tar
|
||||
tar xvf hits_v1.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
# check permissions on unpacked data, fix if required
|
||||
sudo service clickhouse-server restart
|
||||
@ -26,7 +26,7 @@ clickhouse-client --query "SELECT COUNT(*) FROM datasets.hits_v1"
|
||||
Télécharger et importer des visites:
|
||||
|
||||
``` bash
|
||||
curl -O https://clickhouse-datasets.s3.yandex.net/visits/partitions/visits_v1.tar
|
||||
curl -O https://datasets.clickhouse.tech/visits/partitions/visits_v1.tar
|
||||
tar xvf visits_v1.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
# check permissions on unpacked data, fix if required
|
||||
sudo service clickhouse-server restart
|
||||
@ -38,7 +38,7 @@ clickhouse-client --query "SELECT COUNT(*) FROM datasets.visits_v1"
|
||||
Télécharger et importer des hits à partir du fichier TSV compressé:
|
||||
|
||||
``` bash
|
||||
curl https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
# now create table
|
||||
clickhouse-client --query "CREATE DATABASE IF NOT EXISTS datasets"
|
||||
clickhouse-client --query "CREATE TABLE datasets.hits_v1 ( WatchID UInt64, JavaEnable UInt8, Title String, GoodEvent Int16, EventTime DateTime, EventDate Date, CounterID UInt32, ClientIP UInt32, ClientIP6 FixedString(16), RegionID UInt32, UserID UInt64, CounterClass Int8, OS UInt8, UserAgent UInt8, URL String, Referer String, URLDomain String, RefererDomain String, Refresh UInt8, IsRobot UInt8, RefererCategories Array(UInt16), URLCategories Array(UInt16), URLRegions Array(UInt32), RefererRegions Array(UInt32), ResolutionWidth UInt16, ResolutionHeight UInt16, ResolutionDepth UInt8, FlashMajor UInt8, FlashMinor UInt8, FlashMinor2 String, NetMajor UInt8, NetMinor UInt8, UserAgentMajor UInt16, UserAgentMinor FixedString(2), CookieEnable UInt8, JavascriptEnable UInt8, IsMobile UInt8, MobilePhone UInt8, MobilePhoneModel String, Params String, IPNetworkID UInt32, TraficSourceID Int8, SearchEngineID UInt16, SearchPhrase String, AdvEngineID UInt8, IsArtifical UInt8, WindowClientWidth UInt16, WindowClientHeight UInt16, ClientTimeZone Int16, ClientEventTime DateTime, SilverlightVersion1 UInt8, SilverlightVersion2 UInt8, SilverlightVersion3 UInt32, SilverlightVersion4 UInt16, PageCharset String, CodeVersion UInt32, IsLink UInt8, IsDownload UInt8, IsNotBounce UInt8, FUniqID UInt64, HID UInt32, IsOldCounter UInt8, IsEvent UInt8, IsParameter UInt8, DontCountHits UInt8, WithHash UInt8, HitColor FixedString(1), UTCEventTime DateTime, Age UInt8, Sex UInt8, Income UInt8, Interests UInt16, Robotness UInt8, GeneralInterests Array(UInt16), RemoteIP UInt32, RemoteIP6 FixedString(16), WindowName Int32, OpenerName Int32, HistoryLength Int16, BrowserLanguage FixedString(2), BrowserCountry FixedString(2), SocialNetwork String, SocialAction String, HTTPError UInt16, SendTiming Int32, DNSTiming Int32, ConnectTiming Int32, ResponseStartTiming Int32, ResponseEndTiming Int32, FetchTiming Int32, RedirectTiming Int32, DOMInteractiveTiming Int32, DOMContentLoadedTiming Int32, DOMCompleteTiming Int32, LoadEventStartTiming Int32, LoadEventEndTiming Int32, NSToDOMContentLoadedTiming Int32, FirstPaintTiming Int32, RedirectCount Int8, SocialSourceNetworkID UInt8, SocialSourcePage String, ParamPrice Int64, ParamOrderID String, ParamCurrency FixedString(3), ParamCurrencyID UInt16, GoalsReached Array(UInt32), OpenstatServiceName String, OpenstatCampaignID String, OpenstatAdID String, OpenstatSourceID String, UTMSource String, UTMMedium String, UTMCampaign String, UTMContent String, UTMTerm String, FromTag String, HasGCLID UInt8, RefererHash UInt64, URLHash UInt64, CLID UInt32, YCLID UInt64, ShareService String, ShareURL String, ShareTitle String, ParsedParams Nested(Key1 String, Key2 String, Key3 String, Key4 String, Key5 String, ValueDouble Float64), IslandID FixedString(16), RequestNum UInt32, RequestTry UInt8) ENGINE = MergeTree() PARTITION BY toYYYYMM(EventDate) ORDER BY (CounterID, EventDate, intHash32(UserID)) SAMPLE BY intHash32(UserID) SETTINGS index_granularity = 8192"
|
||||
@ -52,7 +52,7 @@ clickhouse-client --query "SELECT COUNT(*) FROM datasets.hits_v1"
|
||||
Télécharger et importer des visites à partir du fichier TSV compressé:
|
||||
|
||||
``` bash
|
||||
curl https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
# now create table
|
||||
clickhouse-client --query "CREATE DATABASE IF NOT EXISTS datasets"
|
||||
clickhouse-client --query "CREATE TABLE datasets.visits_v1 ( CounterID UInt32, StartDate Date, Sign Int8, IsNew UInt8, VisitID UInt64, UserID UInt64, StartTime DateTime, Duration UInt32, UTCStartTime DateTime, PageViews Int32, Hits Int32, IsBounce UInt8, Referer String, StartURL String, RefererDomain String, StartURLDomain String, EndURL String, LinkURL String, IsDownload UInt8, TraficSourceID Int8, SearchEngineID UInt16, SearchPhrase String, AdvEngineID UInt8, PlaceID Int32, RefererCategories Array(UInt16), URLCategories Array(UInt16), URLRegions Array(UInt32), RefererRegions Array(UInt32), IsYandex UInt8, GoalReachesDepth Int32, GoalReachesURL Int32, GoalReachesAny Int32, SocialSourceNetworkID UInt8, SocialSourcePage String, MobilePhoneModel String, ClientEventTime DateTime, RegionID UInt32, ClientIP UInt32, ClientIP6 FixedString(16), RemoteIP UInt32, RemoteIP6 FixedString(16), IPNetworkID UInt32, SilverlightVersion3 UInt32, CodeVersion UInt32, ResolutionWidth UInt16, ResolutionHeight UInt16, UserAgentMajor UInt16, UserAgentMinor UInt16, WindowClientWidth UInt16, WindowClientHeight UInt16, SilverlightVersion2 UInt8, SilverlightVersion4 UInt16, FlashVersion3 UInt16, FlashVersion4 UInt16, ClientTimeZone Int16, OS UInt8, UserAgent UInt8, ResolutionDepth UInt8, FlashMajor UInt8, FlashMinor UInt8, NetMajor UInt8, NetMinor UInt8, MobilePhone UInt8, SilverlightVersion1 UInt8, Age UInt8, Sex UInt8, Income UInt8, JavaEnable UInt8, CookieEnable UInt8, JavascriptEnable UInt8, IsMobile UInt8, BrowserLanguage UInt16, BrowserCountry UInt16, Interests UInt16, Robotness UInt8, GeneralInterests Array(UInt16), Params Array(String), Goals Nested(ID UInt32, Serial UInt32, EventTime DateTime, Price Int64, OrderID String, CurrencyID UInt32), WatchIDs Array(UInt64), ParamSumPrice Int64, ParamCurrency FixedString(3), ParamCurrencyID UInt16, ClickLogID UInt64, ClickEventID Int32, ClickGoodEvent Int32, ClickEventTime DateTime, ClickPriorityID Int32, ClickPhraseID Int32, ClickPageID Int32, ClickPlaceID Int32, ClickTypeID Int32, ClickResourceID Int32, ClickCost UInt32, ClickClientIP UInt32, ClickDomainID UInt32, ClickURL String, ClickAttempt UInt8, ClickOrderID UInt32, ClickBannerID UInt32, ClickMarketCategoryID UInt32, ClickMarketPP UInt32, ClickMarketCategoryName String, ClickMarketPPName String, ClickAWAPSCampaignName String, ClickPageName String, ClickTargetType UInt16, ClickTargetPhraseID UInt64, ClickContextType UInt8, ClickSelectType Int8, ClickOptions String, ClickGroupBannerID Int32, OpenstatServiceName String, OpenstatCampaignID String, OpenstatAdID String, OpenstatSourceID String, UTMSource String, UTMMedium String, UTMCampaign String, UTMContent String, UTMTerm String, FromTag String, HasGCLID UInt8, FirstVisit DateTime, PredLastVisit Date, LastVisit Date, TotalVisits UInt32, TraficSource Nested(ID Int8, SearchEngineID UInt16, AdvEngineID UInt8, PlaceID UInt16, SocialSourceNetworkID UInt8, Domain String, SearchPhrase String, SocialSourcePage String), Attendance FixedString(16), CLID UInt32, YCLID UInt64, NormalizedRefererHash UInt64, SearchPhraseHash UInt64, RefererDomainHash UInt64, NormalizedStartURLHash UInt64, StartURLDomainHash UInt64, NormalizedEndURLHash UInt64, TopLevelDomain UInt64, URLScheme UInt64, OpenstatServiceNameHash UInt64, OpenstatCampaignIDHash UInt64, OpenstatAdIDHash UInt64, OpenstatSourceIDHash UInt64, UTMSourceHash UInt64, UTMMediumHash UInt64, UTMCampaignHash UInt64, UTMContentHash UInt64, UTMTermHash UInt64, FromHash UInt64, WebVisorEnabled UInt8, WebVisorActivity UInt32, ParsedParams Nested(Key1 String, Key2 String, Key3 String, Key4 String, Key5 String, ValueDouble Float64), Market Nested(Type UInt8, GoalID UInt32, OrderID String, OrderPrice Int64, PP UInt32, DirectPlaceID UInt32, DirectOrderID UInt32, DirectBannerID UInt32, GoodID String, GoodName String, GoodQuantity Int32, GoodPrice Int64), IslandID FixedString(16)) ENGINE = CollapsingMergeTree(Sign) PARTITION BY toYYYYMM(StartDate) ORDER BY (CounterID, StartDate, intHash32(UserID), VisitID) SAMPLE BY intHash32(UserID) SETTINGS index_granularity = 8192"
|
||||
|
@ -285,7 +285,7 @@ Entre autres choses, vous pouvez exécuter la requête OPTIMIZE sur MergeTree. M
|
||||
## Téléchargement des Partitions préparées {#download-of-prepared-partitions}
|
||||
|
||||
``` bash
|
||||
$ curl -O https://clickhouse-datasets.s3.yandex.net/trips_mergetree/partitions/trips_mergetree.tar
|
||||
$ curl -O https://datasets.clickhouse.tech/trips_mergetree/partitions/trips_mergetree.tar
|
||||
$ tar xvf trips_mergetree.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
$ # check permissions of unpacked data, fix if required
|
||||
$ sudo service clickhouse-server restart
|
||||
|
@ -156,7 +156,7 @@ $ for i in *.zip; do echo $i; unzip -cq $i '*.csv' | sed 's/\.00//g' | clickhous
|
||||
## Téléchargement des Partitions préparées {#download-of-prepared-partitions}
|
||||
|
||||
``` bash
|
||||
$ curl -O https://clickhouse-datasets.s3.yandex.net/ontime/partitions/ontime.tar
|
||||
$ curl -O https://datasets.clickhouse.tech/ontime/partitions/ontime.tar
|
||||
$ tar xvf ontime.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
$ # check permissions of unpacked data, fix if required
|
||||
$ sudo service clickhouse-server restart
|
||||
|
@ -87,8 +87,8 @@ Maintenant, il est temps de remplir notre serveur ClickHouse avec quelques exemp
|
||||
### Télécharger et extraire les données de la Table {#download-and-extract-table-data}
|
||||
|
||||
``` bash
|
||||
curl https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
```
|
||||
|
||||
Les fichiers extraits ont une taille d'environ 10 Go.
|
||||
|
@ -48,7 +48,7 @@ Avec cette instruction, vous pouvez exécuter le test de performance clickhouse
|
||||
|
||||
<!-- -->
|
||||
|
||||
wget https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_100m_obfuscated_v1.tar.xz
|
||||
wget https://datasets.clickhouse.tech/hits/partitions/hits_100m_obfuscated_v1.tar.xz
|
||||
tar xvf hits_100m_obfuscated_v1.tar.xz -C .
|
||||
mv hits_100m_obfuscated_v1/* .
|
||||
|
||||
|
@ -26,155 +26,155 @@ Le tableau suivant répertorie les cas où la fonctionnalité de requête foncti
|
||||
| Feature ID | Nom De La Fonctionnalité | Statut | Commentaire |
|
||||
|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| **E011** | **Types de données numériques** | **Partiel**{.text-warning} | |
|
||||
| E011-01 | Types de données INTEGER et SMALLINT | Oui{.text-success} | |
|
||||
| E011-02 | Types de données réel, double précision et flottant types de données | Partiel{.text-warning} | `FLOAT(<binary_precision>)`, `REAL` et `DOUBLE PRECISION` ne sont pas pris en charge |
|
||||
| E011-03 | Types de données décimales et numériques | Partiel{.text-warning} | Seulement `DECIMAL(p,s)` est pris en charge, pas `NUMERIC` |
|
||||
| E011-04 | Opérateurs arithmétiques | Oui{.text-success} | |
|
||||
| E011-05 | Comparaison numérique | Oui{.text-success} | |
|
||||
| E011-06 | Casting implicite parmi les types de données numériques | Aucun{.text-danger} | ANSI SQL permet la distribution implicite arbitraire entre les types numériques, tandis que ClickHouse repose sur des fonctions ayant plusieurs surcharges au lieu de la distribution implicite |
|
||||
| E011-01 | Types de données INTEGER et SMALLINT | Oui {.text-success} | |
|
||||
| E011-02 | Types de données réel, double précision et flottant types de données | Partiel {.text-warning} | `FLOAT(<binary_precision>)`, `REAL` et `DOUBLE PRECISION` ne sont pas pris en charge |
|
||||
| E011-03 | Types de données décimales et numériques | Partiel {.text-warning} | Seulement `DECIMAL(p,s)` est pris en charge, pas `NUMERIC` |
|
||||
| E011-04 | Opérateurs arithmétiques | Oui {.text-success} | |
|
||||
| E011-05 | Comparaison numérique | Oui {.text-success} | |
|
||||
| E011-06 | Casting implicite parmi les types de données numériques | Aucun {.text-danger} | ANSI SQL permet la distribution implicite arbitraire entre les types numériques, tandis que ClickHouse repose sur des fonctions ayant plusieurs surcharges au lieu de la distribution implicite |
|
||||
| **E021** | **Types de chaînes de caractères** | **Partiel**{.text-warning} | |
|
||||
| E021-01 | Type de données CARACTÈRE | Aucun{.text-danger} | |
|
||||
| E021-02 | TYPE DE DONNÉES variable de caractère | Aucun{.text-danger} | `String` se comporte de la même manière, mais sans limite de longueur entre parenthèses |
|
||||
| E021-03 | Littéraux de caractères | Partiel{.text-warning} | Aucune concaténation automatique de littéraux consécutifs et prise en charge du jeu de caractères |
|
||||
| E021-04 | Fonction CHARACTER_LENGTH | Partiel{.text-warning} | Aucun `USING` clause |
|
||||
| E021-05 | Fonction OCTET_LENGTH | Aucun{.text-danger} | `LENGTH` se comporte de la même façon |
|
||||
| E021-06 | SUBSTRING | Partiel{.text-warning} | Pas de support pour `SIMILAR` et `ESCAPE` clauses, pas de `SUBSTRING_REGEX` variante |
|
||||
| E021-07 | Concaténation de caractères | Partiel{.text-warning} | Aucun `COLLATE` clause |
|
||||
| E021-08 | Fonctions supérieures et inférieures | Oui{.text-success} | |
|
||||
| E021-09 | La fonction TRIM | Oui{.text-success} | |
|
||||
| E021-10 | Conversion implicite entre les types de chaînes de caractères de longueur fixe et de longueur variable | Aucun{.text-danger} | ANSI SQL permet la distribution implicite arbitraire entre les types de chaîne, tandis que ClickHouse repose sur des fonctions ayant plusieurs surcharges au lieu de la distribution implicite |
|
||||
| E021-11 | La POSITION de la fonction | Partiel{.text-warning} | Pas de support pour `IN` et `USING` clauses, pas de `POSITION_REGEX` variante |
|
||||
| E021-12 | Comparaison de caractères | Oui{.text-success} | |
|
||||
| E021-01 | Type de données CARACTÈRE | Aucun {.text-danger} | |
|
||||
| E021-02 | TYPE DE DONNÉES variable de caractère | Aucun {.text-danger} | `String` se comporte de la même manière, mais sans limite de longueur entre parenthèses |
|
||||
| E021-03 | Littéraux de caractères | Partiel {.text-warning} | Aucune concaténation automatique de littéraux consécutifs et prise en charge du jeu de caractères |
|
||||
| E021-04 | Fonction CHARACTER_LENGTH | Partiel {.text-warning} | Aucun `USING` clause |
|
||||
| E021-05 | Fonction OCTET_LENGTH | Aucun {.text-danger} | `LENGTH` se comporte de la même façon |
|
||||
| E021-06 | SUBSTRING | Partiel {.text-warning} | Pas de support pour `SIMILAR` et `ESCAPE` clauses, pas de `SUBSTRING_REGEX` variante |
|
||||
| E021-07 | Concaténation de caractères | Partiel {.text-warning} | Aucun `COLLATE` clause |
|
||||
| E021-08 | Fonctions supérieures et inférieures | Oui {.text-success} | |
|
||||
| E021-09 | La fonction TRIM | Oui {.text-success} | |
|
||||
| E021-10 | Conversion implicite entre les types de chaînes de caractères de longueur fixe et de longueur variable | Aucun {.text-danger} | ANSI SQL permet la distribution implicite arbitraire entre les types de chaîne, tandis que ClickHouse repose sur des fonctions ayant plusieurs surcharges au lieu de la distribution implicite |
|
||||
| E021-11 | La POSITION de la fonction | Partiel {.text-warning} | Pas de support pour `IN` et `USING` clauses, pas de `POSITION_REGEX` variante |
|
||||
| E021-12 | Comparaison de caractères | Oui {.text-success} | |
|
||||
| **E031** | **Identificateur** | **Partiel**{.text-warning} | |
|
||||
| E031-01 | Identificateurs délimités | Partiel{.text-warning} | Le support littéral Unicode est limité |
|
||||
| E031-02 | Identificateurs minuscules | Oui{.text-success} | |
|
||||
| E031-03 | Fuite de soulignement | Oui{.text-success} | |
|
||||
| E031-01 | Identificateurs délimités | Partiel {.text-warning} | Le support littéral Unicode est limité |
|
||||
| E031-02 | Identificateurs minuscules | Oui {.text-success} | |
|
||||
| E031-03 | Fuite de soulignement | Oui {.text-success} | |
|
||||
| **E051** | **Spécification de requête de base** | **Partiel**{.text-warning} | |
|
||||
| E051-01 | SELECT DISTINCT | Oui{.text-success} | |
|
||||
| E051-02 | Groupe par clause | Oui{.text-success} | |
|
||||
| E051-04 | GROUP BY peut contenir des colonnes `<select list>` | Oui{.text-success} | |
|
||||
| E051-05 | Les éléments sélectionnés peuvent être renommés | Oui{.text-success} | |
|
||||
| E051-06 | Clause HAVING | Oui{.text-success} | |
|
||||
| E051-07 | Qualifié \* dans la liste select | Oui{.text-success} | |
|
||||
| E051-08 | Nom de corrélation dans la clause FROM | Oui{.text-success} | |
|
||||
| E051-09 | Renommer les colonnes de la clause FROM | Aucun{.text-danger} | |
|
||||
| E051-01 | SELECT DISTINCT | Oui {.text-success} | |
|
||||
| E051-02 | Groupe par clause | Oui {.text-success} | |
|
||||
| E051-04 | GROUP BY peut contenir des colonnes `<select list>` | Oui {.text-success} | |
|
||||
| E051-05 | Les éléments sélectionnés peuvent être renommés | Oui {.text-success} | |
|
||||
| E051-06 | Clause HAVING | Oui {.text-success} | |
|
||||
| E051-07 | Qualifié \* dans la liste select | Oui {.text-success} | |
|
||||
| E051-08 | Nom de corrélation dans la clause FROM | Oui {.text-success} | |
|
||||
| E051-09 | Renommer les colonnes de la clause FROM | Aucun {.text-danger} | |
|
||||
| **E061** | **Prédicats de base et conditions de recherche** | **Partiel**{.text-warning} | |
|
||||
| E061-01 | Prédicat de comparaison | Oui{.text-success} | |
|
||||
| E061-02 | Entre prédicat | Partiel{.text-warning} | Aucun `SYMMETRIC` et `ASYMMETRIC` clause |
|
||||
| E061-03 | Dans le prédicat avec la liste des valeurs | Oui{.text-success} | |
|
||||
| E061-04 | Comme prédicat | Oui{.text-success} | |
|
||||
| E061-05 | Comme prédicat: clause D'échappement | Aucun{.text-danger} | |
|
||||
| E061-06 | Prédicat NULL | Oui{.text-success} | |
|
||||
| E061-07 | Prédicat de comparaison quantifié | Aucun{.text-danger} | |
|
||||
| E061-08 | Existe prédicat | Aucun{.text-danger} | |
|
||||
| E061-09 | Sous-requêtes dans le prédicat de comparaison | Oui{.text-success} | |
|
||||
| E061-11 | Sous-requêtes dans dans le prédicat | Oui{.text-success} | |
|
||||
| E061-12 | Sous-requêtes dans le prédicat de comparaison quantifiée | Aucun{.text-danger} | |
|
||||
| E061-13 | Sous-requêtes corrélées | Aucun{.text-danger} | |
|
||||
| E061-14 | Condition de recherche | Oui{.text-success} | |
|
||||
| E061-01 | Prédicat de comparaison | Oui {.text-success} | |
|
||||
| E061-02 | Entre prédicat | Partiel {.text-warning} | Aucun `SYMMETRIC` et `ASYMMETRIC` clause |
|
||||
| E061-03 | Dans le prédicat avec la liste des valeurs | Oui {.text-success} | |
|
||||
| E061-04 | Comme prédicat | Oui {.text-success} | |
|
||||
| E061-05 | Comme prédicat: clause D'échappement | Aucun {.text-danger} | |
|
||||
| E061-06 | Prédicat NULL | Oui {.text-success} | |
|
||||
| E061-07 | Prédicat de comparaison quantifié | Aucun {.text-danger} | |
|
||||
| E061-08 | Existe prédicat | Aucun {.text-danger} | |
|
||||
| E061-09 | Sous-requêtes dans le prédicat de comparaison | Oui {.text-success} | |
|
||||
| E061-11 | Sous-requêtes dans dans le prédicat | Oui {.text-success} | |
|
||||
| E061-12 | Sous-requêtes dans le prédicat de comparaison quantifiée | Aucun {.text-danger} | |
|
||||
| E061-13 | Sous-requêtes corrélées | Aucun {.text-danger} | |
|
||||
| E061-14 | Condition de recherche | Oui {.text-success} | |
|
||||
| **E071** | **Expressions de requête de base** | **Partiel**{.text-warning} | |
|
||||
| E071-01 | Opérateur de table distinct UNION | Aucun{.text-danger} | |
|
||||
| E071-02 | Opérateur de table UNION ALL | Oui{.text-success} | |
|
||||
| E071-03 | Sauf opérateur de table DISTINCT | Aucun{.text-danger} | |
|
||||
| E071-05 | Les colonnes combinées via les opérateurs de table n'ont pas besoin d'avoir exactement le même type de données | Oui{.text-success} | |
|
||||
| E071-06 | Tableau des opérateurs dans les sous-requêtes | Oui{.text-success} | |
|
||||
| E071-01 | Opérateur de table distinct UNION | Aucun {.text-danger} | |
|
||||
| E071-02 | Opérateur de table UNION ALL | Oui {.text-success} | |
|
||||
| E071-03 | Sauf opérateur de table DISTINCT | Aucun {.text-danger} | |
|
||||
| E071-05 | Les colonnes combinées via les opérateurs de table n'ont pas besoin d'avoir exactement le même type de données | Oui {.text-success} | |
|
||||
| E071-06 | Tableau des opérateurs dans les sous-requêtes | Oui {.text-success} | |
|
||||
| **E081** | **Les privilèges de base** | **Partiel**{.text-warning} | Les travaux en cours |
|
||||
| **E091** | **Les fonctions de jeu** | **Oui**{.text-success} | |
|
||||
| E091-01 | AVG | Oui{.text-success} | |
|
||||
| E091-02 | COUNT | Oui{.text-success} | |
|
||||
| E091-03 | MAX | Oui{.text-success} | |
|
||||
| E091-04 | MIN | Oui{.text-success} | |
|
||||
| E091-05 | SUM | Oui{.text-success} | |
|
||||
| E091-06 | TOUS les quantificateurs | Aucun{.text-danger} | |
|
||||
| E091-07 | Quantificateur DISTINCT | Partiel{.text-warning} | Toutes les fonctions d'agrégation ne sont pas prises en charge |
|
||||
| E091-01 | AVG | Oui {.text-success} | |
|
||||
| E091-02 | COUNT | Oui {.text-success} | |
|
||||
| E091-03 | MAX | Oui {.text-success} | |
|
||||
| E091-04 | MIN | Oui {.text-success} | |
|
||||
| E091-05 | SUM | Oui {.text-success} | |
|
||||
| E091-06 | TOUS les quantificateurs | Aucun {.text-danger} | |
|
||||
| E091-07 | Quantificateur DISTINCT | Partiel {.text-warning} | Toutes les fonctions d'agrégation ne sont pas prises en charge |
|
||||
| **E101** | **Manipulation des données de base** | **Partiel**{.text-warning} | |
|
||||
| E101-01 | Insérer une déclaration | Oui{.text-success} | Remarque: la clé primaire dans ClickHouse n'implique pas `UNIQUE` contrainte |
|
||||
| E101-03 | Déclaration de mise à jour recherchée | Aucun{.text-danger} | Il y a un `ALTER UPDATE` déclaration pour la modification des données de lot |
|
||||
| E101-04 | Requête de suppression recherchée | Aucun{.text-danger} | Il y a un `ALTER DELETE` déclaration pour la suppression de données par lots |
|
||||
| E101-01 | Insérer une déclaration | Oui {.text-success} | Remarque: la clé primaire dans ClickHouse n'implique pas `UNIQUE` contrainte |
|
||||
| E101-03 | Déclaration de mise à jour recherchée | Aucun {.text-danger} | Il y a un `ALTER UPDATE` déclaration pour la modification des données de lot |
|
||||
| E101-04 | Requête de suppression recherchée | Aucun {.text-danger} | Il y a un `ALTER DELETE` déclaration pour la suppression de données par lots |
|
||||
| **E111** | **Instruction SELECT à une ligne** | **Aucun**{.text-danger} | |
|
||||
| **E121** | **Prise en charge du curseur de base** | **Aucun**{.text-danger} | |
|
||||
| E121-01 | DECLARE CURSOR | Aucun{.text-danger} | |
|
||||
| E121-02 | Les colonnes ORDER BY n'ont pas besoin d'être dans la liste select | Aucun{.text-danger} | |
|
||||
| E121-03 | Expressions de valeur dans la clause ORDER BY | Aucun{.text-danger} | |
|
||||
| E121-04 | Instruction OPEN | Aucun{.text-danger} | |
|
||||
| E121-06 | Déclaration de mise à jour positionnée | Aucun{.text-danger} | |
|
||||
| E121-07 | Instruction de suppression positionnée | Aucun{.text-danger} | |
|
||||
| E121-08 | Déclaration de fermeture | Aucun{.text-danger} | |
|
||||
| E121-10 | Instruction FETCH: implicite suivant | Aucun{.text-danger} | |
|
||||
| E121-17 | Avec curseurs HOLD | Aucun{.text-danger} | |
|
||||
| E121-01 | DECLARE CURSOR | Aucun {.text-danger} | |
|
||||
| E121-02 | Les colonnes ORDER BY n'ont pas besoin d'être dans la liste select | Aucun {.text-danger} | |
|
||||
| E121-03 | Expressions de valeur dans la clause ORDER BY | Aucun {.text-danger} | |
|
||||
| E121-04 | Instruction OPEN | Aucun {.text-danger} | |
|
||||
| E121-06 | Déclaration de mise à jour positionnée | Aucun {.text-danger} | |
|
||||
| E121-07 | Instruction de suppression positionnée | Aucun {.text-danger} | |
|
||||
| E121-08 | Déclaration de fermeture | Aucun {.text-danger} | |
|
||||
| E121-10 | Instruction FETCH: implicite suivant | Aucun {.text-danger} | |
|
||||
| E121-17 | Avec curseurs HOLD | Aucun {.text-danger} | |
|
||||
| **E131** | **Support de valeur Null (nulls au lieu de valeurs)** | **Partiel**{.text-warning} | Certaines restrictions s'appliquent |
|
||||
| **E141** | **Contraintes d'intégrité de base** | **Partiel**{.text-warning} | |
|
||||
| E141-01 | Contraintes non nulles | Oui{.text-success} | Note: `NOT NULL` est implicite pour les colonnes de table par défaut |
|
||||
| E141-02 | Contrainte UNIQUE de colonnes non nulles | Aucun{.text-danger} | |
|
||||
| E141-03 | Contraintes de clé primaire | Aucun{.text-danger} | |
|
||||
| E141-04 | Contrainte de clé étrangère de base avec la valeur par défaut NO ACTION Pour l'action de suppression référentielle et l'action de mise à jour référentielle | Aucun{.text-danger} | |
|
||||
| E141-06 | Vérifier la contrainte | Oui{.text-success} | |
|
||||
| E141-07 | Colonne par défaut | Oui{.text-success} | |
|
||||
| E141-08 | Non NULL déduit sur la clé primaire | Oui{.text-success} | |
|
||||
| E141-10 | Les noms dans une clé étrangère peut être spécifié dans n'importe quel ordre | Aucun{.text-danger} | |
|
||||
| E141-01 | Contraintes non nulles | Oui {.text-success} | Note: `NOT NULL` est implicite pour les colonnes de table par défaut |
|
||||
| E141-02 | Contrainte UNIQUE de colonnes non nulles | Aucun {.text-danger} | |
|
||||
| E141-03 | Contraintes de clé primaire | Aucun {.text-danger} | |
|
||||
| E141-04 | Contrainte de clé étrangère de base avec la valeur par défaut NO ACTION Pour l'action de suppression référentielle et l'action de mise à jour référentielle | Aucun {.text-danger} | |
|
||||
| E141-06 | Vérifier la contrainte | Oui {.text-success} | |
|
||||
| E141-07 | Colonne par défaut | Oui {.text-success} | |
|
||||
| E141-08 | Non NULL déduit sur la clé primaire | Oui {.text-success} | |
|
||||
| E141-10 | Les noms dans une clé étrangère peut être spécifié dans n'importe quel ordre | Aucun {.text-danger} | |
|
||||
| **E151** | **Support de Transaction** | **Aucun**{.text-danger} | |
|
||||
| E151-01 | COMMIT déclaration | Aucun{.text-danger} | |
|
||||
| E151-02 | Déclaration de restauration | Aucun{.text-danger} | |
|
||||
| E151-01 | COMMIT déclaration | Aucun {.text-danger} | |
|
||||
| E151-02 | Déclaration de restauration | Aucun {.text-danger} | |
|
||||
| **E152** | **Instruction de transaction set de base** | **Aucun**{.text-danger} | |
|
||||
| E152-01 | SET TRANSACTION statement: clause sérialisable de niveau D'isolement | Aucun{.text-danger} | |
|
||||
| E152-02 | SET TRANSACTION statement: clauses en lecture seule et en lecture écriture | Aucun{.text-danger} | |
|
||||
| E152-01 | SET TRANSACTION statement: clause sérialisable de niveau D'isolement | Aucun {.text-danger} | |
|
||||
| E152-02 | SET TRANSACTION statement: clauses en lecture seule et en lecture écriture | Aucun {.text-danger} | |
|
||||
| **E153** | **Requêtes pouvant être mises à jour avec des sous requêtes** | **Aucun**{.text-danger} | |
|
||||
| **E161** | **Commentaires SQL en utilisant le premier Double moins** | **Oui**{.text-success} | |
|
||||
| **E171** | **Support SQLSTATE** | **Aucun**{.text-danger} | |
|
||||
| **E182** | **Liaison du langage hôte** | **Aucun**{.text-danger} | |
|
||||
| **F031** | **Manipulation de schéma de base** | **Partiel**{.text-warning} | |
|
||||
| F031-01 | Instruction CREATE TABLE pour créer des tables de base persistantes | Partiel{.text-warning} | Aucun `SYSTEM VERSIONING`, `ON COMMIT`, `GLOBAL`, `LOCAL`, `PRESERVE`, `DELETE`, `REF IS`, `WITH OPTIONS`, `UNDER`, `LIKE`, `PERIOD FOR` clauses et aucun support pour les types de données résolus par l'utilisateur |
|
||||
| F031-02 | Instruction créer une vue | Partiel{.text-warning} | Aucun `RECURSIVE`, `CHECK`, `UNDER`, `WITH OPTIONS` clauses et aucun support pour les types de données résolus par l'utilisateur |
|
||||
| F031-03 | Déclaration de subvention | Oui{.text-success} | |
|
||||
| F031-04 | ALTER TABLE statement: ajouter une clause de colonne | Partiel{.text-warning} | Pas de support pour `GENERATED` clause et période de temps du système |
|
||||
| F031-13 | Instruction DROP TABLE: clause RESTRICT | Aucun{.text-danger} | |
|
||||
| F031-16 | Instruction DROP VIEW: clause RESTRICT | Aucun{.text-danger} | |
|
||||
| F031-19 | REVOKE statement: clause RESTRICT | Aucun{.text-danger} | |
|
||||
| F031-01 | Instruction CREATE TABLE pour créer des tables de base persistantes | Partiel {.text-warning} | Aucun `SYSTEM VERSIONING`, `ON COMMIT`, `GLOBAL`, `LOCAL`, `PRESERVE`, `DELETE`, `REF IS`, `WITH OPTIONS`, `UNDER`, `LIKE`, `PERIOD FOR` clauses et aucun support pour les types de données résolus par l'utilisateur |
|
||||
| F031-02 | Instruction créer une vue | Partiel {.text-warning} | Aucun `RECURSIVE`, `CHECK`, `UNDER`, `WITH OPTIONS` clauses et aucun support pour les types de données résolus par l'utilisateur |
|
||||
| F031-03 | Déclaration de subvention | Oui {.text-success} | |
|
||||
| F031-04 | ALTER TABLE statement: ajouter une clause de colonne | Partiel {.text-warning} | Pas de support pour `GENERATED` clause et période de temps du système |
|
||||
| F031-13 | Instruction DROP TABLE: clause RESTRICT | Aucun {.text-danger} | |
|
||||
| F031-16 | Instruction DROP VIEW: clause RESTRICT | Aucun {.text-danger} | |
|
||||
| F031-19 | REVOKE statement: clause RESTRICT | Aucun {.text-danger} | |
|
||||
| **F041** | **Table jointe de base** | **Partiel**{.text-warning} | |
|
||||
| F041-01 | INNER join (mais pas nécessairement le mot-clé INNER) | Oui{.text-success} | |
|
||||
| F041-02 | INTÉRIEURE mot-clé | Oui{.text-success} | |
|
||||
| F041-03 | LEFT OUTER JOIN | Oui{.text-success} | |
|
||||
| F041-04 | RIGHT OUTER JOIN | Oui{.text-success} | |
|
||||
| F041-05 | Les jointures externes peuvent être imbriqués | Oui{.text-success} | |
|
||||
| F041-07 | La table intérieure dans une jointure extérieure gauche ou droite peut également être utilisée dans une jointure intérieure | Oui{.text-success} | |
|
||||
| F041-08 | Tous les opérateurs de comparaison sont pris en charge (plutôt que juste =) | Aucun{.text-danger} | |
|
||||
| F041-01 | INNER join (mais pas nécessairement le mot-clé INNER) | Oui {.text-success} | |
|
||||
| F041-02 | INTÉRIEURE mot-clé | Oui {.text-success} | |
|
||||
| F041-03 | LEFT OUTER JOIN | Oui {.text-success} | |
|
||||
| F041-04 | RIGHT OUTER JOIN | Oui {.text-success} | |
|
||||
| F041-05 | Les jointures externes peuvent être imbriqués | Oui {.text-success} | |
|
||||
| F041-07 | La table intérieure dans une jointure extérieure gauche ou droite peut également être utilisée dans une jointure intérieure | Oui {.text-success} | |
|
||||
| F041-08 | Tous les opérateurs de comparaison sont pris en charge (plutôt que juste =) | Aucun {.text-danger} | |
|
||||
| **F051** | **Date et heure de base** | **Partiel**{.text-warning} | |
|
||||
| F051-01 | Type de données de DATE (y compris la prise en charge du littéral de DATE) | Partiel{.text-warning} | Aucun littéral |
|
||||
| F051-02 | TYPE DE DONNÉES DE TEMPS (y compris la prise en charge du littéral de temps) avec une précision de secondes fractionnaires d'au moins 0 | Aucun{.text-danger} | |
|
||||
| F051-03 | Type de données D'horodatage (y compris la prise en charge du littéral D'horodatage) avec une précision de secondes fractionnaires d'au moins 0 et 6 | Aucun{.text-danger} | `DateTime64` temps fournit des fonctionnalités similaires |
|
||||
| F051-04 | Prédicat de comparaison sur les types de données DATE, heure et horodatage | Partiel{.text-warning} | Un seul type de données disponible |
|
||||
| F051-05 | Distribution explicite entre les types datetime et les types de chaînes de caractères | Oui{.text-success} | |
|
||||
| F051-06 | CURRENT_DATE | Aucun{.text-danger} | `today()` est similaire |
|
||||
| F051-07 | LOCALTIME | Aucun{.text-danger} | `now()` est similaire |
|
||||
| F051-08 | LOCALTIMESTAMP | Aucun{.text-danger} | |
|
||||
| F051-01 | Type de données de DATE (y compris la prise en charge du littéral de DATE) | Partiel {.text-warning} | Aucun littéral |
|
||||
| F051-02 | TYPE DE DONNÉES DE TEMPS (y compris la prise en charge du littéral de temps) avec une précision de secondes fractionnaires d'au moins 0 | Aucun {.text-danger} | |
|
||||
| F051-03 | Type de données D'horodatage (y compris la prise en charge du littéral D'horodatage) avec une précision de secondes fractionnaires d'au moins 0 et 6 | Aucun {.text-danger} | `DateTime64` temps fournit des fonctionnalités similaires |
|
||||
| F051-04 | Prédicat de comparaison sur les types de données DATE, heure et horodatage | Partiel {.text-warning} | Un seul type de données disponible |
|
||||
| F051-05 | Distribution explicite entre les types datetime et les types de chaînes de caractères | Oui {.text-success} | |
|
||||
| F051-06 | CURRENT_DATE | Aucun {.text-danger} | `today()` est similaire |
|
||||
| F051-07 | LOCALTIME | Aucun {.text-danger} | `now()` est similaire |
|
||||
| F051-08 | LOCALTIMESTAMP | Aucun {.text-danger} | |
|
||||
| **F081** | **UNION et sauf dans les vues** | **Partiel**{.text-warning} | |
|
||||
| **F131** | **Groupées des opérations** | **Partiel**{.text-warning} | |
|
||||
| F131-01 | WHERE, GROUP BY et ayant des clauses prises en charge dans les requêtes avec des vues groupées | Oui{.text-success} | |
|
||||
| F131-02 | Plusieurs tables prises en charge dans les requêtes avec des vues groupées | Oui{.text-success} | |
|
||||
| F131-03 | Définir les fonctions prises en charge dans les requêtes groupées vues | Oui{.text-success} | |
|
||||
| F131-04 | Sous requêtes avec des clauses GROUP BY et HAVING et des vues groupées | Oui{.text-success} | |
|
||||
| F131-05 | Sélectionnez une seule ligne avec des clauses GROUP BY et HAVING et des vues groupées | Aucun{.text-danger} | |
|
||||
| F131-01 | WHERE, GROUP BY et ayant des clauses prises en charge dans les requêtes avec des vues groupées | Oui {.text-success} | |
|
||||
| F131-02 | Plusieurs tables prises en charge dans les requêtes avec des vues groupées | Oui {.text-success} | |
|
||||
| F131-03 | Définir les fonctions prises en charge dans les requêtes groupées vues | Oui {.text-success} | |
|
||||
| F131-04 | Sous requêtes avec des clauses GROUP BY et HAVING et des vues groupées | Oui {.text-success} | |
|
||||
| F131-05 | Sélectionnez une seule ligne avec des clauses GROUP BY et HAVING et des vues groupées | Aucun {.text-danger} | |
|
||||
| **F181** | **Support de module Multiple** | **Aucun**{.text-danger} | |
|
||||
| **F201** | **Fonction de distribution** | **Oui**{.text-success} | |
|
||||
| **F221** | **Valeurs par défaut explicites** | **Aucun**{.text-danger} | |
|
||||
| **F261** | **Expression de cas** | **Oui**{.text-success} | |
|
||||
| F261-01 | Cas Simple | Oui{.text-success} | |
|
||||
| F261-02 | Cas recherché | Oui{.text-success} | |
|
||||
| F261-03 | NULLIF | Oui{.text-success} | |
|
||||
| F261-04 | COALESCE | Oui{.text-success} | |
|
||||
| F261-01 | Cas Simple | Oui {.text-success} | |
|
||||
| F261-02 | Cas recherché | Oui {.text-success} | |
|
||||
| F261-03 | NULLIF | Oui {.text-success} | |
|
||||
| F261-04 | COALESCE | Oui {.text-success} | |
|
||||
| **F311** | **Déclaration de définition de schéma** | **Partiel**{.text-warning} | |
|
||||
| F311-01 | CREATE SCHEMA | Aucun{.text-danger} | |
|
||||
| F311-02 | Créer une TABLE pour les tables de base persistantes | Oui{.text-success} | |
|
||||
| F311-03 | CREATE VIEW | Oui{.text-success} | |
|
||||
| F311-04 | CREATE VIEW: WITH CHECK OPTION | Aucun{.text-danger} | |
|
||||
| F311-05 | Déclaration de subvention | Oui{.text-success} | |
|
||||
| F311-01 | CREATE SCHEMA | Aucun {.text-danger} | |
|
||||
| F311-02 | Créer une TABLE pour les tables de base persistantes | Oui {.text-success} | |
|
||||
| F311-03 | CREATE VIEW | Oui {.text-success} | |
|
||||
| F311-04 | CREATE VIEW: WITH CHECK OPTION | Aucun {.text-danger} | |
|
||||
| F311-05 | Déclaration de subvention | Oui {.text-success} | |
|
||||
| **F471** | **Valeurs de sous-requête scalaire** | **Oui**{.text-success} | |
|
||||
| **F481** | **Prédicat null étendu** | **Oui**{.text-success} | |
|
||||
| **F812** | **Base de repérage** | **Aucun**{.text-danger} | |
|
||||
| **T321** | **Routines SQL-invoked de base** | **Aucun**{.text-danger} | |
|
||||
| T321-01 | Fonctions définies par l'utilisateur sans surcharge | Aucun{.text-danger} | |
|
||||
| T321-02 | Procédures stockées définies par l'utilisateur sans surcharge | Aucun{.text-danger} | |
|
||||
| T321-03 | L'invocation de la fonction | Aucun{.text-danger} | |
|
||||
| T321-04 | L'instruction d'APPEL de | Aucun{.text-danger} | |
|
||||
| T321-05 | Déclaration de retour | Aucun{.text-danger} | |
|
||||
| T321-01 | Fonctions définies par l'utilisateur sans surcharge | Aucun {.text-danger} | |
|
||||
| T321-02 | Procédures stockées définies par l'utilisateur sans surcharge | Aucun {.text-danger} | |
|
||||
| T321-03 | L'invocation de la fonction | Aucun {.text-danger} | |
|
||||
| T321-04 | L'instruction d'APPEL de | Aucun {.text-danger} | |
|
||||
| T321-05 | Déclaration de retour | Aucun {.text-danger} | |
|
||||
| **T631** | **Dans le prédicat avec un élément de liste** | **Oui**{.text-success} | |
|
||||
|
@ -257,8 +257,8 @@ KDevelopとQTCreatorは、ClickHouseを開発するためのIDEの他の優れ
|
||||
|
||||
sudo apt install wget xz-utils
|
||||
|
||||
wget https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz
|
||||
wget https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz
|
||||
wget https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz
|
||||
wget https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz
|
||||
|
||||
xz -v -d hits_v1.tsv.xz
|
||||
xz -v -d visits_v1.tsv.xz
|
||||
|
@ -579,7 +579,7 @@ Forkは並列化には使用されません。
|
||||
|
||||
**14.** 戻り値。
|
||||
|
||||
ほとんどの場合、 `return`. 書かない `[return std::move(res)]{.strike}`.
|
||||
ほとんどの場合、 `return`. 書かない `return std::move(res)`.
|
||||
|
||||
関数がオブジェクトをヒープに割り当てて返す場合は、次のようにします `shared_ptr` または `unique_ptr`.
|
||||
|
||||
@ -673,7 +673,7 @@ Loader() {}
|
||||
**24.** 使用しない `trailing return type` 必要がない限り機能のため。
|
||||
|
||||
``` cpp
|
||||
[auto f() -> void;]{.strike}
|
||||
auto f() -> void
|
||||
```
|
||||
|
||||
**25.** 変数の宣言と初期化。
|
||||
|
@ -9,14 +9,14 @@ toc_title: "Yandex.Metrica データ"
|
||||
Yandex.Metricaについての詳細は [ClickHouse history](../../introduction/history.md) のセクションを参照してください。
|
||||
|
||||
データセットは2つのテーブルから構成されており、どちらも圧縮された `tsv.xz` ファイルまたは準備されたパーティションとしてダウンロードすることができます。
|
||||
さらに、1億行を含む`hits`テーブルの拡張版が TSVとして https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_100m_obfuscated_v1.tsv.xz に、準備されたパーティションとして https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_100m_obfuscated_v1.tar.xz にあります。
|
||||
さらに、1億行を含む`hits`テーブルの拡張版が TSVとして https://datasets.clickhouse.tech/hits/tsv/hits_100m_obfuscated_v1.tsv.xz に、準備されたパーティションとして https://datasets.clickhouse.tech/hits/partitions/hits_100m_obfuscated_v1.tar.xz にあります。
|
||||
|
||||
## パーティション済みテーブルの取得 {#obtaining-tables-from-prepared-partitions}
|
||||
|
||||
hits テーブルのダウンロードとインポート:
|
||||
|
||||
``` bash
|
||||
curl -O https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_v1.tar
|
||||
curl -O https://datasets.clickhouse.tech/hits/partitions/hits_v1.tar
|
||||
tar xvf hits_v1.tar -C /var/lib/clickhouse # ClickHouse のデータディレクトリへのパス
|
||||
# 展開されたデータのパーミッションをチェックし、必要に応じて修正します。
|
||||
sudo service clickhouse-server restart
|
||||
@ -26,7 +26,7 @@ clickhouse-client --query "SELECT COUNT(*) FROM datasets.hits_v1"
|
||||
visits のダウンロードとインポート:
|
||||
|
||||
``` bash
|
||||
curl -O https://clickhouse-datasets.s3.yandex.net/visits/partitions/visits_v1.tar
|
||||
curl -O https://datasets.clickhouse.tech/visits/partitions/visits_v1.tar
|
||||
tar xvf visits_v1.tar -C /var/lib/clickhouse # ClickHouse のデータディレクトリへのパス
|
||||
# 展開されたデータのパーミッションをチェックし、必要に応じて修正します。
|
||||
sudo service clickhouse-server restart
|
||||
@ -38,7 +38,7 @@ clickhouse-client --query "SELECT COUNT(*) FROM datasets.visits_v1"
|
||||
圧縮TSVファイルのダウンロードと hits テーブルのインポート:
|
||||
|
||||
``` bash
|
||||
curl https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
# now create table
|
||||
clickhouse-client --query "CREATE DATABASE IF NOT EXISTS datasets"
|
||||
clickhouse-client --query "CREATE TABLE datasets.hits_v1 ( WatchID UInt64, JavaEnable UInt8, Title String, GoodEvent Int16, EventTime DateTime, EventDate Date, CounterID UInt32, ClientIP UInt32, ClientIP6 FixedString(16), RegionID UInt32, UserID UInt64, CounterClass Int8, OS UInt8, UserAgent UInt8, URL String, Referer String, URLDomain String, RefererDomain String, Refresh UInt8, IsRobot UInt8, RefererCategories Array(UInt16), URLCategories Array(UInt16), URLRegions Array(UInt32), RefererRegions Array(UInt32), ResolutionWidth UInt16, ResolutionHeight UInt16, ResolutionDepth UInt8, FlashMajor UInt8, FlashMinor UInt8, FlashMinor2 String, NetMajor UInt8, NetMinor UInt8, UserAgentMajor UInt16, UserAgentMinor FixedString(2), CookieEnable UInt8, JavascriptEnable UInt8, IsMobile UInt8, MobilePhone UInt8, MobilePhoneModel String, Params String, IPNetworkID UInt32, TraficSourceID Int8, SearchEngineID UInt16, SearchPhrase String, AdvEngineID UInt8, IsArtifical UInt8, WindowClientWidth UInt16, WindowClientHeight UInt16, ClientTimeZone Int16, ClientEventTime DateTime, SilverlightVersion1 UInt8, SilverlightVersion2 UInt8, SilverlightVersion3 UInt32, SilverlightVersion4 UInt16, PageCharset String, CodeVersion UInt32, IsLink UInt8, IsDownload UInt8, IsNotBounce UInt8, FUniqID UInt64, HID UInt32, IsOldCounter UInt8, IsEvent UInt8, IsParameter UInt8, DontCountHits UInt8, WithHash UInt8, HitColor FixedString(1), UTCEventTime DateTime, Age UInt8, Sex UInt8, Income UInt8, Interests UInt16, Robotness UInt8, GeneralInterests Array(UInt16), RemoteIP UInt32, RemoteIP6 FixedString(16), WindowName Int32, OpenerName Int32, HistoryLength Int16, BrowserLanguage FixedString(2), BrowserCountry FixedString(2), SocialNetwork String, SocialAction String, HTTPError UInt16, SendTiming Int32, DNSTiming Int32, ConnectTiming Int32, ResponseStartTiming Int32, ResponseEndTiming Int32, FetchTiming Int32, RedirectTiming Int32, DOMInteractiveTiming Int32, DOMContentLoadedTiming Int32, DOMCompleteTiming Int32, LoadEventStartTiming Int32, LoadEventEndTiming Int32, NSToDOMContentLoadedTiming Int32, FirstPaintTiming Int32, RedirectCount Int8, SocialSourceNetworkID UInt8, SocialSourcePage String, ParamPrice Int64, ParamOrderID String, ParamCurrency FixedString(3), ParamCurrencyID UInt16, GoalsReached Array(UInt32), OpenstatServiceName String, OpenstatCampaignID String, OpenstatAdID String, OpenstatSourceID String, UTMSource String, UTMMedium String, UTMCampaign String, UTMContent String, UTMTerm String, FromTag String, HasGCLID UInt8, RefererHash UInt64, URLHash UInt64, CLID UInt32, YCLID UInt64, ShareService String, ShareURL String, ShareTitle String, ParsedParams Nested(Key1 String, Key2 String, Key3 String, Key4 String, Key5 String, ValueDouble Float64), IslandID FixedString(16), RequestNum UInt32, RequestTry UInt8) ENGINE = MergeTree() PARTITION BY toYYYYMM(EventDate) ORDER BY (CounterID, EventDate, intHash32(UserID)) SAMPLE BY intHash32(UserID) SETTINGS index_granularity = 8192"
|
||||
@ -52,7 +52,7 @@ clickhouse-client --query "SELECT COUNT(*) FROM datasets.hits_v1"
|
||||
圧縮TSVファイルのダウンロードと visits テーブルのインポート:
|
||||
|
||||
``` bash
|
||||
curl https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
# now create table
|
||||
clickhouse-client --query "CREATE DATABASE IF NOT EXISTS datasets"
|
||||
clickhouse-client --query "CREATE TABLE datasets.visits_v1 ( CounterID UInt32, StartDate Date, Sign Int8, IsNew UInt8, VisitID UInt64, UserID UInt64, StartTime DateTime, Duration UInt32, UTCStartTime DateTime, PageViews Int32, Hits Int32, IsBounce UInt8, Referer String, StartURL String, RefererDomain String, StartURLDomain String, EndURL String, LinkURL String, IsDownload UInt8, TraficSourceID Int8, SearchEngineID UInt16, SearchPhrase String, AdvEngineID UInt8, PlaceID Int32, RefererCategories Array(UInt16), URLCategories Array(UInt16), URLRegions Array(UInt32), RefererRegions Array(UInt32), IsYandex UInt8, GoalReachesDepth Int32, GoalReachesURL Int32, GoalReachesAny Int32, SocialSourceNetworkID UInt8, SocialSourcePage String, MobilePhoneModel String, ClientEventTime DateTime, RegionID UInt32, ClientIP UInt32, ClientIP6 FixedString(16), RemoteIP UInt32, RemoteIP6 FixedString(16), IPNetworkID UInt32, SilverlightVersion3 UInt32, CodeVersion UInt32, ResolutionWidth UInt16, ResolutionHeight UInt16, UserAgentMajor UInt16, UserAgentMinor UInt16, WindowClientWidth UInt16, WindowClientHeight UInt16, SilverlightVersion2 UInt8, SilverlightVersion4 UInt16, FlashVersion3 UInt16, FlashVersion4 UInt16, ClientTimeZone Int16, OS UInt8, UserAgent UInt8, ResolutionDepth UInt8, FlashMajor UInt8, FlashMinor UInt8, NetMajor UInt8, NetMinor UInt8, MobilePhone UInt8, SilverlightVersion1 UInt8, Age UInt8, Sex UInt8, Income UInt8, JavaEnable UInt8, CookieEnable UInt8, JavascriptEnable UInt8, IsMobile UInt8, BrowserLanguage UInt16, BrowserCountry UInt16, Interests UInt16, Robotness UInt8, GeneralInterests Array(UInt16), Params Array(String), Goals Nested(ID UInt32, Serial UInt32, EventTime DateTime, Price Int64, OrderID String, CurrencyID UInt32), WatchIDs Array(UInt64), ParamSumPrice Int64, ParamCurrency FixedString(3), ParamCurrencyID UInt16, ClickLogID UInt64, ClickEventID Int32, ClickGoodEvent Int32, ClickEventTime DateTime, ClickPriorityID Int32, ClickPhraseID Int32, ClickPageID Int32, ClickPlaceID Int32, ClickTypeID Int32, ClickResourceID Int32, ClickCost UInt32, ClickClientIP UInt32, ClickDomainID UInt32, ClickURL String, ClickAttempt UInt8, ClickOrderID UInt32, ClickBannerID UInt32, ClickMarketCategoryID UInt32, ClickMarketPP UInt32, ClickMarketCategoryName String, ClickMarketPPName String, ClickAWAPSCampaignName String, ClickPageName String, ClickTargetType UInt16, ClickTargetPhraseID UInt64, ClickContextType UInt8, ClickSelectType Int8, ClickOptions String, ClickGroupBannerID Int32, OpenstatServiceName String, OpenstatCampaignID String, OpenstatAdID String, OpenstatSourceID String, UTMSource String, UTMMedium String, UTMCampaign String, UTMContent String, UTMTerm String, FromTag String, HasGCLID UInt8, FirstVisit DateTime, PredLastVisit Date, LastVisit Date, TotalVisits UInt32, TraficSource Nested(ID Int8, SearchEngineID UInt16, AdvEngineID UInt8, PlaceID UInt16, SocialSourceNetworkID UInt8, Domain String, SearchPhrase String, SocialSourcePage String), Attendance FixedString(16), CLID UInt32, YCLID UInt64, NormalizedRefererHash UInt64, SearchPhraseHash UInt64, RefererDomainHash UInt64, NormalizedStartURLHash UInt64, StartURLDomainHash UInt64, NormalizedEndURLHash UInt64, TopLevelDomain UInt64, URLScheme UInt64, OpenstatServiceNameHash UInt64, OpenstatCampaignIDHash UInt64, OpenstatAdIDHash UInt64, OpenstatSourceIDHash UInt64, UTMSourceHash UInt64, UTMMediumHash UInt64, UTMCampaignHash UInt64, UTMContentHash UInt64, UTMTermHash UInt64, FromHash UInt64, WebVisorEnabled UInt8, WebVisorActivity UInt32, ParsedParams Nested(Key1 String, Key2 String, Key3 String, Key4 String, Key5 String, ValueDouble Float64), Market Nested(Type UInt8, GoalID UInt32, OrderID String, OrderPrice Int64, PP UInt32, DirectPlaceID UInt32, DirectOrderID UInt32, DirectBannerID UInt32, GoodID String, GoodName String, GoodQuantity Int32, GoodPrice Int64), IslandID FixedString(16)) ENGINE = CollapsingMergeTree(Sign) PARTITION BY toYYYYMM(StartDate) ORDER BY (CounterID, StartDate, intHash32(UserID), VisitID) SAMPLE BY intHash32(UserID) SETTINGS index_granularity = 8192"
|
||||
|
@ -286,7 +286,7 @@ SELECT formatReadableSize(sum(bytes)) FROM system.parts WHERE table = 'trips_mer
|
||||
## パーティションされたデータのダウンロード {#download-of-prepared-partitions}
|
||||
|
||||
``` bash
|
||||
$ curl -O https://clickhouse-datasets.s3.yandex.net/trips_mergetree/partitions/trips_mergetree.tar
|
||||
$ curl -O https://datasets.clickhouse.tech/trips_mergetree/partitions/trips_mergetree.tar
|
||||
$ tar xvf trips_mergetree.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
$ # check permissions of unpacked data, fix if required
|
||||
$ sudo service clickhouse-server restart
|
||||
|
@ -154,7 +154,7 @@ $ for i in *.zip; do echo $i; unzip -cq $i '*.csv' | sed 's/\.00//g' | clickhous
|
||||
## パーティション済みデータのダウンロード {#download-of-prepared-partitions}
|
||||
|
||||
``` bash
|
||||
$ curl -O https://clickhouse-datasets.s3.yandex.net/ontime/partitions/ontime.tar
|
||||
$ curl -O https://datasets.clickhouse.tech/ontime/partitions/ontime.tar
|
||||
$ tar xvf ontime.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
$ # check permissions of unpacked data, fix if required
|
||||
$ sudo service clickhouse-server restart
|
||||
|
@ -92,8 +92,8 @@ ClickHouseサーバーにいくつかのサンプルデータを入れてみま
|
||||
### テーブルデータのダウンロードと展開 {#download-and-extract-table-data}
|
||||
|
||||
``` bash
|
||||
curl https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
```
|
||||
|
||||
展開されたファイルのサイズは約10GBです。
|
||||
|
@ -48,7 +48,7 @@ toc_title: "\u30CF\u30FC\u30C9\u30A6\u30A7\u30A2\u8A66\u9A13"
|
||||
|
||||
<!-- -->
|
||||
|
||||
wget https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_100m_obfuscated_v1.tar.xz
|
||||
wget https://datasets.clickhouse.tech/hits/partitions/hits_100m_obfuscated_v1.tar.xz
|
||||
tar xvf hits_100m_obfuscated_v1.tar.xz -C .
|
||||
mv hits_100m_obfuscated_v1/* .
|
||||
|
||||
|
@ -26,155 +26,155 @@ toc_title: "ANSI\u306E\u4E92\u63DB\u6027"
|
||||
| Feature ID | 機能名 | 状態 | コメント |
|
||||
|------------|---------------------------------------------------------------------------------------------------|----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| **E011** | **数値データ型** | **部分的**{.text-warning} | |
|
||||
| E011-01 | 整数およびSMALLINTデータ型 | はい。{.text-success} | |
|
||||
| E011-02 | 実数、倍精度および浮動小数点データ型データ型 | 部分的{.text-warning} | `FLOAT(<binary_precision>)`, `REAL` と `DOUBLE PRECISION` 対応していません |
|
||||
| E011-03 | DECIMALおよびNUMERICデータ型 | 部分的{.text-warning} | のみ `DECIMAL(p,s)` サポートされています。 `NUMERIC` |
|
||||
| E011-04 | 算術演算子 | はい。{.text-success} | |
|
||||
| E011-05 | 数値比較 | はい。{.text-success} | |
|
||||
| E011-06 | 数値データ型間の暗黙的なキャスト | いいえ。{.text-danger} | ANSI SQLできる任意の暗黙的な数値型の間のキャストがClickHouseに依存しての機能を有する複数の過負荷の代わりに暗黙的なキャスト |
|
||||
| E011-01 | 整数およびSMALLINTデータ型 | はい。 {.text-success} | |
|
||||
| E011-02 | 実数、倍精度および浮動小数点データ型データ型 | 部分的 {.text-warning} | `FLOAT(<binary_precision>)`, `REAL` と `DOUBLE PRECISION` 対応していません |
|
||||
| E011-03 | DECIMALおよびNUMERICデータ型 | 部分的 {.text-warning} | のみ `DECIMAL(p,s)` サポートされています。 `NUMERIC` |
|
||||
| E011-04 | 算術演算子 | はい。 {.text-success} | |
|
||||
| E011-05 | 数値比較 | はい。 {.text-success} | |
|
||||
| E011-06 | 数値データ型間の暗黙的なキャスト | いいえ。 {.text-danger} | ANSI SQLできる任意の暗黙的な数値型の間のキャストがClickHouseに依存しての機能を有する複数の過負荷の代わりに暗黙的なキャスト |
|
||||
| **E021** | **文字列タイプ** | **部分的**{.text-warning} | |
|
||||
| E021-01 | 文字データ型 | いいえ。{.text-danger} | |
|
||||
| E021-02 | 文字変化型データ型 | いいえ。{.text-danger} | `String` 動作同様に、長さの制限内 |
|
||||
| E021-03 | 文字リテラル | 部分的{.text-warning} | 連続したリテラルと文字セットの自動連結はサポートされません |
|
||||
| E021-04 | CHARACTER_LENGTH関数 | 部分的{.text-warning} | いいえ。 `USING` 句 |
|
||||
| E021-05 | OCTET_LENGTH関数 | いいえ。{.text-danger} | `LENGTH` 同様に動作します |
|
||||
| E021-06 | SUBSTRING | 部分的{.text-warning} | サポートなし `SIMILAR` と `ESCAPE` 句、ない `SUBSTRING_REGEX` バリアント |
|
||||
| E021-07 | 文字の連結 | 部分的{.text-warning} | いいえ。 `COLLATE` 句 |
|
||||
| E021-08 | 上部および下の機能 | はい。{.text-success} | |
|
||||
| E021-09 | トリム機能 | はい。{.text-success} | |
|
||||
| E021-10 | 固定長および可変長文字ストリング型間の暗黙的なキャスト | いいえ。{.text-danger} | ANSI SQLできる任意の暗黙の間のキャスト文字列の種類がClickHouseに依存しての機能を有する複数の過負荷の代わりに暗黙的なキャスト |
|
||||
| E021-11 | 位置関数 | 部分的{.text-warning} | サポートなし `IN` と `USING` 句、ない `POSITION_REGEX` バリアント |
|
||||
| E021-12 | 文字の比較 | はい。{.text-success} | |
|
||||
| E021-02 | 文字変化型データ型 | いいえ。 {.text-danger} | `String` 動作同様に、長さの制限内 |
|
||||
| E021-03 | 文字リテラル | 部分的 {.text-warning} | 連続したリテラルと文字セットの自動連結はサポートされません |
|
||||
| E021-04 | CHARACTER_LENGTH関数 | 部分的 {.text-warning} | いいえ。 `USING` 句 |
|
||||
| E021-05 | OCTET_LENGTH関数 | いいえ。 {.text-danger} | `LENGTH` 同様に動作します |
|
||||
| E021-06 | SUBSTRING | 部分的 {.text-warning} | サポートなし `SIMILAR` と `ESCAPE` 句、ない `SUBSTRING_REGEX` バリアント |
|
||||
| E021-07 | 文字の連結 | 部分的 {.text-warning} | いいえ。 `COLLATE` 句 |
|
||||
| E021-08 | 上部および下の機能 | はい。 {.text-success} | |
|
||||
| E021-09 | トリム機能 | はい。 {.text-success} | |
|
||||
| E021-10 | 固定長および可変長文字ストリング型間の暗黙的なキャスト | いいえ。 {.text-danger} | ANSI SQLできる任意の暗黙の間のキャスト文字列の種類がClickHouseに依存しての機能を有する複数の過負荷の代わりに暗黙的なキャスト |
|
||||
| E021-11 | 位置関数 | 部分的 {.text-warning} | サポートなし `IN` と `USING` 句、ない `POSITION_REGEX` バリアント |
|
||||
| E021-12 | 文字の比較 | はい。 {.text-success} | |
|
||||
| **E031** | **識別子** | **部分的**{.text-warning} | |
|
||||
| E031-01 | 区切り識別子 | 部分的{.text-warning} | Unicodeリテラルの支援は限られ |
|
||||
| E031-02 | 小文字の識別子 | はい。{.text-success} | |
|
||||
| E031-03 | 末尾のアンダースコア | はい。{.text-success} | |
|
||||
| E031-01 | 区切り識別子 | 部分的 {.text-warning} | Unicodeリテラルの支援は限られ |
|
||||
| E031-02 | 小文字の識別子 | はい。 {.text-success} | |
|
||||
| E031-03 | 末尾のアンダースコア | はい。 {.text-success} | |
|
||||
| **E051** | **基本的なクエリ仕様** | **部分的**{.text-warning} | |
|
||||
| E051-01 | SELECT DISTINCT | はい。{.text-success} | |
|
||||
| E051-02 | GROUP BY句 | はい。{.text-success} | |
|
||||
| E051-04 | グループによる列を含むことができない `<select list>` | はい。{.text-success} | |
|
||||
| E051-05 | 選択した項目の名前を変更できます | はい。{.text-success} | |
|
||||
| E051-06 | 句を持つ | はい。{.text-success} | |
|
||||
| E051-07 | 選択リストの修飾\* | はい。{.text-success} | |
|
||||
| E051-08 | FROM句の相関名 | はい。{.text-success} | |
|
||||
| E051-09 | FROM句の列の名前を変更します | いいえ。{.text-danger} | |
|
||||
| E051-01 | SELECT DISTINCT | はい。 {.text-success} | |
|
||||
| E051-02 | GROUP BY句 | はい。 {.text-success} | |
|
||||
| E051-04 | グループによる列を含むことができない `<select list>` | はい。 {.text-success} | |
|
||||
| E051-05 | 選択した項目の名前を変更できます | はい。 {.text-success} | |
|
||||
| E051-06 | 句を持つ | はい。 {.text-success} | |
|
||||
| E051-07 | 選択リストの修飾\* | はい。 {.text-success} | |
|
||||
| E051-08 | FROM句の相関名 | はい。 {.text-success} | |
|
||||
| E051-09 | FROM句の列の名前を変更します | いいえ。 {.text-danger} | |
|
||||
| **E061** | **基本的な述語と検索条件** | **部分的**{.text-warning} | |
|
||||
| E061-01 | 比較述語 | はい。{.text-success} | |
|
||||
| E061-02 | 述語の間 | 部分的{.text-warning} | いいえ。 `SYMMETRIC` と `ASYMMETRIC` 句 |
|
||||
| E061-03 | 値のリストを持つ述語で | はい。{.text-success} | |
|
||||
| E061-04 | 述語のように | はい。{.text-success} | |
|
||||
| E061-05 | LIKE述語:エスケープ句 | いいえ。{.text-danger} | |
|
||||
| E061-06 | Null述語 | はい。{.text-success} | |
|
||||
| E061-07 | 定量化された比較述語 | いいえ。{.text-danger} | |
|
||||
| E061-08 | 存在する述語 | いいえ。{.text-danger} | |
|
||||
| E061-09 | 比較述語のサブクエリ | はい。{.text-success} | |
|
||||
| E061-11 | In述語のサブクエリ | はい。{.text-success} | |
|
||||
| E061-12 | 定量化された比較述語のサブクエリ | いいえ。{.text-danger} | |
|
||||
| E061-13 | 相関サブクエリ | いいえ。{.text-danger} | |
|
||||
| E061-14 | 検索条件 | はい。{.text-success} | |
|
||||
| E061-01 | 比較述語 | はい。 {.text-success} | |
|
||||
| E061-02 | 述語の間 | 部分的 {.text-warning} | いいえ。 `SYMMETRIC` と `ASYMMETRIC` 句 |
|
||||
| E061-03 | 値のリストを持つ述語で | はい。 {.text-success} | |
|
||||
| E061-04 | 述語のように | はい。 {.text-success} | |
|
||||
| E061-05 | LIKE述語:エスケープ句 | いいえ。 {.text-danger} | |
|
||||
| E061-06 | Null述語 | はい。 {.text-success} | |
|
||||
| E061-07 | 定量化された比較述語 | いいえ。 {.text-danger} | |
|
||||
| E061-08 | 存在する述語 | いいえ。 {.text-danger} | |
|
||||
| E061-09 | 比較述語のサブクエリ | はい。 {.text-success} | |
|
||||
| E061-11 | In述語のサブクエリ | はい。 {.text-success} | |
|
||||
| E061-12 | 定量化された比較述語のサブクエリ | いいえ。 {.text-danger} | |
|
||||
| E061-13 | 相関サブクエリ | いいえ。 {.text-danger} | |
|
||||
| E061-14 | 検索条件 | はい。 {.text-success} | |
|
||||
| **E071** | **基本的なクエリ式** | **部分的**{.text-warning} | |
|
||||
| E071-01 | UNION DISTINCTテーブル演算子 | いいえ。{.text-danger} | |
|
||||
| E071-02 | UNION ALLテーブル演算子 | はい。{.text-success} | |
|
||||
| E071-03 | DISTINCTテーブル演算子を除く | いいえ。{.text-danger} | |
|
||||
| E071-05 | 列の結合経由でテーブル事業者の必要のない全く同じデータ型 | はい。{.text-success} | |
|
||||
| E071-06 | サブクエリ内のテーブル演算子 | はい。{.text-success} | |
|
||||
| E071-01 | UNION DISTINCTテーブル演算子 | いいえ。 {.text-danger} | |
|
||||
| E071-02 | UNION ALLテーブル演算子 | はい。 {.text-success} | |
|
||||
| E071-03 | DISTINCTテーブル演算子を除く | いいえ。 {.text-danger} | |
|
||||
| E071-05 | 列の結合経由でテーブル事業者の必要のない全く同じデータ型 | はい。 {.text-success} | |
|
||||
| E071-06 | サブクエリ内のテーブル演算子 | はい。 {.text-success} | |
|
||||
| **E081** | **基本権限** | **部分的**{.text-warning} | 進行中の作業 |
|
||||
| **E091** | **関数の設定** | **はい。**{.text-success} | |
|
||||
| E091-01 | AVG | はい。{.text-success} | |
|
||||
| E091-02 | COUNT | はい。{.text-success} | |
|
||||
| E091-03 | MAX | はい。{.text-success} | |
|
||||
| E091-04 | MIN | はい。{.text-success} | |
|
||||
| E091-05 | SUM | はい。{.text-success} | |
|
||||
| E091-06 | すべての量指定子 | いいえ。{.text-danger} | |
|
||||
| E091-07 | 異なる量指定子 | 部分的{.text-warning} | な集計機能に対応 |
|
||||
| E091-01 | AVG | はい。 {.text-success} | |
|
||||
| E091-02 | COUNT | はい。 {.text-success} | |
|
||||
| E091-03 | MAX | はい。 {.text-success} | |
|
||||
| E091-04 | MIN | はい。 {.text-success} | |
|
||||
| E091-05 | SUM | はい。 {.text-success} | |
|
||||
| E091-06 | すべての量指定子 | いいえ。 {.text-danger} | |
|
||||
| E091-07 | 異なる量指定子 | 部分的 {.text-warning} | な集計機能に対応 |
|
||||
| **E101** | **基本的なデータ操作** | **部分的**{.text-warning} | |
|
||||
| E101-01 | INSERT文 | はい。{.text-success} | 注:ClickHouseの主キーは、 `UNIQUE` 制約 |
|
||||
| E101-03 | 検索されたUPDATE文 | いいえ。{.text-danger} | そこには `ALTER UPDATE` バッチデータ変更のための命令 |
|
||||
| E101-04 | 検索されたDELETE文 | いいえ。{.text-danger} | そこには `ALTER DELETE` バッチデータ削除のための命令 |
|
||||
| E101-01 | INSERT文 | はい。 {.text-success} | 注:ClickHouseの主キーは、 `UNIQUE` 制約 |
|
||||
| E101-03 | 検索されたUPDATE文 | いいえ。 {.text-danger} | そこには `ALTER UPDATE` バッチデータ変更のための命令 |
|
||||
| E101-04 | 検索されたDELETE文 | いいえ。 {.text-danger} | そこには `ALTER DELETE` バッチデータ削除のための命令 |
|
||||
| **E111** | **単一行SELECTステートメント** | **いいえ。**{.text-danger} | |
|
||||
| **E121** | **基本的にカーソルを支援** | **いいえ。**{.text-danger} | |
|
||||
| E121-01 | DECLARE CURSOR | いいえ。{.text-danger} | |
|
||||
| E121-02 | ORDER BY列を選択リストに含める必要はありません | いいえ。{.text-danger} | |
|
||||
| E121-03 | ORDER BY句の値式 | いいえ。{.text-danger} | |
|
||||
| E121-04 | 開いた声明 | いいえ。{.text-danger} | |
|
||||
| E121-06 | 位置付きUPDATE文 | いいえ。{.text-danger} | |
|
||||
| E121-07 | 位置づけDELETEステートメント | いいえ。{.text-danger} | |
|
||||
| E121-08 | 閉じる文 | いいえ。{.text-danger} | |
|
||||
| E121-10 | FETCHステートメント:暗黙的なNEXT | いいえ。{.text-danger} | |
|
||||
| E121-17 | ホールドカーソル付き | いいえ。{.text-danger} | |
|
||||
| E121-01 | DECLARE CURSOR | いいえ。 {.text-danger} | |
|
||||
| E121-02 | ORDER BY列を選択リストに含める必要はありません | いいえ。 {.text-danger} | |
|
||||
| E121-03 | ORDER BY句の値式 | いいえ。 {.text-danger} | |
|
||||
| E121-04 | 開いた声明 | いいえ。 {.text-danger} | |
|
||||
| E121-06 | 位置付きUPDATE文 | いいえ。 {.text-danger} | |
|
||||
| E121-07 | 位置づけDELETEステートメント | いいえ。 {.text-danger} | |
|
||||
| E121-08 | 閉じる文 | いいえ。 {.text-danger} | |
|
||||
| E121-10 | FETCHステートメント:暗黙的なNEXT | いいえ。 {.text-danger} | |
|
||||
| E121-17 | ホールドカーソル付き | いいえ。 {.text-danger} | |
|
||||
| **E131** | **Null値のサポート(値の代わりにnull)** | **部分的**{.text-warning} | 一部の制限が適用されます |
|
||||
| **E141** | **基本的な整合性制約** | **部分的**{.text-warning} | |
|
||||
| E141-01 | NULLでない制約 | はい。{.text-success} | 注: `NOT NULL` は黙示のためのテーブル列によるデフォルト |
|
||||
| E141-02 | NULLでない列の一意制約 | いいえ。{.text-danger} | |
|
||||
| E141-03 | 主キー制約 | いいえ。{.text-danger} | |
|
||||
| E141-04 | 参照削除アクションと参照updateアクションの両方に対するNO ACTIONのデフォルトを持つ基本外部キー制約 | いいえ。{.text-danger} | |
|
||||
| E141-06 | 制約のチェック | はい。{.text-success} | |
|
||||
| E141-07 | 列の既定値 | はい。{.text-success} | |
|
||||
| E141-08 | 主キーで推論されるNULLではありません | はい。{.text-success} | |
|
||||
| E141-10 | 外部キーの名前は任意の順序で指定できます | いいえ。{.text-danger} | |
|
||||
| E141-01 | NULLでない制約 | はい。 {.text-success} | 注: `NOT NULL` は黙示のためのテーブル列によるデフォルト |
|
||||
| E141-02 | NULLでない列の一意制約 | いいえ。 {.text-danger} | |
|
||||
| E141-03 | 主キー制約 | いいえ。 {.text-danger} | |
|
||||
| E141-04 | 参照削除アクションと参照updateアクションの両方に対するNO ACTIONのデフォルトを持つ基本外部キー制約 | いいえ。 {.text-danger} | |
|
||||
| E141-06 | 制約のチェック | はい。 {.text-success} | |
|
||||
| E141-07 | 列の既定値 | はい。 {.text-success} | |
|
||||
| E141-08 | 主キーで推論されるNULLではありません | はい。 {.text-success} | |
|
||||
| E141-10 | 外部キーの名前は任意の順序で指定できます | いいえ。 {.text-danger} | |
|
||||
| **E151** | **取引サポート** | **いいえ。**{.text-danger} | |
|
||||
| E151-01 | COMMIT文 | いいえ。{.text-danger} | |
|
||||
| E151-02 | ROLLBACKステートメント | いいえ。{.text-danger} | |
|
||||
| E151-01 | COMMIT文 | いいえ。 {.text-danger} | |
|
||||
| E151-02 | ROLLBACKステートメント | いいえ。 {.text-danger} | |
|
||||
| **E152** | **基本セット取引明細書** | **いいえ。**{.text-danger} | |
|
||||
| E152-01 | SET TRANSACTION文:分離レベルSERIALIZABLE句 | いいえ。{.text-danger} | |
|
||||
| E152-02 | SET TRANSACTION文:READ ONLY句とREAD WRITE句 | いいえ。{.text-danger} | |
|
||||
| E152-01 | SET TRANSACTION文:分離レベルSERIALIZABLE句 | いいえ。 {.text-danger} | |
|
||||
| E152-02 | SET TRANSACTION文:READ ONLY句とREAD WRITE句 | いいえ。 {.text-danger} | |
|
||||
| **E153** | **サブクエリを使用した更新可能なクエリ** | **いいえ。**{.text-danger} | |
|
||||
| **E161** | **先頭のdouble minusを使用したSQLコメント** | **はい。**{.text-success} | |
|
||||
| **E171** | **SQLSTATEサポート** | **いいえ。**{.text-danger} | |
|
||||
| **E182** | **ホスト言語バインド** | **いいえ。**{.text-danger} | |
|
||||
| **F031** | **基本的なスキーマ操作** | **部分的**{.text-warning} | |
|
||||
| F031-01 | 永続ベーステーブルを作成するCREATE TABLE文 | 部分的{.text-warning} | いいえ。 `SYSTEM VERSIONING`, `ON COMMIT`, `GLOBAL`, `LOCAL`, `PRESERVE`, `DELETE`, `REF IS`, `WITH OPTIONS`, `UNDER`, `LIKE`, `PERIOD FOR` 句およびユーザー解決データ型のサポートなし |
|
||||
| F031-02 | CREATE VIEW文 | 部分的{.text-warning} | いいえ。 `RECURSIVE`, `CHECK`, `UNDER`, `WITH OPTIONS` 句およびユーザー解決データ型のサポートなし |
|
||||
| F031-03 | グラント声明 | はい。{.text-success} | |
|
||||
| F031-04 | ALTER TABLE文:ADD COLUMN句 | 部分的{.text-warning} | サポートなし `GENERATED` 節およびシステム期間 |
|
||||
| F031-13 | DROP TABLE文:RESTRICT句 | いいえ。{.text-danger} | |
|
||||
| F031-16 | DROP VIEW文:RESTRICT句 | いいえ。{.text-danger} | |
|
||||
| F031-19 | REVOKEステートメント:RESTRICT句 | いいえ。{.text-danger} | |
|
||||
| F031-01 | 永続ベーステーブルを作成するCREATE TABLE文 | 部分的 {.text-warning} | いいえ。 `SYSTEM VERSIONING`, `ON COMMIT`, `GLOBAL`, `LOCAL`, `PRESERVE`, `DELETE`, `REF IS`, `WITH OPTIONS`, `UNDER`, `LIKE`, `PERIOD FOR` 句およびユーザー解決データ型のサポートなし |
|
||||
| F031-02 | CREATE VIEW文 | 部分的 {.text-warning} | いいえ。 `RECURSIVE`, `CHECK`, `UNDER`, `WITH OPTIONS` 句およびユーザー解決データ型のサポートなし |
|
||||
| F031-03 | グラント声明 | はい。 {.text-success} | |
|
||||
| F031-04 | ALTER TABLE文:ADD COLUMN句 | 部分的 {.text-warning} | サポートなし `GENERATED` 節およびシステム期間 |
|
||||
| F031-13 | DROP TABLE文:RESTRICT句 | いいえ。 {.text-danger} | |
|
||||
| F031-16 | DROP VIEW文:RESTRICT句 | いいえ。 {.text-danger} | |
|
||||
| F031-19 | REVOKEステートメント:RESTRICT句 | いいえ。 {.text-danger} | |
|
||||
| **F041** | **基本的な結合テーブル** | **部分的**{.text-warning} | |
|
||||
| F041-01 | Inner join必ずというわけではないが、内側のキーワード) | はい。{.text-success} | |
|
||||
| F041-02 | 内部キーワード | はい。{.text-success} | |
|
||||
| F041-03 | LEFT OUTER JOIN | はい。{.text-success} | |
|
||||
| F041-04 | RIGHT OUTER JOIN | はい。{.text-success} | |
|
||||
| F041-05 | 外部結合は入れ子にできます | はい。{.text-success} | |
|
||||
| F041-07 | 左外部結合または右外部結合の内部テーブルは、内部結合でも使用できます | はい。{.text-success} | |
|
||||
| F041-08 | すべての比較演算子がサポ) | いいえ。{.text-danger} | |
|
||||
| F041-01 | Inner join必ずというわけではないが、内側のキーワード) | はい。 {.text-success} | |
|
||||
| F041-02 | 内部キーワード | はい。 {.text-success} | |
|
||||
| F041-03 | LEFT OUTER JOIN | はい。 {.text-success} | |
|
||||
| F041-04 | RIGHT OUTER JOIN | はい。 {.text-success} | |
|
||||
| F041-05 | 外部結合は入れ子にできます | はい。 {.text-success} | |
|
||||
| F041-07 | 左外部結合または右外部結合の内部テーブルは、内部結合でも使用できます | はい。 {.text-success} | |
|
||||
| F041-08 | すべての比較演算子がサポ) | いいえ。 {.text-danger} | |
|
||||
| **F051** | **基本日時** | **部分的**{.text-warning} | |
|
||||
| F051-01 | 日付データ型(日付リテラルのサポートを含む) | 部分的{.text-warning} | リテラルなし |
|
||||
| F051-02 | 秒の小数部の精度が0以上の時刻データ型(時刻リテラルのサポートを含む) | いいえ。{.text-danger} | |
|
||||
| F051-03 | タイムスタンプのデータ型を含む支援のタイムスタンプ文字と小数点以下の秒の精度で少なくとも0-6 | いいえ。{.text-danger} | `DateTime64` timeは同様の機能を提供します |
|
||||
| F051-04 | 日付、時刻、およびタイムスタンプのデータ型の比較述語 | 部分的{.text-warning} | 使用可能なデータ型は一つだけです |
|
||||
| F051-05 | Datetime型と文字列型の間の明示的なキャスト | はい。{.text-success} | |
|
||||
| F051-06 | CURRENT_DATE | いいえ。{.text-danger} | `today()` 似ています |
|
||||
| F051-07 | LOCALTIME | いいえ。{.text-danger} | `now()` 似ています |
|
||||
| F051-08 | LOCALTIMESTAMP | いいえ。{.text-danger} | |
|
||||
| F051-01 | 日付データ型(日付リテラルのサポートを含む) | 部分的 {.text-warning} | リテラルなし |
|
||||
| F051-02 | 秒の小数部の精度が0以上の時刻データ型(時刻リテラルのサポートを含む) | いいえ。 {.text-danger} | |
|
||||
| F051-03 | タイムスタンプのデータ型を含む支援のタイムスタンプ文字と小数点以下の秒の精度で少なくとも0-6 | いいえ。 {.text-danger} | `DateTime64` timeは同様の機能を提供します |
|
||||
| F051-04 | 日付、時刻、およびタイムスタンプのデータ型の比較述語 | 部分的 {.text-warning} | 使用可能なデータ型は一つだけです |
|
||||
| F051-05 | Datetime型と文字列型の間の明示的なキャスト | はい。 {.text-success} | |
|
||||
| F051-06 | CURRENT_DATE | いいえ。 {.text-danger} | `today()` 似ています |
|
||||
| F051-07 | LOCALTIME | いいえ。 {.text-danger} | `now()` 似ています |
|
||||
| F051-08 | LOCALTIMESTAMP | いいえ。 {.text-danger} | |
|
||||
| **F081** | **ビュー内の組合および除く** | **部分的**{.text-warning} | |
|
||||
| **F131** | **グループ化操作** | **部分的**{.text-warning} | |
|
||||
| F131-01 | ここで、グループにより、条項対応してクエリを処理するクラウドの場合グ眺望 | はい。{.text-success} | |
|
||||
| F131-02 | グループ化されたビュ | はい。{.text-success} | |
|
||||
| F131-03 | セット機能に対応してクエリを処理するクラウドの場合グ眺望 | はい。{.text-success} | |
|
||||
| F131-04 | GROUP BY句とHAVING句およびグループ化ビューを持つサブクエリ | はい。{.text-success} | |
|
||||
| F131-05 | GROUP BY句およびHAVING句およびグループ化ビューを使用した単一行選択 | いいえ。{.text-danger} | |
|
||||
| F131-01 | ここで、グループにより、条項対応してクエリを処理するクラウドの場合グ眺望 | はい。 {.text-success} | |
|
||||
| F131-02 | グループ化されたビュ | はい。 {.text-success} | |
|
||||
| F131-03 | セット機能に対応してクエリを処理するクラウドの場合グ眺望 | はい。 {.text-success} | |
|
||||
| F131-04 | GROUP BY句とHAVING句およびグループ化ビューを持つサブクエリ | はい。 {.text-success} | |
|
||||
| F131-05 | GROUP BY句およびHAVING句およびグループ化ビューを使用した単一行選択 | いいえ。 {.text-danger} | |
|
||||
| **F181** | **複数モジュール対応** | **いいえ。**{.text-danger} | |
|
||||
| **F201** | **キャスト機能** | **はい。**{.text-success} | |
|
||||
| **F221** | **明示的な既定値** | **いいえ。**{.text-danger} | |
|
||||
| **F261** | **大文字と小文字の式** | **はい。**{.text-success} | |
|
||||
| F261-01 | 簡単な場合 | はい。{.text-success} | |
|
||||
| F261-02 | 検索ケース | はい。{.text-success} | |
|
||||
| F261-03 | NULLIF | はい。{.text-success} | |
|
||||
| F261-04 | COALESCE | はい。{.text-success} | |
|
||||
| F261-01 | 簡単な場合 | はい。 {.text-success} | |
|
||||
| F261-02 | 検索ケース | はい。 {.text-success} | |
|
||||
| F261-03 | NULLIF | はい。 {.text-success} | |
|
||||
| F261-04 | COALESCE | はい。 {.text-success} | |
|
||||
| **F311** | **スキーマ定義文** | **部分的**{.text-warning} | |
|
||||
| F311-01 | CREATE SCHEMA | いいえ。{.text-danger} | |
|
||||
| F311-02 | 永続ベーステーブルのテーブルの作成 | はい。{.text-success} | |
|
||||
| F311-03 | CREATE VIEW | はい。{.text-success} | |
|
||||
| F311-04 | CREATE VIEW: WITH CHECK OPTION | いいえ。{.text-danger} | |
|
||||
| F311-05 | グラント声明 | はい。{.text-success} | |
|
||||
| F311-01 | CREATE SCHEMA | いいえ。 {.text-danger} | |
|
||||
| F311-02 | 永続ベーステーブルのテーブルの作成 | はい。 {.text-success} | |
|
||||
| F311-03 | CREATE VIEW | はい。 {.text-success} | |
|
||||
| F311-04 | CREATE VIEW: WITH CHECK OPTION | いいえ。 {.text-danger} | |
|
||||
| F311-05 | グラント声明 | はい。 {.text-success} | |
|
||||
| **F471** | **スカラーサブクエリ値** | **はい。**{.text-success} | |
|
||||
| **F481** | **展開されたNULL述語** | **はい。**{.text-success} | |
|
||||
| **F812** | **基本的なフラグ設定** | **いいえ。**{.text-danger} | |
|
||||
| **T321** | **基本的なSQL呼び出しルーチン** | **いいえ。**{.text-danger} | |
|
||||
| T321-01 | オーバーロードのないユーザー定義関数 | いいえ。{.text-danger} | |
|
||||
| T321-02 | 過負荷のないユーザー定義ストアドプロシージャ | いいえ。{.text-danger} | |
|
||||
| T321-03 | 関数呼び出し | いいえ。{.text-danger} | |
|
||||
| T321-04 | CALL文 | いいえ。{.text-danger} | |
|
||||
| T321-05 | RETURN文 | いいえ。{.text-danger} | |
|
||||
| T321-01 | オーバーロードのないユーザー定義関数 | いいえ。 {.text-danger} | |
|
||||
| T321-02 | 過負荷のないユーザー定義ストアドプロシージャ | いいえ。 {.text-danger} | |
|
||||
| T321-03 | 関数呼び出し | いいえ。 {.text-danger} | |
|
||||
| T321-04 | CALL文 | いいえ。 {.text-danger} | |
|
||||
| T321-05 | RETURN文 | いいえ。 {.text-danger} | |
|
||||
| **T631** | **一つのリスト要素を持つ述語で** | **はい。**{.text-success} | |
|
||||
|
1
docs/ja/sql-reference/data-types/lowcardinality.md
Normal file
1
docs/ja/sql-reference/data-types/lowcardinality.md
Normal file
@ -0,0 +1 @@
|
||||
../../../../en/sql-reference/data-types/lowcardinality.md
|
@ -259,8 +259,8 @@ Mac OS X:
|
||||
|
||||
sudo apt install wget xz-utils
|
||||
|
||||
wget https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz
|
||||
wget https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz
|
||||
wget https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz
|
||||
wget https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz
|
||||
|
||||
xz -v -d hits_v1.tsv.xz
|
||||
xz -v -d visits_v1.tsv.xz
|
||||
|
@ -582,7 +582,7 @@ Fork для распараллеливания не используется.
|
||||
|
||||
**14.** Возврат значений.
|
||||
|
||||
В большинстве случаев, просто возвращайте значение с помощью `return`. Не пишите `[return std::move(res)]{.strike}`.
|
||||
В большинстве случаев, просто возвращайте значение с помощью `return`. Не пишите `return std::move(res)`.
|
||||
|
||||
Если внутри функции создаётся объект на куче и отдаётся наружу, то возвращайте `shared_ptr` или `unique_ptr`.
|
||||
|
||||
@ -676,7 +676,7 @@ Loader() {}
|
||||
**24.** Не нужно использовать `trailing return type` для функций, если в этом нет необходимости.
|
||||
|
||||
``` cpp
|
||||
[auto f() -> void;]{.strike}
|
||||
auto f() -> void
|
||||
```
|
||||
|
||||
**25.** Объявление и инициализация переменных.
|
||||
|
@ -5,14 +5,14 @@ toc_title: "\u0410\u043d\u043e\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u
|
||||
|
||||
# Анонимизированные данные Яндекс.Метрики {#anonimizirovannye-dannye-iandeks-metriki}
|
||||
|
||||
Датасет состоит из двух таблиц, содержащих анонимизированные данные о хитах (`hits_v1`) и визитах (`visits_v1`) Яндекс.Метрики. Каждую из таблиц можно скачать в виде сжатого `.tsv.xz`-файла или в виде уже готовых партиций. Также можно скачать расширенную версию таблицы `hits`, содержащую 100 миллионов строк в виде [архива c файлами TSV](https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_100m_obfuscated_v1.tsv.xz) и в виде [готовых партиций](https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_100m_obfuscated_v1.tar.xz).
|
||||
Датасет состоит из двух таблиц, содержащих анонимизированные данные о хитах (`hits_v1`) и визитах (`visits_v1`) Яндекс.Метрики. Каждую из таблиц можно скачать в виде сжатого `.tsv.xz`-файла или в виде уже готовых партиций. Также можно скачать расширенную версию таблицы `hits`, содержащую 100 миллионов строк в виде [архива c файлами TSV](https://datasets.clickhouse.tech/hits/tsv/hits_100m_obfuscated_v1.tsv.xz) и в виде [готовых партиций](https://datasets.clickhouse.tech/hits/partitions/hits_100m_obfuscated_v1.tar.xz).
|
||||
|
||||
## Получение таблиц из партиций {#poluchenie-tablits-iz-partitsii}
|
||||
|
||||
**Скачивание и импортирование партиций hits:**
|
||||
|
||||
``` bash
|
||||
$ curl -O https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_v1.tar
|
||||
$ curl -O https://datasets.clickhouse.tech/hits/partitions/hits_v1.tar
|
||||
$ tar xvf hits_v1.tar -C /var/lib/clickhouse # путь к папке с данными ClickHouse
|
||||
$ # убедитесь, что установлены корректные права доступа на файлы
|
||||
$ sudo service clickhouse-server restart
|
||||
@ -22,7 +22,7 @@ $ clickhouse-client --query "SELECT COUNT(*) FROM datasets.hits_v1"
|
||||
**Скачивание и импортирование партиций visits:**
|
||||
|
||||
``` bash
|
||||
$ curl -O https://clickhouse-datasets.s3.yandex.net/visits/partitions/visits_v1.tar
|
||||
$ curl -O https://datasets.clickhouse.tech/visits/partitions/visits_v1.tar
|
||||
$ tar xvf visits_v1.tar -C /var/lib/clickhouse # путь к папке с данными ClickHouse
|
||||
$ # убедитесь, что установлены корректные права доступа на файлы
|
||||
$ sudo service clickhouse-server restart
|
||||
@ -34,7 +34,7 @@ $ clickhouse-client --query "SELECT COUNT(*) FROM datasets.visits_v1"
|
||||
**Скачивание и импортирование hits из сжатого tsv-файла**
|
||||
|
||||
``` bash
|
||||
$ curl https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
$ curl https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
$ # теперь создадим таблицу
|
||||
$ clickhouse-client --query "CREATE DATABASE IF NOT EXISTS datasets"
|
||||
$ clickhouse-client --query "CREATE TABLE datasets.hits_v1 ( WatchID UInt64, JavaEnable UInt8, Title String, GoodEvent Int16, EventTime DateTime, EventDate Date, CounterID UInt32, ClientIP UInt32, ClientIP6 FixedString(16), RegionID UInt32, UserID UInt64, CounterClass Int8, OS UInt8, UserAgent UInt8, URL String, Referer String, URLDomain String, RefererDomain String, Refresh UInt8, IsRobot UInt8, RefererCategories Array(UInt16), URLCategories Array(UInt16), URLRegions Array(UInt32), RefererRegions Array(UInt32), ResolutionWidth UInt16, ResolutionHeight UInt16, ResolutionDepth UInt8, FlashMajor UInt8, FlashMinor UInt8, FlashMinor2 String, NetMajor UInt8, NetMinor UInt8, UserAgentMajor UInt16, UserAgentMinor FixedString(2), CookieEnable UInt8, JavascriptEnable UInt8, IsMobile UInt8, MobilePhone UInt8, MobilePhoneModel String, Params String, IPNetworkID UInt32, TraficSourceID Int8, SearchEngineID UInt16, SearchPhrase String, AdvEngineID UInt8, IsArtifical UInt8, WindowClientWidth UInt16, WindowClientHeight UInt16, ClientTimeZone Int16, ClientEventTime DateTime, SilverlightVersion1 UInt8, SilverlightVersion2 UInt8, SilverlightVersion3 UInt32, SilverlightVersion4 UInt16, PageCharset String, CodeVersion UInt32, IsLink UInt8, IsDownload UInt8, IsNotBounce UInt8, FUniqID UInt64, HID UInt32, IsOldCounter UInt8, IsEvent UInt8, IsParameter UInt8, DontCountHits UInt8, WithHash UInt8, HitColor FixedString(1), UTCEventTime DateTime, Age UInt8, Sex UInt8, Income UInt8, Interests UInt16, Robotness UInt8, GeneralInterests Array(UInt16), RemoteIP UInt32, RemoteIP6 FixedString(16), WindowName Int32, OpenerName Int32, HistoryLength Int16, BrowserLanguage FixedString(2), BrowserCountry FixedString(2), SocialNetwork String, SocialAction String, HTTPError UInt16, SendTiming Int32, DNSTiming Int32, ConnectTiming Int32, ResponseStartTiming Int32, ResponseEndTiming Int32, FetchTiming Int32, RedirectTiming Int32, DOMInteractiveTiming Int32, DOMContentLoadedTiming Int32, DOMCompleteTiming Int32, LoadEventStartTiming Int32, LoadEventEndTiming Int32, NSToDOMContentLoadedTiming Int32, FirstPaintTiming Int32, RedirectCount Int8, SocialSourceNetworkID UInt8, SocialSourcePage String, ParamPrice Int64, ParamOrderID String, ParamCurrency FixedString(3), ParamCurrencyID UInt16, GoalsReached Array(UInt32), OpenstatServiceName String, OpenstatCampaignID String, OpenstatAdID String, OpenstatSourceID String, UTMSource String, UTMMedium String, UTMCampaign String, UTMContent String, UTMTerm String, FromTag String, HasGCLID UInt8, RefererHash UInt64, URLHash UInt64, CLID UInt32, YCLID UInt64, ShareService String, ShareURL String, ShareTitle String, ParsedParams Nested(Key1 String, Key2 String, Key3 String, Key4 String, Key5 String, ValueDouble Float64), IslandID FixedString(16), RequestNum UInt32, RequestTry UInt8) ENGINE = MergeTree() PARTITION BY toYYYYMM(EventDate) ORDER BY (CounterID, EventDate, intHash32(UserID)) SAMPLE BY intHash32(UserID) SETTINGS index_granularity = 8192"
|
||||
@ -48,7 +48,7 @@ $ clickhouse-client --query "SELECT COUNT(*) FROM datasets.hits_v1"
|
||||
**Скачивание и импортирование visits из сжатого tsv-файла**
|
||||
|
||||
``` bash
|
||||
$ curl https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
$ curl https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
$ # теперь создадим таблицу
|
||||
$ clickhouse-client --query "CREATE DATABASE IF NOT EXISTS datasets"
|
||||
$ clickhouse-client --query "CREATE TABLE datasets.visits_v1 ( CounterID UInt32, StartDate Date, Sign Int8, IsNew UInt8, VisitID UInt64, UserID UInt64, StartTime DateTime, Duration UInt32, UTCStartTime DateTime, PageViews Int32, Hits Int32, IsBounce UInt8, Referer String, StartURL String, RefererDomain String, StartURLDomain String, EndURL String, LinkURL String, IsDownload UInt8, TraficSourceID Int8, SearchEngineID UInt16, SearchPhrase String, AdvEngineID UInt8, PlaceID Int32, RefererCategories Array(UInt16), URLCategories Array(UInt16), URLRegions Array(UInt32), RefererRegions Array(UInt32), IsYandex UInt8, GoalReachesDepth Int32, GoalReachesURL Int32, GoalReachesAny Int32, SocialSourceNetworkID UInt8, SocialSourcePage String, MobilePhoneModel String, ClientEventTime DateTime, RegionID UInt32, ClientIP UInt32, ClientIP6 FixedString(16), RemoteIP UInt32, RemoteIP6 FixedString(16), IPNetworkID UInt32, SilverlightVersion3 UInt32, CodeVersion UInt32, ResolutionWidth UInt16, ResolutionHeight UInt16, UserAgentMajor UInt16, UserAgentMinor UInt16, WindowClientWidth UInt16, WindowClientHeight UInt16, SilverlightVersion2 UInt8, SilverlightVersion4 UInt16, FlashVersion3 UInt16, FlashVersion4 UInt16, ClientTimeZone Int16, OS UInt8, UserAgent UInt8, ResolutionDepth UInt8, FlashMajor UInt8, FlashMinor UInt8, NetMajor UInt8, NetMinor UInt8, MobilePhone UInt8, SilverlightVersion1 UInt8, Age UInt8, Sex UInt8, Income UInt8, JavaEnable UInt8, CookieEnable UInt8, JavascriptEnable UInt8, IsMobile UInt8, BrowserLanguage UInt16, BrowserCountry UInt16, Interests UInt16, Robotness UInt8, GeneralInterests Array(UInt16), Params Array(String), Goals Nested(ID UInt32, Serial UInt32, EventTime DateTime, Price Int64, OrderID String, CurrencyID UInt32), WatchIDs Array(UInt64), ParamSumPrice Int64, ParamCurrency FixedString(3), ParamCurrencyID UInt16, ClickLogID UInt64, ClickEventID Int32, ClickGoodEvent Int32, ClickEventTime DateTime, ClickPriorityID Int32, ClickPhraseID Int32, ClickPageID Int32, ClickPlaceID Int32, ClickTypeID Int32, ClickResourceID Int32, ClickCost UInt32, ClickClientIP UInt32, ClickDomainID UInt32, ClickURL String, ClickAttempt UInt8, ClickOrderID UInt32, ClickBannerID UInt32, ClickMarketCategoryID UInt32, ClickMarketPP UInt32, ClickMarketCategoryName String, ClickMarketPPName String, ClickAWAPSCampaignName String, ClickPageName String, ClickTargetType UInt16, ClickTargetPhraseID UInt64, ClickContextType UInt8, ClickSelectType Int8, ClickOptions String, ClickGroupBannerID Int32, OpenstatServiceName String, OpenstatCampaignID String, OpenstatAdID String, OpenstatSourceID String, UTMSource String, UTMMedium String, UTMCampaign String, UTMContent String, UTMTerm String, FromTag String, HasGCLID UInt8, FirstVisit DateTime, PredLastVisit Date, LastVisit Date, TotalVisits UInt32, TraficSource Nested(ID Int8, SearchEngineID UInt16, AdvEngineID UInt8, PlaceID UInt16, SocialSourceNetworkID UInt8, Domain String, SearchPhrase String, SocialSourcePage String), Attendance FixedString(16), CLID UInt32, YCLID UInt64, NormalizedRefererHash UInt64, SearchPhraseHash UInt64, RefererDomainHash UInt64, NormalizedStartURLHash UInt64, StartURLDomainHash UInt64, NormalizedEndURLHash UInt64, TopLevelDomain UInt64, URLScheme UInt64, OpenstatServiceNameHash UInt64, OpenstatCampaignIDHash UInt64, OpenstatAdIDHash UInt64, OpenstatSourceIDHash UInt64, UTMSourceHash UInt64, UTMMediumHash UInt64, UTMCampaignHash UInt64, UTMContentHash UInt64, UTMTermHash UInt64, FromHash UInt64, WebVisorEnabled UInt8, WebVisorActivity UInt32, ParsedParams Nested(Key1 String, Key2 String, Key3 String, Key4 String, Key5 String, ValueDouble Float64), Market Nested(Type UInt8, GoalID UInt32, OrderID String, OrderPrice Int64, PP UInt32, DirectPlaceID UInt32, DirectOrderID UInt32, DirectBannerID UInt32, GoodID String, GoodName String, GoodQuantity Int32, GoodPrice Int64), IslandID FixedString(16)) ENGINE = CollapsingMergeTree(Sign) PARTITION BY toYYYYMM(StartDate) ORDER BY (CounterID, StartDate, intHash32(UserID), VisitID) SAMPLE BY intHash32(UserID) SETTINGS index_granularity = 8192"
|
||||
|
@ -283,7 +283,7 @@ SELECT formatReadableSize(sum(bytes)) FROM system.parts WHERE table = 'trips_mer
|
||||
## Скачивание готовых партиций {#skachivanie-gotovykh-partitsii}
|
||||
|
||||
``` bash
|
||||
$ curl -O https://clickhouse-datasets.s3.yandex.net/trips_mergetree/partitions/trips_mergetree.tar
|
||||
$ curl -O https://datasets.clickhouse.tech/trips_mergetree/partitions/trips_mergetree.tar
|
||||
$ tar xvf trips_mergetree.tar -C /var/lib/clickhouse # путь к папке с данными ClickHouse
|
||||
$ # убедитесь, что установлены корректные права доступа на файлы
|
||||
$ sudo service clickhouse-server restart
|
||||
|
@ -152,7 +152,7 @@ $ for i in *.zip; do echo $i; unzip -cq $i '*.csv' | sed 's/\.00//g' | clickhous
|
||||
## Скачивание готовых партиций {#skachivanie-gotovykh-partitsii}
|
||||
|
||||
``` bash
|
||||
$ curl -O https://clickhouse-datasets.s3.yandex.net/ontime/partitions/ontime.tar
|
||||
$ curl -O https://datasets.clickhouse.tech/ontime/partitions/ontime.tar
|
||||
$ tar xvf ontime.tar -C /var/lib/clickhouse # путь к папке с данными ClickHouse
|
||||
$ # убедитесь, что установлены корректные права доступа на файлы
|
||||
$ sudo service clickhouse-server restart
|
||||
|
@ -33,7 +33,7 @@ grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not su
|
||||
|
||||
### Из RPM пакетов {#from-rpm-packages}
|
||||
|
||||
Команда ClickHouse в Яндексе рекомендует использовать официальные предкомпилированные `rpm` пакеты для CentOS, RedHad и всех остальных дистрибутивов Linux, основанных на rpm.
|
||||
Команда ClickHouse в Яндексе рекомендует использовать официальные предкомпилированные `rpm` пакеты для CentOS, RedHat и всех остальных дистрибутивов Linux, основанных на rpm.
|
||||
|
||||
Сначала нужно подключить официальный репозиторий:
|
||||
|
||||
|
@ -85,8 +85,8 @@ Now it’s time to fill our ClickHouse server with some sample data. In this tut
|
||||
### Download and Extract Table Data {#download-and-extract-table-data}
|
||||
|
||||
``` bash
|
||||
curl https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
```
|
||||
|
||||
The extracted files are about 10GB in size.
|
||||
|
46
docs/ru/operations/system-tables/distribution_queue.md
Normal file
46
docs/ru/operations/system-tables/distribution_queue.md
Normal file
@ -0,0 +1,46 @@
|
||||
# system.distribution_queue {#system_tables-distribution_queue}
|
||||
|
||||
Содержит информацию о локальных файлах, которые находятся в очереди для отправки на шарды. Эти локальные файлы содержат новые куски, которые создаются путем вставки новых данных в Distributed таблицу в асинхронном режиме.
|
||||
|
||||
Столбцы:
|
||||
|
||||
- `database` ([String](../../sql-reference/data-types/string.md)) — имя базы данных.
|
||||
|
||||
- `table` ([String](../../sql-reference/data-types/string.md)) — имя таблицы.
|
||||
|
||||
- `data_path` ([String](../../sql-reference/data-types/string.md)) — путь к папке с локальными файлами.
|
||||
|
||||
- `is_blocked` ([UInt8](../../sql-reference/data-types/int-uint.md)) — флаг, указывающий на блокировку отправки локальных файлов на шарды.
|
||||
|
||||
- `error_count` ([UInt64](../../sql-reference/data-types/int-uint.md)) — количество ошибок.
|
||||
|
||||
- `data_files` ([UInt64](../../sql-reference/data-types/int-uint.md)) — количество локальных файлов в папке.
|
||||
|
||||
- `data_compressed_bytes` ([UInt64](../../sql-reference/data-types/int-uint.md)) — размер сжатых данных в локальных файлах в байтах.
|
||||
|
||||
- `last_exception` ([String](../../sql-reference/data-types/string.md)) — текстовое сообщение о последней возникшей ошибке, если таковые имеются.
|
||||
|
||||
**Пример**
|
||||
|
||||
``` sql
|
||||
SELECT * FROM system.distribution_queue LIMIT 1 FORMAT Vertical;
|
||||
```
|
||||
|
||||
``` text
|
||||
Row 1:
|
||||
──────
|
||||
database: default
|
||||
table: dist
|
||||
data_path: ./store/268/268bc070-3aad-4b1a-9cf2-4987580161af/default@127%2E0%2E0%2E2:9000/
|
||||
is_blocked: 1
|
||||
error_count: 0
|
||||
data_files: 1
|
||||
data_compressed_bytes: 499
|
||||
last_exception:
|
||||
```
|
||||
|
||||
**Смотрите также**
|
||||
|
||||
- [Движок таблиц Distributed](../../engines/table-engines/special/distributed.md)
|
||||
|
||||
[Оригинальная статья](https://clickhouse.tech/docs/ru/operations/system_tables/distribution_queue) <!--hide-->
|
@ -57,3 +57,5 @@ ORDER BY id
|
||||
- [A Magical Mystery Tour of the LowCardinality Data Type](https://www.altinity.com/blog/2019/3/27/low-cardinality).
|
||||
- [Reducing Clickhouse Storage Cost with the Low Cardinality Type – Lessons from an Instana Engineer](https://www.instana.com/blog/reducing-clickhouse-storage-cost-with-the-low-cardinality-type-lessons-from-an-instana-engineer/).
|
||||
- [String Optimization (video presentation in Russian)](https://youtu.be/rqf-ILRgBdY?list=PL0Z2YDlm0b3iwXCpEFiOOYmwXzVmjJfEt). [Slides in English](https://github.com/yandex/clickhouse-presentations/raw/master/meetup19/string_optimization.pdf).
|
||||
|
||||
[Оригинальная статья](https://clickhouse.tech/docs/ru/sql-reference/data-types/lowcardinality/) <!--hide-->
|
||||
|
@ -593,6 +593,18 @@ SELECT dateDiff('hour', toDateTime('2018-01-01 22:00:00'), toDateTime('2018-01-0
|
||||
Например, `timeSlots(toDateTime('2012-01-01 12:20:00'), toUInt32(600)) = [toDateTime('2012-01-01 12:00:00'), toDateTime('2012-01-01 12:30:00')]`.
|
||||
Это нужно для поиска хитов, входящих в соответствующий визит.
|
||||
|
||||
## toYYYYMM
|
||||
|
||||
Переводит дату или дату со временем в число типа UInt32, содержащее номер года и месяца (YYYY * 100 + MM).
|
||||
|
||||
## toYYYYMMDD
|
||||
|
||||
Переводит дату или дату со временем в число типа UInt32, содержащее номер года, месяца и дня (YYYY * 10000 + MM * 100 + DD).
|
||||
|
||||
## toYYYYMMDDhhmmss
|
||||
|
||||
Переводит дату или дату со временем в число типа UInt64 содержащее номер года, месяца, дня и время (YYYY * 10000000000 + MM * 100000000 + DD * 1000000 + hh * 10000 + mm * 100 + ss).
|
||||
|
||||
## formatDateTime {#formatdatetime}
|
||||
|
||||
Функция преобразует дату-и-время в строку по заданному шаблону. Важно: шаблон — константное выражение, поэтому использовать разные шаблоны в одной колонке не получится.
|
||||
|
@ -56,10 +56,188 @@ toc_title: ORDER BY
|
||||
|
||||
## Поддержка collation {#collation-support}
|
||||
|
||||
Для сортировки по значениям типа String есть возможность указать collation (сравнение). Пример: `ORDER BY SearchPhrase COLLATE 'tr'` - для сортировки по поисковой фразе, по возрастанию, с учётом турецкого алфавита, регистронезависимо, при допущении, что строки в кодировке UTF-8. `COLLATE` может быть указан или не указан для каждого выражения в ORDER BY независимо. Если есть `ASC` или `DESC`, то `COLLATE` указывается после них. При использовании `COLLATE` сортировка всегда регистронезависима.
|
||||
Для сортировки по значениям типа [String](../../../sql-reference/data-types/string.md) есть возможность указать collation (сравнение). Пример: `ORDER BY SearchPhrase COLLATE 'tr'` - для сортировки по поисковой фразе, по возрастанию, с учётом турецкого алфавита, регистронезависимо, при допущении, что строки в кодировке UTF-8. `COLLATE` может быть указан или не указан для каждого выражения в ORDER BY независимо. Если есть `ASC` или `DESC`, то `COLLATE` указывается после них. При использовании `COLLATE` сортировка всегда регистронезависима.
|
||||
|
||||
Сравнение поддерживается при использовании типов [LowCardinality](../../../sql-reference/data-types/lowcardinality.md), [Nullable](../../../sql-reference/data-types/nullable.md), [Array](../../../sql-reference/data-types/array.md) и [Tuple](../../../sql-reference/data-types/tuple.md).
|
||||
|
||||
Рекомендуется использовать `COLLATE` только для окончательной сортировки небольшого количества строк, так как производительность сортировки с указанием `COLLATE` меньше, чем обычной сортировки по байтам.
|
||||
|
||||
## Примеры с использованием сравнения {#collation-examples}
|
||||
|
||||
Пример с значениями типа [String](../../../sql-reference/data-types/string.md):
|
||||
|
||||
Входная таблица:
|
||||
|
||||
``` text
|
||||
┌─x─┬─s────┐
|
||||
│ 1 │ bca │
|
||||
│ 2 │ ABC │
|
||||
│ 3 │ 123a │
|
||||
│ 4 │ abc │
|
||||
│ 5 │ BCA │
|
||||
└───┴──────┘
|
||||
```
|
||||
|
||||
Запрос:
|
||||
|
||||
```sql
|
||||
SELECT * FROM collate_test ORDER BY s ASC COLLATE 'en';
|
||||
```
|
||||
|
||||
Результат:
|
||||
|
||||
``` text
|
||||
┌─x─┬─s────┐
|
||||
│ 3 │ 123a │
|
||||
│ 4 │ abc │
|
||||
│ 2 │ ABC │
|
||||
│ 1 │ bca │
|
||||
│ 5 │ BCA │
|
||||
└───┴──────┘
|
||||
```
|
||||
|
||||
Пример со строками типа [Nullable](../../../sql-reference/data-types/nullable.md):
|
||||
|
||||
Входная таблица:
|
||||
|
||||
``` text
|
||||
┌─x─┬─s────┐
|
||||
│ 1 │ bca │
|
||||
│ 2 │ ᴺᵁᴸᴸ │
|
||||
│ 3 │ ABC │
|
||||
│ 4 │ 123a │
|
||||
│ 5 │ abc │
|
||||
│ 6 │ ᴺᵁᴸᴸ │
|
||||
│ 7 │ BCA │
|
||||
└───┴──────┘
|
||||
```
|
||||
|
||||
Запрос:
|
||||
|
||||
```sql
|
||||
SELECT * FROM collate_test ORDER BY s ASC COLLATE 'en';
|
||||
```
|
||||
|
||||
Результат:
|
||||
|
||||
``` text
|
||||
┌─x─┬─s────┐
|
||||
│ 4 │ 123a │
|
||||
│ 5 │ abc │
|
||||
│ 3 │ ABC │
|
||||
│ 1 │ bca │
|
||||
│ 7 │ BCA │
|
||||
│ 6 │ ᴺᵁᴸᴸ │
|
||||
│ 2 │ ᴺᵁᴸᴸ │
|
||||
└───┴──────┘
|
||||
```
|
||||
|
||||
Пример со строками в [Array](../../../sql-reference/data-types/array.md):
|
||||
|
||||
Входная таблица:
|
||||
|
||||
``` text
|
||||
┌─x─┬─s─────────────┐
|
||||
│ 1 │ ['Z'] │
|
||||
│ 2 │ ['z'] │
|
||||
│ 3 │ ['a'] │
|
||||
│ 4 │ ['A'] │
|
||||
│ 5 │ ['z','a'] │
|
||||
│ 6 │ ['z','a','a'] │
|
||||
│ 7 │ [''] │
|
||||
└───┴───────────────┘
|
||||
```
|
||||
|
||||
Запрос:
|
||||
|
||||
```sql
|
||||
SELECT * FROM collate_test ORDER BY s ASC COLLATE 'en';
|
||||
```
|
||||
|
||||
Результат:
|
||||
|
||||
``` text
|
||||
┌─x─┬─s─────────────┐
|
||||
│ 7 │ [''] │
|
||||
│ 3 │ ['a'] │
|
||||
│ 4 │ ['A'] │
|
||||
│ 2 │ ['z'] │
|
||||
│ 5 │ ['z','a'] │
|
||||
│ 6 │ ['z','a','a'] │
|
||||
│ 1 │ ['Z'] │
|
||||
└───┴───────────────┘
|
||||
```
|
||||
|
||||
Пример со строками типа [LowCardinality](../../../sql-reference/data-types/lowcardinality.md):
|
||||
|
||||
Входная таблица:
|
||||
|
||||
```text
|
||||
┌─x─┬─s───┐
|
||||
│ 1 │ Z │
|
||||
│ 2 │ z │
|
||||
│ 3 │ a │
|
||||
│ 4 │ A │
|
||||
│ 5 │ za │
|
||||
│ 6 │ zaa │
|
||||
│ 7 │ │
|
||||
└───┴─────┘
|
||||
```
|
||||
|
||||
Запрос:
|
||||
|
||||
```sql
|
||||
SELECT * FROM collate_test ORDER BY s ASC COLLATE 'en';
|
||||
```
|
||||
|
||||
Результат:
|
||||
|
||||
```text
|
||||
┌─x─┬─s───┐
|
||||
│ 7 │ │
|
||||
│ 3 │ a │
|
||||
│ 4 │ A │
|
||||
│ 2 │ z │
|
||||
│ 1 │ Z │
|
||||
│ 5 │ za │
|
||||
│ 6 │ zaa │
|
||||
└───┴─────┘
|
||||
```
|
||||
|
||||
Пример со строками в [Tuple](../../../sql-reference/data-types/tuple.md):
|
||||
|
||||
```text
|
||||
┌─x─┬─s───────┐
|
||||
│ 1 │ (1,'Z') │
|
||||
│ 2 │ (1,'z') │
|
||||
│ 3 │ (1,'a') │
|
||||
│ 4 │ (2,'z') │
|
||||
│ 5 │ (1,'A') │
|
||||
│ 6 │ (2,'Z') │
|
||||
│ 7 │ (2,'A') │
|
||||
└───┴─────────┘
|
||||
```
|
||||
|
||||
Запрос:
|
||||
|
||||
```sql
|
||||
SELECT * FROM collate_test ORDER BY s ASC COLLATE 'en';
|
||||
```
|
||||
|
||||
Результат:
|
||||
|
||||
```text
|
||||
┌─x─┬─s───────┐
|
||||
│ 3 │ (1,'a') │
|
||||
│ 5 │ (1,'A') │
|
||||
│ 2 │ (1,'z') │
|
||||
│ 1 │ (1,'Z') │
|
||||
│ 7 │ (2,'A') │
|
||||
│ 4 │ (2,'z') │
|
||||
│ 6 │ (2,'Z') │
|
||||
└───┴─────────┘
|
||||
```
|
||||
|
||||
## Деталь реализации {#implementation-details}
|
||||
|
||||
Если кроме `ORDER BY` указан также не слишком большой [LIMIT](limit.md), то расходуется меньше оперативки. Иначе расходуется количество памяти, пропорциональное количеству данных для сортировки. При распределённой обработке запроса, если отсутствует [GROUP BY](group-by.md), сортировка частично делается на удалённых серверах, а на сервере-инициаторе запроса производится слияние результатов. Таким образом, при распределённой сортировке, может сортироваться объём данных, превышающий размер памяти на одном сервере.
|
||||
|
@ -257,8 +257,8 @@ Clickhouse'un geliştirilmesi genellikle gerçekçi veri kümelerinin yüklenmes
|
||||
|
||||
sudo apt install wget xz-utils
|
||||
|
||||
wget https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz
|
||||
wget https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz
|
||||
wget https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz
|
||||
wget https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz
|
||||
|
||||
xz -v -d hits_v1.tsv.xz
|
||||
xz -v -d visits_v1.tsv.xz
|
||||
|
@ -579,7 +579,7 @@ Bir işlev öbekte oluşturulan bir nesnenin sahipliğini yakalarsa, bağımsız
|
||||
|
||||
**14.** Değerleri döndürür.
|
||||
|
||||
Çoğu durumda, sadece kullanın `return`. Yaz domayın `[return std::move(res)]{.strike}`.
|
||||
Çoğu durumda, sadece kullanın `return`. Yaz domayın `return std::move(res)`.
|
||||
|
||||
İşlev öbek üzerinde bir nesne ayırır ve döndürürse, şunları kullanın `shared_ptr` veya `unique_ptr`.
|
||||
|
||||
@ -673,7 +673,7 @@ Her zaman kullanın `#pragma once` korumaları dahil etmek yerine.
|
||||
**24.** Kullanmayın `trailing return type` gerekli olmadıkça fonksiyonlar için.
|
||||
|
||||
``` cpp
|
||||
[auto f() -> void;]{.strike}
|
||||
auto f() -> void
|
||||
```
|
||||
|
||||
**25.** Değişkenlerin bildirimi ve başlatılması.
|
||||
|
@ -9,14 +9,14 @@ toc_title: "\xDCye.Metrica Verileri"
|
||||
|
||||
Veri kümesi, isabetlerle ilgili anonimleştirilmiş verileri içeren iki tablodan oluşur (`hits_v1`) ve ziyaret visitsler (`visits_v1`(kayıt olmak için).Metrica. Yandex hakkında daha fazla bilgi edinebilirsiniz.Metrica içinde [ClickHouse geçmişi](../../introduction/history.md) bölme.
|
||||
|
||||
Veri kümesi iki tablodan oluşur, bunlardan biri sıkıştırılmış olarak indirilebilir `tsv.xz` dosya veya hazırlanmış bölümler olarak. Buna ek olarak, genişletilmiş bir sürümü `hits` 100 milyon satır içeren tablo TSV olarak mevcuttur https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_100m_obfuscated_v1.tsv.xz ve hazırlanan bölümler olarak https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_100m_obfuscated_v1.tar.xz.
|
||||
Veri kümesi iki tablodan oluşur, bunlardan biri sıkıştırılmış olarak indirilebilir `tsv.xz` dosya veya hazırlanmış bölümler olarak. Buna ek olarak, genişletilmiş bir sürümü `hits` 100 milyon satır içeren tablo TSV olarak mevcuttur https://datasets.clickhouse.tech/hits/tsv/hits_100m_obfuscated_v1.tsv.xz ve hazırlanan bölümler olarak https://datasets.clickhouse.tech/hits/partitions/hits_100m_obfuscated_v1.tar.xz.
|
||||
|
||||
## Hazırlanan bölümlerden tablolar elde etme {#obtaining-tables-from-prepared-partitions}
|
||||
|
||||
İndirme ve ithalat tablo hits:
|
||||
|
||||
``` bash
|
||||
curl -O https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_v1.tar
|
||||
curl -O https://datasets.clickhouse.tech/hits/partitions/hits_v1.tar
|
||||
tar xvf hits_v1.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
# check permissions on unpacked data, fix if required
|
||||
sudo service clickhouse-server restart
|
||||
@ -26,7 +26,7 @@ clickhouse-client --query "SELECT COUNT(*) FROM datasets.hits_v1"
|
||||
İndirme ve ithalat ziyaretleri:
|
||||
|
||||
``` bash
|
||||
curl -O https://clickhouse-datasets.s3.yandex.net/visits/partitions/visits_v1.tar
|
||||
curl -O https://datasets.clickhouse.tech/visits/partitions/visits_v1.tar
|
||||
tar xvf visits_v1.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
# check permissions on unpacked data, fix if required
|
||||
sudo service clickhouse-server restart
|
||||
@ -38,7 +38,7 @@ clickhouse-client --query "SELECT COUNT(*) FROM datasets.visits_v1"
|
||||
Sıkıştırılmış TSV dosyasından indir ve İçe Aktar:
|
||||
|
||||
``` bash
|
||||
curl https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
# now create table
|
||||
clickhouse-client --query "CREATE DATABASE IF NOT EXISTS datasets"
|
||||
clickhouse-client --query "CREATE TABLE datasets.hits_v1 ( WatchID UInt64, JavaEnable UInt8, Title String, GoodEvent Int16, EventTime DateTime, EventDate Date, CounterID UInt32, ClientIP UInt32, ClientIP6 FixedString(16), RegionID UInt32, UserID UInt64, CounterClass Int8, OS UInt8, UserAgent UInt8, URL String, Referer String, URLDomain String, RefererDomain String, Refresh UInt8, IsRobot UInt8, RefererCategories Array(UInt16), URLCategories Array(UInt16), URLRegions Array(UInt32), RefererRegions Array(UInt32), ResolutionWidth UInt16, ResolutionHeight UInt16, ResolutionDepth UInt8, FlashMajor UInt8, FlashMinor UInt8, FlashMinor2 String, NetMajor UInt8, NetMinor UInt8, UserAgentMajor UInt16, UserAgentMinor FixedString(2), CookieEnable UInt8, JavascriptEnable UInt8, IsMobile UInt8, MobilePhone UInt8, MobilePhoneModel String, Params String, IPNetworkID UInt32, TraficSourceID Int8, SearchEngineID UInt16, SearchPhrase String, AdvEngineID UInt8, IsArtifical UInt8, WindowClientWidth UInt16, WindowClientHeight UInt16, ClientTimeZone Int16, ClientEventTime DateTime, SilverlightVersion1 UInt8, SilverlightVersion2 UInt8, SilverlightVersion3 UInt32, SilverlightVersion4 UInt16, PageCharset String, CodeVersion UInt32, IsLink UInt8, IsDownload UInt8, IsNotBounce UInt8, FUniqID UInt64, HID UInt32, IsOldCounter UInt8, IsEvent UInt8, IsParameter UInt8, DontCountHits UInt8, WithHash UInt8, HitColor FixedString(1), UTCEventTime DateTime, Age UInt8, Sex UInt8, Income UInt8, Interests UInt16, Robotness UInt8, GeneralInterests Array(UInt16), RemoteIP UInt32, RemoteIP6 FixedString(16), WindowName Int32, OpenerName Int32, HistoryLength Int16, BrowserLanguage FixedString(2), BrowserCountry FixedString(2), SocialNetwork String, SocialAction String, HTTPError UInt16, SendTiming Int32, DNSTiming Int32, ConnectTiming Int32, ResponseStartTiming Int32, ResponseEndTiming Int32, FetchTiming Int32, RedirectTiming Int32, DOMInteractiveTiming Int32, DOMContentLoadedTiming Int32, DOMCompleteTiming Int32, LoadEventStartTiming Int32, LoadEventEndTiming Int32, NSToDOMContentLoadedTiming Int32, FirstPaintTiming Int32, RedirectCount Int8, SocialSourceNetworkID UInt8, SocialSourcePage String, ParamPrice Int64, ParamOrderID String, ParamCurrency FixedString(3), ParamCurrencyID UInt16, GoalsReached Array(UInt32), OpenstatServiceName String, OpenstatCampaignID String, OpenstatAdID String, OpenstatSourceID String, UTMSource String, UTMMedium String, UTMCampaign String, UTMContent String, UTMTerm String, FromTag String, HasGCLID UInt8, RefererHash UInt64, URLHash UInt64, CLID UInt32, YCLID UInt64, ShareService String, ShareURL String, ShareTitle String, ParsedParams Nested(Key1 String, Key2 String, Key3 String, Key4 String, Key5 String, ValueDouble Float64), IslandID FixedString(16), RequestNum UInt32, RequestTry UInt8) ENGINE = MergeTree() PARTITION BY toYYYYMM(EventDate) ORDER BY (CounterID, EventDate, intHash32(UserID)) SAMPLE BY intHash32(UserID) SETTINGS index_granularity = 8192"
|
||||
@ -52,7 +52,7 @@ clickhouse-client --query "SELECT COUNT(*) FROM datasets.hits_v1"
|
||||
Sıkıştırılmış tsv dosyasından ziyaretleri indirin ve içe aktarın:
|
||||
|
||||
``` bash
|
||||
curl https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
# now create table
|
||||
clickhouse-client --query "CREATE DATABASE IF NOT EXISTS datasets"
|
||||
clickhouse-client --query "CREATE TABLE datasets.visits_v1 ( CounterID UInt32, StartDate Date, Sign Int8, IsNew UInt8, VisitID UInt64, UserID UInt64, StartTime DateTime, Duration UInt32, UTCStartTime DateTime, PageViews Int32, Hits Int32, IsBounce UInt8, Referer String, StartURL String, RefererDomain String, StartURLDomain String, EndURL String, LinkURL String, IsDownload UInt8, TraficSourceID Int8, SearchEngineID UInt16, SearchPhrase String, AdvEngineID UInt8, PlaceID Int32, RefererCategories Array(UInt16), URLCategories Array(UInt16), URLRegions Array(UInt32), RefererRegions Array(UInt32), IsYandex UInt8, GoalReachesDepth Int32, GoalReachesURL Int32, GoalReachesAny Int32, SocialSourceNetworkID UInt8, SocialSourcePage String, MobilePhoneModel String, ClientEventTime DateTime, RegionID UInt32, ClientIP UInt32, ClientIP6 FixedString(16), RemoteIP UInt32, RemoteIP6 FixedString(16), IPNetworkID UInt32, SilverlightVersion3 UInt32, CodeVersion UInt32, ResolutionWidth UInt16, ResolutionHeight UInt16, UserAgentMajor UInt16, UserAgentMinor UInt16, WindowClientWidth UInt16, WindowClientHeight UInt16, SilverlightVersion2 UInt8, SilverlightVersion4 UInt16, FlashVersion3 UInt16, FlashVersion4 UInt16, ClientTimeZone Int16, OS UInt8, UserAgent UInt8, ResolutionDepth UInt8, FlashMajor UInt8, FlashMinor UInt8, NetMajor UInt8, NetMinor UInt8, MobilePhone UInt8, SilverlightVersion1 UInt8, Age UInt8, Sex UInt8, Income UInt8, JavaEnable UInt8, CookieEnable UInt8, JavascriptEnable UInt8, IsMobile UInt8, BrowserLanguage UInt16, BrowserCountry UInt16, Interests UInt16, Robotness UInt8, GeneralInterests Array(UInt16), Params Array(String), Goals Nested(ID UInt32, Serial UInt32, EventTime DateTime, Price Int64, OrderID String, CurrencyID UInt32), WatchIDs Array(UInt64), ParamSumPrice Int64, ParamCurrency FixedString(3), ParamCurrencyID UInt16, ClickLogID UInt64, ClickEventID Int32, ClickGoodEvent Int32, ClickEventTime DateTime, ClickPriorityID Int32, ClickPhraseID Int32, ClickPageID Int32, ClickPlaceID Int32, ClickTypeID Int32, ClickResourceID Int32, ClickCost UInt32, ClickClientIP UInt32, ClickDomainID UInt32, ClickURL String, ClickAttempt UInt8, ClickOrderID UInt32, ClickBannerID UInt32, ClickMarketCategoryID UInt32, ClickMarketPP UInt32, ClickMarketCategoryName String, ClickMarketPPName String, ClickAWAPSCampaignName String, ClickPageName String, ClickTargetType UInt16, ClickTargetPhraseID UInt64, ClickContextType UInt8, ClickSelectType Int8, ClickOptions String, ClickGroupBannerID Int32, OpenstatServiceName String, OpenstatCampaignID String, OpenstatAdID String, OpenstatSourceID String, UTMSource String, UTMMedium String, UTMCampaign String, UTMContent String, UTMTerm String, FromTag String, HasGCLID UInt8, FirstVisit DateTime, PredLastVisit Date, LastVisit Date, TotalVisits UInt32, TraficSource Nested(ID Int8, SearchEngineID UInt16, AdvEngineID UInt8, PlaceID UInt16, SocialSourceNetworkID UInt8, Domain String, SearchPhrase String, SocialSourcePage String), Attendance FixedString(16), CLID UInt32, YCLID UInt64, NormalizedRefererHash UInt64, SearchPhraseHash UInt64, RefererDomainHash UInt64, NormalizedStartURLHash UInt64, StartURLDomainHash UInt64, NormalizedEndURLHash UInt64, TopLevelDomain UInt64, URLScheme UInt64, OpenstatServiceNameHash UInt64, OpenstatCampaignIDHash UInt64, OpenstatAdIDHash UInt64, OpenstatSourceIDHash UInt64, UTMSourceHash UInt64, UTMMediumHash UInt64, UTMCampaignHash UInt64, UTMContentHash UInt64, UTMTermHash UInt64, FromHash UInt64, WebVisorEnabled UInt8, WebVisorActivity UInt32, ParsedParams Nested(Key1 String, Key2 String, Key3 String, Key4 String, Key5 String, ValueDouble Float64), Market Nested(Type UInt8, GoalID UInt32, OrderID String, OrderPrice Int64, PP UInt32, DirectPlaceID UInt32, DirectOrderID UInt32, DirectBannerID UInt32, GoodID String, GoodName String, GoodQuantity Int32, GoodPrice Int64), IslandID FixedString(16)) ENGINE = CollapsingMergeTree(Sign) PARTITION BY toYYYYMM(StartDate) ORDER BY (CounterID, StartDate, intHash32(UserID), VisitID) SAMPLE BY intHash32(UserID) SETTINGS index_granularity = 8192"
|
||||
|
@ -285,7 +285,7 @@ Diğer şeylerin yanı sıra, MERGETREE üzerinde en iyi duruma getirme sorgusun
|
||||
## Hazırlanan Bölüm downloadlerin indir downloadilmesi {#download-of-prepared-partitions}
|
||||
|
||||
``` bash
|
||||
$ curl -O https://clickhouse-datasets.s3.yandex.net/trips_mergetree/partitions/trips_mergetree.tar
|
||||
$ curl -O https://datasets.clickhouse.tech/trips_mergetree/partitions/trips_mergetree.tar
|
||||
$ tar xvf trips_mergetree.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
$ # check permissions of unpacked data, fix if required
|
||||
$ sudo service clickhouse-server restart
|
||||
|
@ -156,7 +156,7 @@ $ for i in *.zip; do echo $i; unzip -cq $i '*.csv' | sed 's/\.00//g' | clickhous
|
||||
## Hazırlanan Bölüm downloadlerin indir downloadilmesi {#download-of-prepared-partitions}
|
||||
|
||||
``` bash
|
||||
$ curl -O https://clickhouse-datasets.s3.yandex.net/ontime/partitions/ontime.tar
|
||||
$ curl -O https://datasets.clickhouse.tech/ontime/partitions/ontime.tar
|
||||
$ tar xvf ontime.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
$ # check permissions of unpacked data, fix if required
|
||||
$ sudo service clickhouse-server restart
|
||||
|
@ -87,8 +87,8 @@ clickhouse-client --query='INSERT INTO table FORMAT TabSeparated' < data.tsv
|
||||
### Tablo verilerini indirin ve ayıklayın {#download-and-extract-table-data}
|
||||
|
||||
``` bash
|
||||
curl https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
```
|
||||
|
||||
Çıkarılan dosyalar yaklaşık 10GB boyutundadır.
|
||||
|
@ -48,7 +48,7 @@ Bu talimat ile ClickHouse paketlerinin kurulumu olmadan herhangi bir sunucuda te
|
||||
|
||||
<!-- -->
|
||||
|
||||
wget https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_100m_obfuscated_v1.tar.xz
|
||||
wget https://datasets.clickhouse.tech/hits/partitions/hits_100m_obfuscated_v1.tar.xz
|
||||
tar xvf hits_100m_obfuscated_v1.tar.xz -C .
|
||||
mv hits_100m_obfuscated_v1/* .
|
||||
|
||||
|
@ -26,155 +26,155 @@ Aşağıdaki tabloda, sorgu özelliği ClickHouse çalışır, ancak ANSI SQL'DE
|
||||
| Feature ID | Özellik Adı | Durum | Yorum |
|
||||
|------------|-----------------------------------------------------------------------------------------------------------------------------|--------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| **E011** | **Sayısal veri türleri** | **Kısmi**{.text-warning} | |
|
||||
| E011-01 | Tamsayı ve SMALLİNT veri türleri | Evet{.text-success} | |
|
||||
| E011-02 | Gerçek, çift hassas ve FLOAT veri türleri veri türleri | Kısmi{.text-warning} | `FLOAT(<binary_precision>)`, `REAL` ve `DOUBLE PRECISION` desteklenmiyor |
|
||||
| E011-03 | Ondalık ve sayısal veri türleri | Kısmi{.text-warning} | Sadece `DECIMAL(p,s)` desteklenir, değil `NUMERIC` |
|
||||
| E011-04 | Aritmetik operat operatorsörler | Evet{.text-success} | |
|
||||
| E011-05 | Sayısal karşılaştırma | Evet{.text-success} | |
|
||||
| E011-06 | Sayısal veri türleri arasında örtülü döküm | Hayır{.text-danger} | ANSI SQL, sayısal türler arasında rasgele örtülü döküm yapılmasına izin verirken, ClickHouse, örtülü döküm yerine birden fazla aşırı yüke sahip işlevlere dayanır |
|
||||
| E011-01 | Tamsayı ve SMALLİNT veri türleri | Evet {.text-success} | |
|
||||
| E011-02 | Gerçek, çift hassas ve FLOAT veri türleri veri türleri | Kısmi {.text-warning} | `FLOAT(<binary_precision>)`, `REAL` ve `DOUBLE PRECISION` desteklenmiyor |
|
||||
| E011-03 | Ondalık ve sayısal veri türleri | Kısmi {.text-warning} | Sadece `DECIMAL(p,s)` desteklenir, değil `NUMERIC` |
|
||||
| E011-04 | Aritmetik operat operatorsörler | Evet {.text-success} | |
|
||||
| E011-05 | Sayısal karşılaştırma | Evet {.text-success} | |
|
||||
| E011-06 | Sayısal veri türleri arasında örtülü döküm | Hayır {.text-danger} | ANSI SQL, sayısal türler arasında rasgele örtülü döküm yapılmasına izin verirken, ClickHouse, örtülü döküm yerine birden fazla aşırı yüke sahip işlevlere dayanır |
|
||||
| **E021** | **Karakter dizesi türleri** | **Kısmi**{.text-warning} | |
|
||||
| E021-01 | Karakter veri türü | Hayır{.text-danger} | |
|
||||
| E021-02 | Karakter değişken veri türü | Hayır{.text-danger} | `String` benzer şekilde davranır, ancak parantez içinde uzunluk sınırı olmadan |
|
||||
| E021-03 | Karakter değişmezleri | Kısmi{.text-warning} | Ardışık değişmezlerin ve karakter seti desteğinin otomatik olarak birleştirilmesi yok |
|
||||
| E021-04 | CHARACTER_LENGTH işlevi | Kısmi{.text-warning} | Hayır `USING` yan |
|
||||
| E021-05 | OCTET_LENGTH işlevi | Hayır{.text-danger} | `LENGTH` benzer şekilde davranır |
|
||||
| E021-06 | SUBSTRING | Kısmi{.text-warning} | İçin destek yok `SIMILAR` ve `ESCAPE` CLA ,us ,es, no `SUBSTRING_REGEX` varyant |
|
||||
| E021-07 | Karakter birleştirme | Kısmi{.text-warning} | Hayır `COLLATE` yan |
|
||||
| E021-08 | Üst ve alt fonksiyonlar | Evet{.text-success} | |
|
||||
| E021-09 | TRİM fonksiyonu | Evet{.text-success} | |
|
||||
| E021-10 | Sabit uzunlukta ve değişken uzunlukta karakter dizesi türleri arasında örtülü döküm | Hayır{.text-danger} | ANSI SQL, dize türleri arasında rasgele örtük döküm yapılmasına izin verirken, ClickHouse, örtük döküm yerine birden fazla aşırı yüke sahip işlevlere dayanır |
|
||||
| E021-11 | Pozisyon fonksiyonu | Kısmi{.text-warning} | İçin destek yok `IN` ve `USING` CLA ,us ,es, no `POSITION_REGEX` varyant |
|
||||
| E021-12 | Karakter karşılaştırma | Evet{.text-success} | |
|
||||
| E021-01 | Karakter veri türü | Hayır {.text-danger} | |
|
||||
| E021-02 | Karakter değişken veri türü | Hayır {.text-danger} | `String` benzer şekilde davranır, ancak parantez içinde uzunluk sınırı olmadan |
|
||||
| E021-03 | Karakter değişmezleri | Kısmi {.text-warning} | Ardışık değişmezlerin ve karakter seti desteğinin otomatik olarak birleştirilmesi yok |
|
||||
| E021-04 | CHARACTER_LENGTH işlevi | Kısmi {.text-warning} | Hayır `USING` yan |
|
||||
| E021-05 | OCTET_LENGTH işlevi | Hayır {.text-danger} | `LENGTH` benzer şekilde davranır |
|
||||
| E021-06 | SUBSTRING | Kısmi {.text-warning} | İçin destek yok `SIMILAR` ve `ESCAPE` CLA ,us ,es, no `SUBSTRING_REGEX` varyant |
|
||||
| E021-07 | Karakter birleştirme | Kısmi {.text-warning} | Hayır `COLLATE` yan |
|
||||
| E021-08 | Üst ve alt fonksiyonlar | Evet {.text-success} | |
|
||||
| E021-09 | TRİM fonksiyonu | Evet {.text-success} | |
|
||||
| E021-10 | Sabit uzunlukta ve değişken uzunlukta karakter dizesi türleri arasında örtülü döküm | Hayır {.text-danger} | ANSI SQL, dize türleri arasında rasgele örtük döküm yapılmasına izin verirken, ClickHouse, örtük döküm yerine birden fazla aşırı yüke sahip işlevlere dayanır |
|
||||
| E021-11 | Pozisyon fonksiyonu | Kısmi {.text-warning} | İçin destek yok `IN` ve `USING` CLA ,us ,es, no `POSITION_REGEX` varyant |
|
||||
| E021-12 | Karakter karşılaştırma | Evet {.text-success} | |
|
||||
| **E031** | **Tanıtıcılar** | **Kısmi**{.text-warning} | |
|
||||
| E031-01 | Ayrılmış tanımlayıcılar | Kısmi{.text-warning} | Unicode literal desteği sınırlıdır |
|
||||
| E031-02 | Küçük harf tanımlayıcıları | Evet{.text-success} | |
|
||||
| E031-03 | Sondaki alt çizgi | Evet{.text-success} | |
|
||||
| E031-01 | Ayrılmış tanımlayıcılar | Kısmi {.text-warning} | Unicode literal desteği sınırlıdır |
|
||||
| E031-02 | Küçük harf tanımlayıcıları | Evet {.text-success} | |
|
||||
| E031-03 | Sondaki alt çizgi | Evet {.text-success} | |
|
||||
| **E051** | **Temel sorgu belirtimi** | **Kısmi**{.text-warning} | |
|
||||
| E051-01 | SELECT DISTINCT | Evet{.text-success} | |
|
||||
| E051-02 | GROUP BY fık clausera | Evet{.text-success} | |
|
||||
| E051-04 | GROUP BY içinde olmayan sütunlar içerebilir `<select list>` | Evet{.text-success} | |
|
||||
| E051-05 | Seçme öğeler yeniden adlandırılabilir | Evet{.text-success} | |
|
||||
| E051-06 | Fık HAVİNGRA olması | Evet{.text-success} | |
|
||||
| E051-07 | Nitelikli \* seçme listesinde | Evet{.text-success} | |
|
||||
| E051-08 | From madd theesindeki korelasyon adı | Evet{.text-success} | |
|
||||
| E051-09 | FROM yan tümcesinde sütunları Yeniden Adlandır | Hayır{.text-danger} | |
|
||||
| E051-01 | SELECT DISTINCT | Evet {.text-success} | |
|
||||
| E051-02 | GROUP BY fık clausera | Evet {.text-success} | |
|
||||
| E051-04 | GROUP BY içinde olmayan sütunlar içerebilir `<select list>` | Evet {.text-success} | |
|
||||
| E051-05 | Seçme öğeler yeniden adlandırılabilir | Evet {.text-success} | |
|
||||
| E051-06 | Fık HAVİNGRA olması | Evet {.text-success} | |
|
||||
| E051-07 | Nitelikli \* seçme listesinde | Evet {.text-success} | |
|
||||
| E051-08 | From madd theesindeki korelasyon adı | Evet {.text-success} | |
|
||||
| E051-09 | FROM yan tümcesinde sütunları Yeniden Adlandır | Hayır {.text-danger} | |
|
||||
| **E061** | **Temel yüklemler ve arama koşulları** | **Kısmi**{.text-warning} | |
|
||||
| E061-01 | Karşılaştırma yüklemi | Evet{.text-success} | |
|
||||
| E061-02 | Yüklem arasında | Kısmi{.text-warning} | Hayır `SYMMETRIC` ve `ASYMMETRIC` yan |
|
||||
| E061-03 | Değerler listesi ile yüklemde | Evet{.text-success} | |
|
||||
| E061-04 | Yüklem gibi | Evet{.text-success} | |
|
||||
| E061-05 | Yüklem gibi: kaçış maddesi | Hayır{.text-danger} | |
|
||||
| E061-06 | Boş yüklem | Evet{.text-success} | |
|
||||
| E061-07 | Sayısal karşılaştırma yüklemi | Hayır{.text-danger} | |
|
||||
| E061-08 | Var yüklemi | Hayır{.text-danger} | |
|
||||
| E061-09 | Karşılaştırma yükleminde alt sorgular | Evet{.text-success} | |
|
||||
| E061-11 | Yüklemde alt sorgular | Evet{.text-success} | |
|
||||
| E061-12 | Sayısal karşılaştırma yükleminde alt sorgular | Hayır{.text-danger} | |
|
||||
| E061-13 | İlişkili alt sorgular | Hayır{.text-danger} | |
|
||||
| E061-14 | Arama koşulu | Evet{.text-success} | |
|
||||
| E061-01 | Karşılaştırma yüklemi | Evet {.text-success} | |
|
||||
| E061-02 | Yüklem arasında | Kısmi {.text-warning} | Hayır `SYMMETRIC` ve `ASYMMETRIC` yan |
|
||||
| E061-03 | Değerler listesi ile yüklemde | Evet {.text-success} | |
|
||||
| E061-04 | Yüklem gibi | Evet {.text-success} | |
|
||||
| E061-05 | Yüklem gibi: kaçış maddesi | Hayır {.text-danger} | |
|
||||
| E061-06 | Boş yüklem | Evet {.text-success} | |
|
||||
| E061-07 | Sayısal karşılaştırma yüklemi | Hayır {.text-danger} | |
|
||||
| E061-08 | Var yüklemi | Hayır {.text-danger} | |
|
||||
| E061-09 | Karşılaştırma yükleminde alt sorgular | Evet {.text-success} | |
|
||||
| E061-11 | Yüklemde alt sorgular | Evet {.text-success} | |
|
||||
| E061-12 | Sayısal karşılaştırma yükleminde alt sorgular | Hayır {.text-danger} | |
|
||||
| E061-13 | İlişkili alt sorgular | Hayır {.text-danger} | |
|
||||
| E061-14 | Arama koşulu | Evet {.text-success} | |
|
||||
| **E071** | **Temel sorgu ifadeleri** | **Kısmi**{.text-warning} | |
|
||||
| E071-01 | Sendika farklı tablo operatörü | Hayır{.text-danger} | |
|
||||
| E071-02 | UNİON ALL table operat operatoror | Evet{.text-success} | |
|
||||
| E071-03 | Dist DİSTİNCTİNC tablet table operatörü hariç | Hayır{.text-danger} | |
|
||||
| E071-05 | Tablo operatörleri ile birleştirilen sütunların tam olarak aynı veri türüne sahip olması gerekmez | Evet{.text-success} | |
|
||||
| E071-06 | Alt sorgularda tablo işleçleri | Evet{.text-success} | |
|
||||
| E071-01 | Sendika farklı tablo operatörü | Hayır {.text-danger} | |
|
||||
| E071-02 | UNİON ALL table operat operatoror | Evet {.text-success} | |
|
||||
| E071-03 | Dist DİSTİNCTİNC tablet table operatörü hariç | Hayır {.text-danger} | |
|
||||
| E071-05 | Tablo operatörleri ile birleştirilen sütunların tam olarak aynı veri türüne sahip olması gerekmez | Evet {.text-success} | |
|
||||
| E071-06 | Alt sorgularda tablo işleçleri | Evet {.text-success} | |
|
||||
| **E081** | **Temel ayrıcalıklar** | **Kısmi**{.text-warning} | Çalışmalar sürüyor |
|
||||
| **E091** | **Set fonksiyonları** | **Evet**{.text-success} | |
|
||||
| E091-01 | AVG | Evet{.text-success} | |
|
||||
| E091-02 | COUNT | Evet{.text-success} | |
|
||||
| E091-03 | MAX | Evet{.text-success} | |
|
||||
| E091-04 | MIN | Evet{.text-success} | |
|
||||
| E091-05 | SUM | Evet{.text-success} | |
|
||||
| E091-06 | Tüm niceleyici | Hayır{.text-danger} | |
|
||||
| E091-07 | Farklı niceleyici | Kısmi{.text-warning} | Tüm toplama işlevleri desteklenmiyor |
|
||||
| E091-01 | AVG | Evet {.text-success} | |
|
||||
| E091-02 | COUNT | Evet {.text-success} | |
|
||||
| E091-03 | MAX | Evet {.text-success} | |
|
||||
| E091-04 | MIN | Evet {.text-success} | |
|
||||
| E091-05 | SUM | Evet {.text-success} | |
|
||||
| E091-06 | Tüm niceleyici | Hayır {.text-danger} | |
|
||||
| E091-07 | Farklı niceleyici | Kısmi {.text-warning} | Tüm toplama işlevleri desteklenmiyor |
|
||||
| **E101** | **Temel veri manipülasyonu** | **Kısmi**{.text-warning} | |
|
||||
| E101-01 | INSERT deyimi | Evet{.text-success} | Not: Clickhouse'daki birincil anahtar, `UNIQUE` kısıtlama |
|
||||
| E101-03 | Güncelleme deyimi Aran UPDATEDI | Hayır{.text-danger} | Bir `ALTER UPDATE` toplu veri değiştirme bildirimi |
|
||||
| E101-04 | Aranan DELETE deyimi | Hayır{.text-danger} | Bir `ALTER DELETE` toplu veri kaldırma bildirimi |
|
||||
| E101-01 | INSERT deyimi | Evet {.text-success} | Not: Clickhouse'daki birincil anahtar, `UNIQUE` kısıtlama |
|
||||
| E101-03 | Güncelleme deyimi Aran UPDATEDI | Hayır {.text-danger} | Bir `ALTER UPDATE` toplu veri değiştirme bildirimi |
|
||||
| E101-04 | Aranan DELETE deyimi | Hayır {.text-danger} | Bir `ALTER DELETE` toplu veri kaldırma bildirimi |
|
||||
| **E111** | **Tek sıra SELECT deyimi** | **Hayır**{.text-danger} | |
|
||||
| **E121** | **Temel imleç desteği** | **Hayır**{.text-danger} | |
|
||||
| E121-01 | DECLARE CURSOR | Hayır{.text-danger} | |
|
||||
| E121-02 | Sütunlara göre siparişin seçim listesinde olması gerekmez | Hayır{.text-danger} | |
|
||||
| E121-03 | CLA clauseuse by ORDER in Value ifadeleri | Hayır{.text-danger} | |
|
||||
| E121-04 | Açık ifade | Hayır{.text-danger} | |
|
||||
| E121-06 | Konumlandırılmış güncelleme bildirimi | Hayır{.text-danger} | |
|
||||
| E121-07 | Konumlandırılmış silme deyimi | Hayır{.text-danger} | |
|
||||
| E121-08 | Kapat deyimi | Hayır{.text-danger} | |
|
||||
| E121-10 | FETCH deyimi: örtük sonraki | Hayır{.text-danger} | |
|
||||
| E121-17 | Tut imleçler ile | Hayır{.text-danger} | |
|
||||
| E121-01 | DECLARE CURSOR | Hayır {.text-danger} | |
|
||||
| E121-02 | Sütunlara göre siparişin seçim listesinde olması gerekmez | Hayır {.text-danger} | |
|
||||
| E121-03 | CLA clauseuse by ORDER in Value ifadeleri | Hayır {.text-danger} | |
|
||||
| E121-04 | Açık ifade | Hayır {.text-danger} | |
|
||||
| E121-06 | Konumlandırılmış güncelleme bildirimi | Hayır {.text-danger} | |
|
||||
| E121-07 | Konumlandırılmış silme deyimi | Hayır {.text-danger} | |
|
||||
| E121-08 | Kapat deyimi | Hayır {.text-danger} | |
|
||||
| E121-10 | FETCH deyimi: örtük sonraki | Hayır {.text-danger} | |
|
||||
| E121-17 | Tut imleçler ile | Hayır {.text-danger} | |
|
||||
| **E131** | **Boş değer desteği (değerler yerine boş değerler)** | **Kısmi**{.text-warning} | Bazı kısıtlamalar geçerlidir |
|
||||
| **E141** | **Temel bütünlük kısıtlamaları** | **Kısmi**{.text-warning} | |
|
||||
| E141-01 | NOT NULL kısıtlamaları | Evet{.text-success} | Not: `NOT NULL` tablo sütunları için varsayılan olarak ima edilir |
|
||||
| E141-02 | NULL olmayan sütunların benzersiz kısıtlaması | Hayır{.text-danger} | |
|
||||
| E141-03 | Birincil anahtar kısıtlamaları | Hayır{.text-danger} | |
|
||||
| E141-04 | Hem referans silme eylemi hem de referans güncelleme eylemi için eylem yok varsayılanıyla temel yabancı anahtar kısıtlaması | Hayır{.text-danger} | |
|
||||
| E141-06 | Kontrol kısıt CHECKLAMASI | Evet{.text-success} | |
|
||||
| E141-07 | Sütun varsayılanları | Evet{.text-success} | |
|
||||
| E141-08 | NOT NULL birincil anahtar üzerinde çıkarıldı | Evet{.text-success} | |
|
||||
| E141-10 | Yabancı bir anahtardaki isimler herhangi bir sırada belirtilebilir | Hayır{.text-danger} | |
|
||||
| E141-01 | NOT NULL kısıtlamaları | Evet {.text-success} | Not: `NOT NULL` tablo sütunları için varsayılan olarak ima edilir |
|
||||
| E141-02 | NULL olmayan sütunların benzersiz kısıtlaması | Hayır {.text-danger} | |
|
||||
| E141-03 | Birincil anahtar kısıtlamaları | Hayır {.text-danger} | |
|
||||
| E141-04 | Hem referans silme eylemi hem de referans güncelleme eylemi için eylem yok varsayılanıyla temel yabancı anahtar kısıtlaması | Hayır {.text-danger} | |
|
||||
| E141-06 | Kontrol kısıt CHECKLAMASI | Evet {.text-success} | |
|
||||
| E141-07 | Sütun varsayılanları | Evet {.text-success} | |
|
||||
| E141-08 | NOT NULL birincil anahtar üzerinde çıkarıldı | Evet {.text-success} | |
|
||||
| E141-10 | Yabancı bir anahtardaki isimler herhangi bir sırada belirtilebilir | Hayır {.text-danger} | |
|
||||
| **E151** | **İşlem desteği** | **Hayır**{.text-danger} | |
|
||||
| E151-01 | Taahhüt deyimi | Hayır{.text-danger} | |
|
||||
| E151-02 | ROLBACKL statementback deyimi | Hayır{.text-danger} | |
|
||||
| E151-01 | Taahhüt deyimi | Hayır {.text-danger} | |
|
||||
| E151-02 | ROLBACKL statementback deyimi | Hayır {.text-danger} | |
|
||||
| **E152** | **Temel SET işlem deyimi** | **Hayır**{.text-danger} | |
|
||||
| E152-01 | Set TRANSACTİON deyimi: izolasyon düzeyi SERİALİZABLE yan tümcesi | Hayır{.text-danger} | |
|
||||
| E152-02 | Set TRANSACTİON deyimi: salt okunur ve okuma yazma yan tümceleri | Hayır{.text-danger} | |
|
||||
| E152-01 | Set TRANSACTİON deyimi: izolasyon düzeyi SERİALİZABLE yan tümcesi | Hayır {.text-danger} | |
|
||||
| E152-02 | Set TRANSACTİON deyimi: salt okunur ve okuma yazma yan tümceleri | Hayır {.text-danger} | |
|
||||
| **E153** | **Alt sorgularla güncellenebilir sorgular** | **Hayır**{.text-danger} | |
|
||||
| **E161** | **Lider çift eksi kullanarak SQL yorumlar ** | **Evet**{.text-success} | |
|
||||
| **E171** | **SQLSTATE desteği** | **Hayır**{.text-danger} | |
|
||||
| **E182** | **Ana bilgisayar dili bağlama** | **Hayır**{.text-danger} | |
|
||||
| **F031** | **Temel şema manipülasyonu** | **Kısmi**{.text-warning} | |
|
||||
| F031-01 | Kalıcı temel tablolar oluşturmak için tablo deyimi oluşturma | Kısmi{.text-warning} | Hayır `SYSTEM VERSIONING`, `ON COMMIT`, `GLOBAL`, `LOCAL`, `PRESERVE`, `DELETE`, `REF IS`, `WITH OPTIONS`, `UNDER`, `LIKE`, `PERIOD FOR` yan tümceleri ve kullanıcı çözümlenmiş veri türleri için destek yok |
|
||||
| F031-02 | Görünüm deyimi oluştur | Kısmi{.text-warning} | Hayır `RECURSIVE`, `CHECK`, `UNDER`, `WITH OPTIONS` yan tümceleri ve kullanıcı çözümlenmiş veri türleri için destek yok |
|
||||
| F031-03 | Hibe beyanı | Evet{.text-success} | |
|
||||
| F031-04 | ALTER TABLE deyimi: sütun yan tümcesi Ekle | Kısmi{.text-warning} | İçin destek yok `GENERATED` fık andra ve sistem süresi |
|
||||
| F031-13 | Dro :p TABLE deyimi: kısıt :lamak | Hayır{.text-danger} | |
|
||||
| F031-16 | Dro :p VİEW deyimi: kısıt :lamak | Hayır{.text-danger} | |
|
||||
| F031-19 | Rev REVOKEOKE deyimi: kısıt clauselamak | Hayır{.text-danger} | |
|
||||
| F031-01 | Kalıcı temel tablolar oluşturmak için tablo deyimi oluşturma | Kısmi {.text-warning} | Hayır `SYSTEM VERSIONING`, `ON COMMIT`, `GLOBAL`, `LOCAL`, `PRESERVE`, `DELETE`, `REF IS`, `WITH OPTIONS`, `UNDER`, `LIKE`, `PERIOD FOR` yan tümceleri ve kullanıcı çözümlenmiş veri türleri için destek yok |
|
||||
| F031-02 | Görünüm deyimi oluştur | Kısmi {.text-warning} | Hayır `RECURSIVE`, `CHECK`, `UNDER`, `WITH OPTIONS` yan tümceleri ve kullanıcı çözümlenmiş veri türleri için destek yok |
|
||||
| F031-03 | Hibe beyanı | Evet {.text-success} | |
|
||||
| F031-04 | ALTER TABLE deyimi: sütun yan tümcesi Ekle | Kısmi {.text-warning} | İçin destek yok `GENERATED` fık andra ve sistem süresi |
|
||||
| F031-13 | Dro :p TABLE deyimi: kısıt :lamak | Hayır {.text-danger} | |
|
||||
| F031-16 | Dro :p VİEW deyimi: kısıt :lamak | Hayır {.text-danger} | |
|
||||
| F031-19 | Rev REVOKEOKE deyimi: kısıt clauselamak | Hayır {.text-danger} | |
|
||||
| **F041** | **Temel birleştirilmiş tablo** | **Kısmi**{.text-warning} | |
|
||||
| F041-01 | Inner join (ancak mutlaka iç anahtar kelime değil) | Evet{.text-success} | |
|
||||
| F041-02 | İç anahtar kelime | Evet{.text-success} | |
|
||||
| F041-03 | LEFT OUTER JOIN | Evet{.text-success} | |
|
||||
| F041-04 | RIGHT OUTER JOIN | Evet{.text-success} | |
|
||||
| F041-05 | Dış birleşimler iç içe geçmiş olabilir | Evet{.text-success} | |
|
||||
| F041-07 | Sol veya sağ dış birleşimdeki iç tablo, bir iç birleşimde de kullanılabilir | Evet{.text-success} | |
|
||||
| F041-08 | Tüm karşılaştırma operatörleri desteklenir (sadece =yerine) | Hayır{.text-danger} | |
|
||||
| F041-01 | Inner join (ancak mutlaka iç anahtar kelime değil) | Evet {.text-success} | |
|
||||
| F041-02 | İç anahtar kelime | Evet {.text-success} | |
|
||||
| F041-03 | LEFT OUTER JOIN | Evet {.text-success} | |
|
||||
| F041-04 | RIGHT OUTER JOIN | Evet {.text-success} | |
|
||||
| F041-05 | Dış birleşimler iç içe geçmiş olabilir | Evet {.text-success} | |
|
||||
| F041-07 | Sol veya sağ dış birleşimdeki iç tablo, bir iç birleşimde de kullanılabilir | Evet {.text-success} | |
|
||||
| F041-08 | Tüm karşılaştırma operatörleri desteklenir (sadece =yerine) | Hayır {.text-danger} | |
|
||||
| **F051** | **Temel tarih ve saat** | **Kısmi**{.text-warning} | |
|
||||
| F051-01 | Tarih veri türü (tarih literal desteği dahil) | Kısmi{.text-warning} | Hiçbir edebi |
|
||||
| F051-02 | En az 0 kesirli saniye hassasiyetle zaman veri türü (zaman literal desteği dahil) | Hayır{.text-danger} | |
|
||||
| F051-03 | Zaman damgası veri türü (zaman damgası literal desteği dahil) en az 0 ve 6 kesirli saniye hassasiyetle | Hayır{.text-danger} | `DateTime64` zaman benzer işlevsellik sağlar |
|
||||
| F051-04 | Tarih, Saat ve zaman damgası veri türlerinde karşılaştırma yüklemi | Kısmi{.text-warning} | Yalnızca bir veri türü kullanılabilir |
|
||||
| F051-05 | Datetime türleri ve karakter dizesi türleri arasında açık döküm | Evet{.text-success} | |
|
||||
| F051-06 | CURRENT_DATE | Hayır{.text-danger} | `today()` benzer mi |
|
||||
| F051-07 | LOCALTIME | Hayır{.text-danger} | `now()` benzer mi |
|
||||
| F051-08 | LOCALTIMESTAMP | Hayır{.text-danger} | |
|
||||
| F051-01 | Tarih veri türü (tarih literal desteği dahil) | Kısmi {.text-warning} | Hiçbir edebi |
|
||||
| F051-02 | En az 0 kesirli saniye hassasiyetle zaman veri türü (zaman literal desteği dahil) | Hayır {.text-danger} | |
|
||||
| F051-03 | Zaman damgası veri türü (zaman damgası literal desteği dahil) en az 0 ve 6 kesirli saniye hassasiyetle | Hayır {.text-danger} | `DateTime64` zaman benzer işlevsellik sağlar |
|
||||
| F051-04 | Tarih, Saat ve zaman damgası veri türlerinde karşılaştırma yüklemi | Kısmi {.text-warning} | Yalnızca bir veri türü kullanılabilir |
|
||||
| F051-05 | Datetime türleri ve karakter dizesi türleri arasında açık döküm | Evet {.text-success} | |
|
||||
| F051-06 | CURRENT_DATE | Hayır {.text-danger} | `today()` benzer mi |
|
||||
| F051-07 | LOCALTIME | Hayır {.text-danger} | `now()` benzer mi |
|
||||
| F051-08 | LOCALTIMESTAMP | Hayır {.text-danger} | |
|
||||
| **F081** | **Sendika ve görüş EXCEPTLERDE** | **Kısmi**{.text-warning} | |
|
||||
| **F131** | **Grup operationslandırılmış işlemler** | **Kısmi**{.text-warning} | |
|
||||
| F131-01 | WHERE, GROUP BY ve gruplandırılmış görünümlere sahip sorgularda desteklenen yan tümceleri olması | Evet{.text-success} | |
|
||||
| F131-02 | Gruplandırılmış görünümlere sahip sorgularda desteklenen birden çok tablo | Evet{.text-success} | |
|
||||
| F131-03 | Gruplandırılmış görünümlere sahip sorgularda desteklenen işlevleri ayarlayın | Evet{.text-success} | |
|
||||
| F131-04 | GROUP BY ile alt sorgular ve yan tümceleri ve gruplandırılmış görünümler | Evet{.text-success} | |
|
||||
| F131-05 | GROUP BY ile tek satır seçme ve yan tümceleri ve gruplandırılmış görünümleri sahip | Hayır{.text-danger} | |
|
||||
| F131-01 | WHERE, GROUP BY ve gruplandırılmış görünümlere sahip sorgularda desteklenen yan tümceleri olması | Evet {.text-success} | |
|
||||
| F131-02 | Gruplandırılmış görünümlere sahip sorgularda desteklenen birden çok tablo | Evet {.text-success} | |
|
||||
| F131-03 | Gruplandırılmış görünümlere sahip sorgularda desteklenen işlevleri ayarlayın | Evet {.text-success} | |
|
||||
| F131-04 | GROUP BY ile alt sorgular ve yan tümceleri ve gruplandırılmış görünümler | Evet {.text-success} | |
|
||||
| F131-05 | GROUP BY ile tek satır seçme ve yan tümceleri ve gruplandırılmış görünümleri sahip | Hayır {.text-danger} | |
|
||||
| **F181** | **Çoklu modül desteği** | **Hayır**{.text-danger} | |
|
||||
| **F201** | **Döküm fonksiyonu** | **Evet**{.text-success} | |
|
||||
| **F221** | **Açık varsayılan** | **Hayır**{.text-danger} | |
|
||||
| **F261** | **Durum ifadesi** | **Evet**{.text-success} | |
|
||||
| F261-01 | Basit durum | Evet{.text-success} | |
|
||||
| F261-02 | Aranan dava | Evet{.text-success} | |
|
||||
| F261-03 | NULLIF | Evet{.text-success} | |
|
||||
| F261-04 | COALESCE | Evet{.text-success} | |
|
||||
| F261-01 | Basit durum | Evet {.text-success} | |
|
||||
| F261-02 | Aranan dava | Evet {.text-success} | |
|
||||
| F261-03 | NULLIF | Evet {.text-success} | |
|
||||
| F261-04 | COALESCE | Evet {.text-success} | |
|
||||
| **F311** | **Şema tanımı deyimi** | **Kısmi**{.text-warning} | |
|
||||
| F311-01 | CREATE SCHEMA | Hayır{.text-danger} | |
|
||||
| F311-02 | Kalıcı temel tablolar için tablo oluşturma | Evet{.text-success} | |
|
||||
| F311-03 | CREATE VIEW | Evet{.text-success} | |
|
||||
| F311-04 | CREATE VIEW: WITH CHECK OPTION | Hayır{.text-danger} | |
|
||||
| F311-05 | Hibe beyanı | Evet{.text-success} | |
|
||||
| F311-01 | CREATE SCHEMA | Hayır {.text-danger} | |
|
||||
| F311-02 | Kalıcı temel tablolar için tablo oluşturma | Evet {.text-success} | |
|
||||
| F311-03 | CREATE VIEW | Evet {.text-success} | |
|
||||
| F311-04 | CREATE VIEW: WITH CHECK OPTION | Hayır {.text-danger} | |
|
||||
| F311-05 | Hibe beyanı | Evet {.text-success} | |
|
||||
| **F471** | **Skaler alt sorgu değerleri** | **Evet**{.text-success} | |
|
||||
| **F481** | **Genişletilmiş boş yüklem** | **Evet**{.text-success} | |
|
||||
| **F812** | **Temel işaretleme** | **Hayır**{.text-danger} | |
|
||||
| **T321** | **Temel SQL-çağrılan rutinleri** | **Hayır**{.text-danger} | |
|
||||
| T321-01 | Hiçbir aşırı yükleme ile kullanıcı tanımlı fonksiyonlar | Hayır{.text-danger} | |
|
||||
| T321-02 | Hiçbir aşırı yükleme ile kullanıcı tanımlı saklı yordamlar | Hayır{.text-danger} | |
|
||||
| T321-03 | Fonksiyon çağırma | Hayır{.text-danger} | |
|
||||
| T321-04 | Çağrı bildirimi | Hayır{.text-danger} | |
|
||||
| T321-05 | Ret statementurn deyimi | Hayır{.text-danger} | |
|
||||
| T321-01 | Hiçbir aşırı yükleme ile kullanıcı tanımlı fonksiyonlar | Hayır {.text-danger} | |
|
||||
| T321-02 | Hiçbir aşırı yükleme ile kullanıcı tanımlı saklı yordamlar | Hayır {.text-danger} | |
|
||||
| T321-03 | Fonksiyon çağırma | Hayır {.text-danger} | |
|
||||
| T321-04 | Çağrı bildirimi | Hayır {.text-danger} | |
|
||||
| T321-05 | Ret statementurn deyimi | Hayır {.text-danger} | |
|
||||
| **T631** | **Bir liste öğesi ile yüklemde** | **Evet**{.text-success} | |
|
||||
|
1
docs/tr/sql-reference/data-types/lowcardinality.md
Normal file
1
docs/tr/sql-reference/data-types/lowcardinality.md
Normal file
@ -0,0 +1 @@
|
||||
../../../../en/sql-reference/data-types/lowcardinality.md
|
@ -242,8 +242,8 @@ ClickHouse的架构描述可以在此处查看:https://clickhouse.tech/docs/en
|
||||
|
||||
sudo apt install wget xz-utils
|
||||
|
||||
wget https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz
|
||||
wget https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz
|
||||
wget https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz
|
||||
wget https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz
|
||||
|
||||
xz -v -d hits_v1.tsv.xz
|
||||
xz -v -d visits_v1.tsv.xz
|
||||
|
@ -572,7 +572,7 @@ Fork不用于并行化。
|
||||
|
||||
**14.** 返回值
|
||||
|
||||
大部分情况下使用 `return`。不要使用 `[return std::move(res)]{.strike}`。
|
||||
大部分情况下使用 `return`。不要使用 `return std::move(res)`。
|
||||
|
||||
如果函数在堆上分配对象并返回它,请使用 `shared_ptr` 或 `unique_ptr`。
|
||||
|
||||
@ -666,7 +666,7 @@ Loader() {}
|
||||
**24.** 不要使用 `trailing return type` 为必要的功能。
|
||||
|
||||
``` cpp
|
||||
[auto f() -> void;]{.strike}
|
||||
auto f() -> void
|
||||
```
|
||||
|
||||
**25.** 声明和初始化变量。
|
||||
|
@ -7,14 +7,14 @@ toc_title: Yandex.Metrica Data
|
||||
|
||||
数据集由两个表组成,包含关于Yandex.Metrica的hits(`hits_v1`)和visit(`visits_v1`)的匿名数据。你可以阅读更多关于Yandex的信息。在[ClickHouse历史](../../introduction/history.md)的Metrica部分。
|
||||
|
||||
数据集由两个表组成,他们中的任何一个都可以下载作为一个压缩`tsv.xz`的文件或准备的分区。除此之外,一个扩展版的`hits`表包含1亿行TSV在https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_100m_obfuscated_v1.tsv.xz,准备分区在https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_100m_obfuscated_v1.tar.xz。
|
||||
数据集由两个表组成,他们中的任何一个都可以下载作为一个压缩`tsv.xz`的文件或准备的分区。除此之外,一个扩展版的`hits`表包含1亿行TSV在https://datasets.clickhouse.tech/hits/tsv/hits_100m_obfuscated_v1.tsv.xz,准备分区在https://datasets.clickhouse.tech/hits/partitions/hits_100m_obfuscated_v1.tar.xz。
|
||||
|
||||
## 从准备好的分区获取表 {#obtaining-tables-from-prepared-partitions}
|
||||
|
||||
下载和导入`hits`表:
|
||||
|
||||
``` bash
|
||||
curl -O https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_v1.tar
|
||||
curl -O https://datasets.clickhouse.tech/hits/partitions/hits_v1.tar
|
||||
tar xvf hits_v1.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
# check permissions on unpacked data, fix if required
|
||||
sudo service clickhouse-server restart
|
||||
@ -24,7 +24,7 @@ clickhouse-client --query "SELECT COUNT(*) FROM datasets.hits_v1"
|
||||
下载和导入`visits`表:
|
||||
|
||||
``` bash
|
||||
curl -O https://clickhouse-datasets.s3.yandex.net/visits/partitions/visits_v1.tar
|
||||
curl -O https://datasets.clickhouse.tech/visits/partitions/visits_v1.tar
|
||||
tar xvf visits_v1.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
# check permissions on unpacked data, fix if required
|
||||
sudo service clickhouse-server restart
|
||||
@ -36,7 +36,7 @@ clickhouse-client --query "SELECT COUNT(*) FROM datasets.visits_v1"
|
||||
从TSV压缩文件下载并导入`hits`:
|
||||
|
||||
``` bash
|
||||
curl https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
# now create table
|
||||
clickhouse-client --query "CREATE DATABASE IF NOT EXISTS datasets"
|
||||
clickhouse-client --query "CREATE TABLE datasets.hits_v1 ( WatchID UInt64, JavaEnable UInt8, Title String, GoodEvent Int16, EventTime DateTime, EventDate Date, CounterID UInt32, ClientIP UInt32, ClientIP6 FixedString(16), RegionID UInt32, UserID UInt64, CounterClass Int8, OS UInt8, UserAgent UInt8, URL String, Referer String, URLDomain String, RefererDomain String, Refresh UInt8, IsRobot UInt8, RefererCategories Array(UInt16), URLCategories Array(UInt16), URLRegions Array(UInt32), RefererRegions Array(UInt32), ResolutionWidth UInt16, ResolutionHeight UInt16, ResolutionDepth UInt8, FlashMajor UInt8, FlashMinor UInt8, FlashMinor2 String, NetMajor UInt8, NetMinor UInt8, UserAgentMajor UInt16, UserAgentMinor FixedString(2), CookieEnable UInt8, JavascriptEnable UInt8, IsMobile UInt8, MobilePhone UInt8, MobilePhoneModel String, Params String, IPNetworkID UInt32, TraficSourceID Int8, SearchEngineID UInt16, SearchPhrase String, AdvEngineID UInt8, IsArtifical UInt8, WindowClientWidth UInt16, WindowClientHeight UInt16, ClientTimeZone Int16, ClientEventTime DateTime, SilverlightVersion1 UInt8, SilverlightVersion2 UInt8, SilverlightVersion3 UInt32, SilverlightVersion4 UInt16, PageCharset String, CodeVersion UInt32, IsLink UInt8, IsDownload UInt8, IsNotBounce UInt8, FUniqID UInt64, HID UInt32, IsOldCounter UInt8, IsEvent UInt8, IsParameter UInt8, DontCountHits UInt8, WithHash UInt8, HitColor FixedString(1), UTCEventTime DateTime, Age UInt8, Sex UInt8, Income UInt8, Interests UInt16, Robotness UInt8, GeneralInterests Array(UInt16), RemoteIP UInt32, RemoteIP6 FixedString(16), WindowName Int32, OpenerName Int32, HistoryLength Int16, BrowserLanguage FixedString(2), BrowserCountry FixedString(2), SocialNetwork String, SocialAction String, HTTPError UInt16, SendTiming Int32, DNSTiming Int32, ConnectTiming Int32, ResponseStartTiming Int32, ResponseEndTiming Int32, FetchTiming Int32, RedirectTiming Int32, DOMInteractiveTiming Int32, DOMContentLoadedTiming Int32, DOMCompleteTiming Int32, LoadEventStartTiming Int32, LoadEventEndTiming Int32, NSToDOMContentLoadedTiming Int32, FirstPaintTiming Int32, RedirectCount Int8, SocialSourceNetworkID UInt8, SocialSourcePage String, ParamPrice Int64, ParamOrderID String, ParamCurrency FixedString(3), ParamCurrencyID UInt16, GoalsReached Array(UInt32), OpenstatServiceName String, OpenstatCampaignID String, OpenstatAdID String, OpenstatSourceID String, UTMSource String, UTMMedium String, UTMCampaign String, UTMContent String, UTMTerm String, FromTag String, HasGCLID UInt8, RefererHash UInt64, URLHash UInt64, CLID UInt32, YCLID UInt64, ShareService String, ShareURL String, ShareTitle String, ParsedParams Nested(Key1 String, Key2 String, Key3 String, Key4 String, Key5 String, ValueDouble Float64), IslandID FixedString(16), RequestNum UInt32, RequestTry UInt8) ENGINE = MergeTree() PARTITION BY toYYYYMM(EventDate) ORDER BY (CounterID, EventDate, intHash32(UserID)) SAMPLE BY intHash32(UserID) SETTINGS index_granularity = 8192"
|
||||
@ -50,7 +50,7 @@ clickhouse-client --query "SELECT COUNT(*) FROM datasets.hits_v1"
|
||||
从压缩tsv文件下载和导入`visits`:
|
||||
|
||||
``` bash
|
||||
curl https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
# now create table
|
||||
clickhouse-client --query "CREATE DATABASE IF NOT EXISTS datasets"
|
||||
clickhouse-client --query "CREATE TABLE datasets.visits_v1 ( CounterID UInt32, StartDate Date, Sign Int8, IsNew UInt8, VisitID UInt64, UserID UInt64, StartTime DateTime, Duration UInt32, UTCStartTime DateTime, PageViews Int32, Hits Int32, IsBounce UInt8, Referer String, StartURL String, RefererDomain String, StartURLDomain String, EndURL String, LinkURL String, IsDownload UInt8, TraficSourceID Int8, SearchEngineID UInt16, SearchPhrase String, AdvEngineID UInt8, PlaceID Int32, RefererCategories Array(UInt16), URLCategories Array(UInt16), URLRegions Array(UInt32), RefererRegions Array(UInt32), IsYandex UInt8, GoalReachesDepth Int32, GoalReachesURL Int32, GoalReachesAny Int32, SocialSourceNetworkID UInt8, SocialSourcePage String, MobilePhoneModel String, ClientEventTime DateTime, RegionID UInt32, ClientIP UInt32, ClientIP6 FixedString(16), RemoteIP UInt32, RemoteIP6 FixedString(16), IPNetworkID UInt32, SilverlightVersion3 UInt32, CodeVersion UInt32, ResolutionWidth UInt16, ResolutionHeight UInt16, UserAgentMajor UInt16, UserAgentMinor UInt16, WindowClientWidth UInt16, WindowClientHeight UInt16, SilverlightVersion2 UInt8, SilverlightVersion4 UInt16, FlashVersion3 UInt16, FlashVersion4 UInt16, ClientTimeZone Int16, OS UInt8, UserAgent UInt8, ResolutionDepth UInt8, FlashMajor UInt8, FlashMinor UInt8, NetMajor UInt8, NetMinor UInt8, MobilePhone UInt8, SilverlightVersion1 UInt8, Age UInt8, Sex UInt8, Income UInt8, JavaEnable UInt8, CookieEnable UInt8, JavascriptEnable UInt8, IsMobile UInt8, BrowserLanguage UInt16, BrowserCountry UInt16, Interests UInt16, Robotness UInt8, GeneralInterests Array(UInt16), Params Array(String), Goals Nested(ID UInt32, Serial UInt32, EventTime DateTime, Price Int64, OrderID String, CurrencyID UInt32), WatchIDs Array(UInt64), ParamSumPrice Int64, ParamCurrency FixedString(3), ParamCurrencyID UInt16, ClickLogID UInt64, ClickEventID Int32, ClickGoodEvent Int32, ClickEventTime DateTime, ClickPriorityID Int32, ClickPhraseID Int32, ClickPageID Int32, ClickPlaceID Int32, ClickTypeID Int32, ClickResourceID Int32, ClickCost UInt32, ClickClientIP UInt32, ClickDomainID UInt32, ClickURL String, ClickAttempt UInt8, ClickOrderID UInt32, ClickBannerID UInt32, ClickMarketCategoryID UInt32, ClickMarketPP UInt32, ClickMarketCategoryName String, ClickMarketPPName String, ClickAWAPSCampaignName String, ClickPageName String, ClickTargetType UInt16, ClickTargetPhraseID UInt64, ClickContextType UInt8, ClickSelectType Int8, ClickOptions String, ClickGroupBannerID Int32, OpenstatServiceName String, OpenstatCampaignID String, OpenstatAdID String, OpenstatSourceID String, UTMSource String, UTMMedium String, UTMCampaign String, UTMContent String, UTMTerm String, FromTag String, HasGCLID UInt8, FirstVisit DateTime, PredLastVisit Date, LastVisit Date, TotalVisits UInt32, TraficSource Nested(ID Int8, SearchEngineID UInt16, AdvEngineID UInt8, PlaceID UInt16, SocialSourceNetworkID UInt8, Domain String, SearchPhrase String, SocialSourcePage String), Attendance FixedString(16), CLID UInt32, YCLID UInt64, NormalizedRefererHash UInt64, SearchPhraseHash UInt64, RefererDomainHash UInt64, NormalizedStartURLHash UInt64, StartURLDomainHash UInt64, NormalizedEndURLHash UInt64, TopLevelDomain UInt64, URLScheme UInt64, OpenstatServiceNameHash UInt64, OpenstatCampaignIDHash UInt64, OpenstatAdIDHash UInt64, OpenstatSourceIDHash UInt64, UTMSourceHash UInt64, UTMMediumHash UInt64, UTMCampaignHash UInt64, UTMContentHash UInt64, UTMTermHash UInt64, FromHash UInt64, WebVisorEnabled UInt8, WebVisorActivity UInt32, ParsedParams Nested(Key1 String, Key2 String, Key3 String, Key4 String, Key5 String, ValueDouble Float64), Market Nested(Type UInt8, GoalID UInt32, OrderID String, OrderPrice Int64, PP UInt32, DirectPlaceID UInt32, DirectOrderID UInt32, DirectBannerID UInt32, GoodID String, GoodName String, GoodQuantity Int32, GoodPrice Int64), IslandID FixedString(16)) ENGINE = CollapsingMergeTree(Sign) PARTITION BY toYYYYMM(StartDate) ORDER BY (CounterID, StartDate, intHash32(UserID), VisitID) SAMPLE BY intHash32(UserID) SETTINGS index_granularity = 8192"
|
||||
|
@ -283,7 +283,7 @@ SELECT formatReadableSize(sum(bytes)) FROM system.parts WHERE table = 'trips_mer
|
||||
## 下载预处理好的分区数据 {#xia-zai-yu-chu-li-hao-de-fen-qu-shu-ju}
|
||||
|
||||
``` bash
|
||||
$ curl -O https://clickhouse-datasets.s3.yandex.net/trips_mergetree/partitions/trips_mergetree.tar
|
||||
$ curl -O https://datasets.clickhouse.tech/trips_mergetree/partitions/trips_mergetree.tar
|
||||
$ tar xvf trips_mergetree.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
$ # check permissions of unpacked data, fix if required
|
||||
$ sudo service clickhouse-server restart
|
||||
|
@ -154,7 +154,7 @@ $ for i in *.zip; do echo $i; unzip -cq $i '*.csv' | sed 's/\.00//g' | clickhous
|
||||
## 下载预处理好的分区数据 {#xia-zai-yu-chu-li-hao-de-fen-qu-shu-ju}
|
||||
|
||||
``` bash
|
||||
$ curl -O https://clickhouse-datasets.s3.yandex.net/ontime/partitions/ontime.tar
|
||||
$ curl -O https://datasets.clickhouse.tech/ontime/partitions/ontime.tar
|
||||
$ tar xvf ontime.tar -C /var/lib/clickhouse # path to ClickHouse data directory
|
||||
$ # check permissions of unpacked data, fix if required
|
||||
$ sudo service clickhouse-server restart
|
||||
|
@ -85,8 +85,8 @@ clickhouse-client --query='INSERT INTO table FORMAT TabSeparated' < data.tsv
|
||||
### 下载并提取表数据 {#download-and-extract-table-data}
|
||||
|
||||
``` bash
|
||||
curl https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/hits/tsv/hits_v1.tsv.xz | unxz --threads=`nproc` > hits_v1.tsv
|
||||
curl https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv
|
||||
```
|
||||
|
||||
提取的文件大小约为10GB。
|
||||
|
@ -7,27 +7,27 @@ toc_title: "\u5E94\u7528CatBoost\u6A21\u578B"
|
||||
|
||||
# 在ClickHouse中应用Catboost模型 {#applying-catboost-model-in-clickhouse}
|
||||
|
||||
[CatBoost](https://catboost.ai) 是一个用于机器学习的免费开源梯度提升开发库 [Yandex](https://yandex.com/company/) 。
|
||||
[CatBoost](https://catboost.ai) 是一个由[Yandex](https://yandex.com/company/)开发的开源免费机器学习库。
|
||||
|
||||
|
||||
通过这篇指导,您将学会如何将预先从SQL推理出的运行模型作为训练好的模型应用到ClickHouse中去。
|
||||
通过这篇指导,您将学会如何用SQL建模,使用ClickHouse预先训练好的模型来推断数据。
|
||||
|
||||
|
||||
在ClickHouse中应用CatBoost模型:
|
||||
在ClickHouse中应用CatBoost模型的一般过程:
|
||||
|
||||
1. [创建表](#create-table).
|
||||
1. [创建数据表](#create-table).
|
||||
2. [将数据插入到表中](#insert-data-to-table).
|
||||
3. [将CatBoost集成到ClickHouse中](#integrate-catboost-into-clickhouse) (可选步骤)。
|
||||
4. [从SQL运行模型推理](#run-model-inference).
|
||||
3. [将CatBoost集成到ClickHouse中](#integrate-catboost-into-clickhouse) (可跳过)。
|
||||
4. [从SQL运行模型推断](#run-model-inference).
|
||||
|
||||
有关训练CatBoost模型的详细信息,请参阅 [训练和使用模型](https://catboost.ai/docs/features/training.html#training).
|
||||
有关训练CatBoost模型的详细信息,请参阅 [训练和模型应用](https://catboost.ai/docs/features/training.html#training).
|
||||
|
||||
## 先决条件 {#prerequisites}
|
||||
|
||||
请先安装好 [Docker](https://docs.docker.com/install/)。
|
||||
请先安装 [Docker](https://docs.docker.com/install/)。
|
||||
|
||||
!!! note "注"
|
||||
[Docker](https://www.docker.com) 是一个软件平台,允许您创建容器,将CatBoost和ClickHouse安装与系统的其余部分隔离。
|
||||
[Docker](https://www.docker.com) 是一个软件平台,用户可以用来创建独立于其余系统、集成CatBoost和ClickHouse的容器。
|
||||
|
||||
在应用CatBoost模型之前:
|
||||
|
||||
@ -37,7 +37,7 @@ toc_title: "\u5E94\u7528CatBoost\u6A21\u578B"
|
||||
$ docker pull yandex/tutorial-catboost-clickhouse
|
||||
```
|
||||
|
||||
此Docker映像包含运行CatBoost和ClickHouse所需的所有内容:代码、运行时、库、环境变量和配置文件。
|
||||
此Docker映像包含运行CatBoost和ClickHouse所需的所有内容:代码、运行环境、库、环境变量和配置文件。
|
||||
|
||||
**2.** 确保已成功拉取Docker映像:
|
||||
|
||||
@ -53,7 +53,7 @@ yandex/tutorial-catboost-clickhouse latest 622e4d17945b 22
|
||||
$ docker run -it -p 8888:8888 yandex/tutorial-catboost-clickhouse
|
||||
```
|
||||
|
||||
## 1. 创建表 {#create-table}
|
||||
## 1. 创建数据表 {#create-table}
|
||||
|
||||
为训练样本创建ClickHouse表:
|
||||
|
||||
@ -124,19 +124,21 @@ FROM amazon_train
|
||||
## 3. 将CatBoost集成到ClickHouse中 {#integrate-catboost-into-clickhouse}
|
||||
|
||||
!!! note "注"
|
||||
**可选步骤。** Docker映像包含运行CatBoost和ClickHouse所需的所有内容。
|
||||
**可跳过。** Docker映像包含运行CatBoost和ClickHouse所需的所有内容。
|
||||
|
||||
CatBoost集成到ClickHouse步骤:
|
||||
|
||||
**1.** 构建测试库文件。
|
||||
**1.** 构建评估库。
|
||||
|
||||
测试CatBoost模型的最快方法是编译 `libcatboostmodel.<so|dll|dylib>` 库文件. 有关如何构建库文件的详细信息,请参阅 [CatBoost文件](https://catboost.ai/docs/concepts/c-plus-plus-api_dynamic-c-pluplus-wrapper.html).
|
||||
评估CatBoost模型的最快方法是编译 `libcatboostmodel.<so|dll|dylib>` 库文件.
|
||||
|
||||
**2.** 任意创建一个新目录, 如 `data` 并将创建的库文件放入其中。 Docker映像已经包含了库 `data/libcatboostmodel.so`.
|
||||
有关如何构建库文件的详细信息,请参阅 [CatBoost文件](https://catboost.ai/docs/concepts/c-plus-plus-api_dynamic-c-pluplus-wrapper.html).
|
||||
|
||||
**3.** 任意创建一个新目录来放配置模型, 如 `models`.
|
||||
**2.** 创建一个新目录(位置与名称可随意指定), 如 `data` 并将创建的库文件放入其中。 Docker映像已经包含了库 `data/libcatboostmodel.so`.
|
||||
|
||||
**4.** 任意创建一个模型配置文件,如 `models/amazon_model.xml`.
|
||||
**3.** 创建一个新目录来放配置模型, 如 `models`.
|
||||
|
||||
**4.** 创建一个模型配置文件,如 `models/amazon_model.xml`.
|
||||
|
||||
**5.** 描述模型配置:
|
||||
|
||||
@ -163,7 +165,7 @@ CatBoost集成到ClickHouse步骤:
|
||||
<models_config>/home/catboost/models/*_model.xml</models_config>
|
||||
```
|
||||
|
||||
## 4. 运行从SQL推理的模型 {#run-model-inference}
|
||||
## 4. 运行从SQL推断的模型 {#run-model-inference}
|
||||
|
||||
测试模型是否正常,运行ClickHouse客户端 `$ clickhouse client`.
|
||||
|
||||
@ -189,7 +191,7 @@ LIMIT 10
|
||||
!!! note "注"
|
||||
函数 [modelEvaluate](../sql-reference/functions/other-functions.md#function-modelevaluate) 返回带有多类模型的每类原始预测的元组。
|
||||
|
||||
让我们预测一下:
|
||||
执行预测:
|
||||
|
||||
``` sql
|
||||
:) SELECT
|
||||
|
@ -64,6 +64,7 @@ toc_title: "ClickHouse用户"
|
||||
| [Splunk](https://www.splunk.com/) | 业务分析 | 主要产品 | — | — | [英文幻灯片,2018年1月](https://github.com/ClickHouse/clickhouse-presentations/blob/master/meetup12/splunk.pdf) |
|
||||
| [Spotify](https://www.spotify.com) | 音乐 | 实验 | — | — | [幻灯片,七月2018](https://www.slideshare.net/glebus/using-clickhouse-for-experimentation-104247173) |
|
||||
| [腾讯](https://www.tencent.com) | 大数据 | 数据处理 | — | — | [中文幻灯片,2018年10月](https://github.com/ClickHouse/clickhouse-presentations/blob/master/meetup19/5.%20ClickHouse大数据集群应用_李俊飞腾讯网媒事业部.pdf) |
|
||||
| <a href="https://www.tencentmusic.com/" class="favicon">腾讯QQ音乐(TME)</a> | 大数据 | 数据处理 | — | — | [博客文章,2020年6月](https://cloud.tencent.com/developer/article/1637840)
|
||||
| [优步](https://www.uber.com) | 出租车 | 日志记录 | — | — | [幻灯片,二月2020](https://presentations.clickhouse.tech/meetup40/uber.pdf) |
|
||||
| [VKontakte](https://vk.com) | 社交网络 | 统计,日志记录 | — | — | [俄文幻灯片,八月2018](https://github.com/ClickHouse/clickhouse-presentations/blob/master/meetup17/3_vk.pdf) |
|
||||
| [Wisebits](https://wisebits.com/) | IT解决方案 | 分析 | — | — | [俄文幻灯片,2019年5月](https://github.com/ClickHouse/clickhouse-presentations/blob/master/meetup22/strategies.pdf) |
|
||||
|
@ -48,7 +48,7 @@ toc_title: "\u6D4B\u8BD5\u786C\u4EF6"
|
||||
|
||||
<!-- -->
|
||||
|
||||
wget https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_100m_obfuscated_v1.tar.xz
|
||||
wget https://datasets.clickhouse.tech/hits/partitions/hits_100m_obfuscated_v1.tar.xz
|
||||
tar xvf hits_100m_obfuscated_v1.tar.xz -C .
|
||||
mv hits_100m_obfuscated_v1/* .
|
||||
|
||||
|
@ -26,155 +26,155 @@ toc_title: "ANSI\u517C\u5BB9\u6027"
|
||||
| Feature ID | 功能名称 | 状态 | 评论 |
|
||||
|------------|----------------------------------------------------------------|--------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| **E011** | **数字数据类型** | **部分**{.text-warning} | |
|
||||
| E011-01 | 整型和小型数据类型 | 是{.text-success} | |
|
||||
| E011-02 | 真实、双精度和浮点数据类型数据类型 | 部分{.text-warning} | `FLOAT(<binary_precision>)`, `REAL` 和 `DOUBLE PRECISION` 不支持 |
|
||||
| E011-03 | 十进制和数值数据类型 | 部分{.text-warning} | 只有 `DECIMAL(p,s)` 支持,而不是 `NUMERIC` |
|
||||
| E011-04 | 算术运算符 | 是{.text-success} | |
|
||||
| E011-05 | 数字比较 | 是{.text-success} | |
|
||||
| E011-06 | 数字数据类型之间的隐式转换 | 非也。{.text-danger} | ANSI SQL允许在数值类型之间进行任意隐式转换,而ClickHouse依赖于具有多个重载的函数而不是隐式转换 |
|
||||
| E011-01 | 整型和小型数据类型 | 是 {.text-success} | |
|
||||
| E011-02 | 真实、双精度和浮点数据类型数据类型 | 部分 {.text-warning} | `FLOAT(<binary_precision>)`, `REAL` 和 `DOUBLE PRECISION` 不支持 |
|
||||
| E011-03 | 十进制和数值数据类型 | 部分 {.text-warning} | 只有 `DECIMAL(p,s)` 支持,而不是 `NUMERIC` |
|
||||
| E011-04 | 算术运算符 | 是 {.text-success} | |
|
||||
| E011-05 | 数字比较 | 是 {.text-success} | |
|
||||
| E011-06 | 数字数据类型之间的隐式转换 | 非也。 {.text-danger} | ANSI SQL允许在数值类型之间进行任意隐式转换,而ClickHouse依赖于具有多个重载的函数而不是隐式转换 |
|
||||
| **E021** | **字符串类型** | **部分**{.text-warning} | |
|
||||
| E021-01 | 字符数据类型 | 非也。{.text-danger} | |
|
||||
| E021-02 | 字符变化数据类型 | 非也。{.text-danger} | `String` 行为类似,但括号中没有长度限制 |
|
||||
| E021-03 | 字符文字 | 部分{.text-warning} | 不自动连接连续文字和字符集支持 |
|
||||
| E021-04 | 字符长度函数 | 部分{.text-warning} | 非也。 `USING` 条款 |
|
||||
| E021-05 | OCTET_LENGTH函数 | 非也。{.text-danger} | `LENGTH` 表现类似 |
|
||||
| E021-06 | SUBSTRING | 部分{.text-warning} | 不支持 `SIMILAR` 和 `ESCAPE` 条款,否 `SUBSTRING_REGEX` 备选案文 |
|
||||
| E021-07 | 字符串联 | 部分{.text-warning} | 非也。 `COLLATE` 条款 |
|
||||
| E021-08 | 上下功能 | 是{.text-success} | |
|
||||
| E021-09 | 修剪功能 | 是{.text-success} | |
|
||||
| E021-10 | 固定长度和可变长度字符串类型之间的隐式转换 | 非也。{.text-danger} | ANSI SQL允许在字符串类型之间进行任意隐式转换,而ClickHouse依赖于具有多个重载的函数而不是隐式转换 |
|
||||
| E021-11 | 职位功能 | 部分{.text-warning} | 不支持 `IN` 和 `USING` 条款,否 `POSITION_REGEX` 备选案文 |
|
||||
| E021-12 | 字符比较 | 是{.text-success} | |
|
||||
| E021-01 | 字符数据类型 | 非也。 {.text-danger} | |
|
||||
| E021-02 | 字符变化数据类型 | 非也。 {.text-danger} | `String` 行为类似,但括号中没有长度限制 |
|
||||
| E021-03 | 字符文字 | 部分 {.text-warning} | 不自动连接连续文字和字符集支持 |
|
||||
| E021-04 | 字符长度函数 | 部分 {.text-warning} | 非也。 `USING` 条款 |
|
||||
| E021-05 | OCTET_LENGTH函数 | 非也。 {.text-danger} | `LENGTH` 表现类似 |
|
||||
| E021-06 | SUBSTRING | 部分 {.text-warning} | 不支持 `SIMILAR` 和 `ESCAPE` 条款,否 `SUBSTRING_REGEX` 备选案文 |
|
||||
| E021-07 | 字符串联 | 部分 {.text-warning} | 非也。 `COLLATE` 条款 |
|
||||
| E021-08 | 上下功能 | 是 {.text-success} | |
|
||||
| E021-09 | 修剪功能 | 是 {.text-success} | |
|
||||
| E021-10 | 固定长度和可变长度字符串类型之间的隐式转换 | 非也。 {.text-danger} | ANSI SQL允许在字符串类型之间进行任意隐式转换,而ClickHouse依赖于具有多个重载的函数而不是隐式转换 |
|
||||
| E021-11 | 职位功能 | 部分 {.text-warning} | 不支持 `IN` 和 `USING` 条款,否 `POSITION_REGEX` 备选案文 |
|
||||
| E021-12 | 字符比较 | 是 {.text-success} | |
|
||||
| **E031** | **标识符** | **部分**{.text-warning} | |
|
||||
| E031-01 | 分隔标识符 | 部分{.text-warning} | Unicode文字支持有限 |
|
||||
| E031-02 | 小写标识符 | 是{.text-success} | |
|
||||
| E031-03 | 尾部下划线 | 是{.text-success} | |
|
||||
| E031-01 | 分隔标识符 | 部分 {.text-warning} | Unicode文字支持有限 |
|
||||
| E031-02 | 小写标识符 | 是 {.text-success} | |
|
||||
| E031-03 | 尾部下划线 | 是 {.text-success} | |
|
||||
| **E051** | **基本查询规范** | **部分**{.text-warning} | |
|
||||
| E051-01 | SELECT DISTINCT | 是{.text-success} | |
|
||||
| E051-02 | GROUP BY子句 | 是{.text-success} | |
|
||||
| E051-04 | 分组依据可以包含不在列 `<select list>` | 是{.text-success} | |
|
||||
| E051-05 | 选择项目可以重命名 | 是{.text-success} | |
|
||||
| E051-06 | 有条款 | 是{.text-success} | |
|
||||
| E051-07 | 合格\*在选择列表中 | 是{.text-success} | |
|
||||
| E051-08 | FROM子句中的关联名称 | 是{.text-success} | |
|
||||
| E051-09 | 重命名FROM子句中的列 | 非也。{.text-danger} | |
|
||||
| E051-01 | SELECT DISTINCT | 是 {.text-success} | |
|
||||
| E051-02 | GROUP BY子句 | 是 {.text-success} | |
|
||||
| E051-04 | 分组依据可以包含不在列 `<select list>` | 是 {.text-success} | |
|
||||
| E051-05 | 选择项目可以重命名 | 是 {.text-success} | |
|
||||
| E051-06 | 有条款 | 是 {.text-success} | |
|
||||
| E051-07 | 合格\*在选择列表中 | 是 {.text-success} | |
|
||||
| E051-08 | FROM子句中的关联名称 | 是 {.text-success} | |
|
||||
| E051-09 | 重命名FROM子句中的列 | 非也。 {.text-danger} | |
|
||||
| **E061** | **基本谓词和搜索条件** | **部分**{.text-warning} | |
|
||||
| E061-01 | 比较谓词 | 是{.text-success} | |
|
||||
| E061-02 | 谓词之间 | 部分{.text-warning} | 非也。 `SYMMETRIC` 和 `ASYMMETRIC` 条款 |
|
||||
| E061-03 | 在具有值列表的谓词中 | 是{.text-success} | |
|
||||
| E061-04 | 像谓词 | 是{.text-success} | |
|
||||
| E061-05 | LIKE谓词:逃避条款 | 非也。{.text-danger} | |
|
||||
| E061-06 | 空谓词 | 是{.text-success} | |
|
||||
| E061-07 | 量化比较谓词 | 非也。{.text-danger} | |
|
||||
| E061-08 | 存在谓词 | 非也。{.text-danger} | |
|
||||
| E061-09 | 比较谓词中的子查询 | 是{.text-success} | |
|
||||
| E061-11 | 谓词中的子查询 | 是{.text-success} | |
|
||||
| E061-12 | 量化比较谓词中的子查询 | 非也。{.text-danger} | |
|
||||
| E061-13 | 相关子查询 | 非也。{.text-danger} | |
|
||||
| E061-14 | 搜索条件 | 是{.text-success} | |
|
||||
| E061-01 | 比较谓词 | 是 {.text-success} | |
|
||||
| E061-02 | 谓词之间 | 部分 {.text-warning} | 非也。 `SYMMETRIC` 和 `ASYMMETRIC` 条款 |
|
||||
| E061-03 | 在具有值列表的谓词中 | 是 {.text-success} | |
|
||||
| E061-04 | 像谓词 | 是 {.text-success} | |
|
||||
| E061-05 | LIKE谓词:逃避条款 | 非也。 {.text-danger} | |
|
||||
| E061-06 | 空谓词 | 是 {.text-success} | |
|
||||
| E061-07 | 量化比较谓词 | 非也。 {.text-danger} | |
|
||||
| E061-08 | 存在谓词 | 非也。 {.text-danger} | |
|
||||
| E061-09 | 比较谓词中的子查询 | 是 {.text-success} | |
|
||||
| E061-11 | 谓词中的子查询 | 是 {.text-success} | |
|
||||
| E061-12 | 量化比较谓词中的子查询 | 非也。 {.text-danger} | |
|
||||
| E061-13 | 相关子查询 | 非也。 {.text-danger} | |
|
||||
| E061-14 | 搜索条件 | 是 {.text-success} | |
|
||||
| **E071** | **基本查询表达式** | **部分**{.text-warning} | |
|
||||
| E071-01 | UNION DISTINCT table运算符 | 非也。{.text-danger} | |
|
||||
| E071-02 | 联合所有表运算符 | 是{.text-success} | |
|
||||
| E071-03 | 除了不同的表运算符 | 非也。{.text-danger} | |
|
||||
| E071-05 | 通过表运算符组合的列不必具有完全相同的数据类型 | 是{.text-success} | |
|
||||
| E071-06 | 子查询中的表运算符 | 是{.text-success} | |
|
||||
| E071-01 | UNION DISTINCT table运算符 | 非也。 {.text-danger} | |
|
||||
| E071-02 | 联合所有表运算符 | 是 {.text-success} | |
|
||||
| E071-03 | 除了不同的表运算符 | 非也。 {.text-danger} | |
|
||||
| E071-05 | 通过表运算符组合的列不必具有完全相同的数据类型 | 是 {.text-success} | |
|
||||
| E071-06 | 子查询中的表运算符 | 是 {.text-success} | |
|
||||
| **E081** | **基本特权** | **部分**{.text-warning} | 正在进行的工作 |
|
||||
| **E091** | **设置函数** | **是**{.text-success} | |
|
||||
| E091-01 | AVG | 是{.text-success} | |
|
||||
| E091-02 | COUNT | 是{.text-success} | |
|
||||
| E091-03 | MAX | 是{.text-success} | |
|
||||
| E091-04 | MIN | 是{.text-success} | |
|
||||
| E091-05 | SUM | 是{.text-success} | |
|
||||
| E091-06 | 全部量词 | 非也。{.text-danger} | |
|
||||
| E091-07 | 不同的量词 | 部分{.text-warning} | 并非所有聚合函数都受支持 |
|
||||
| E091-01 | AVG | 是 {.text-success} | |
|
||||
| E091-02 | COUNT | 是 {.text-success} | |
|
||||
| E091-03 | MAX | 是 {.text-success} | |
|
||||
| E091-04 | MIN | 是 {.text-success} | |
|
||||
| E091-05 | SUM | 是 {.text-success} | |
|
||||
| E091-06 | 全部量词 | 非也。 {.text-danger} | |
|
||||
| E091-07 | 不同的量词 | 部分 {.text-warning} | 并非所有聚合函数都受支持 |
|
||||
| **E101** | **基本数据操作** | **部分**{.text-warning} | |
|
||||
| E101-01 | 插入语句 | 是{.text-success} | 注:ClickHouse中的主键并不意味着 `UNIQUE` 约束 |
|
||||
| E101-03 | 搜索更新语句 | 非也。{.text-danger} | 有一个 `ALTER UPDATE` 批量数据修改语句 |
|
||||
| E101-04 | 搜索的删除语句 | 非也。{.text-danger} | 有一个 `ALTER DELETE` 批量数据删除声明 |
|
||||
| E101-01 | 插入语句 | 是 {.text-success} | 注:ClickHouse中的主键并不意味着 `UNIQUE` 约束 |
|
||||
| E101-03 | 搜索更新语句 | 非也。 {.text-danger} | 有一个 `ALTER UPDATE` 批量数据修改语句 |
|
||||
| E101-04 | 搜索的删除语句 | 非也。 {.text-danger} | 有一个 `ALTER DELETE` 批量数据删除声明 |
|
||||
| **E111** | **单行SELECT语句** | **非也。**{.text-danger} | |
|
||||
| **E121** | **基本光标支持** | **非也。**{.text-danger} | |
|
||||
| E121-01 | DECLARE CURSOR | 非也。{.text-danger} | |
|
||||
| E121-02 | 按列排序不需要在选择列表中 | 非也。{.text-danger} | |
|
||||
| E121-03 | 按顺序排列的值表达式 | 非也。{.text-danger} | |
|
||||
| E121-04 | 公开声明 | 非也。{.text-danger} | |
|
||||
| E121-06 | 定位更新语句 | 非也。{.text-danger} | |
|
||||
| E121-07 | 定位删除语句 | 非也。{.text-danger} | |
|
||||
| E121-08 | 关闭声明 | 非也。{.text-danger} | |
|
||||
| E121-10 | FETCH语句:隐式NEXT | 非也。{.text-danger} | |
|
||||
| E121-17 | 使用保持游标 | 非也。{.text-danger} | |
|
||||
| E121-01 | DECLARE CURSOR | 非也。 {.text-danger} | |
|
||||
| E121-02 | 按列排序不需要在选择列表中 | 非也。 {.text-danger} | |
|
||||
| E121-03 | 按顺序排列的值表达式 | 非也。 {.text-danger} | |
|
||||
| E121-04 | 公开声明 | 非也。 {.text-danger} | |
|
||||
| E121-06 | 定位更新语句 | 非也。 {.text-danger} | |
|
||||
| E121-07 | 定位删除语句 | 非也。 {.text-danger} | |
|
||||
| E121-08 | 关闭声明 | 非也。 {.text-danger} | |
|
||||
| E121-10 | FETCH语句:隐式NEXT | 非也。 {.text-danger} | |
|
||||
| E121-17 | 使用保持游标 | 非也。 {.text-danger} | |
|
||||
| **E131** | **空值支持(空值代替值)** | **部分**{.text-warning} | 一些限制适用 |
|
||||
| **E141** | **基本完整性约束** | **部分**{.text-warning} | |
|
||||
| E141-01 | 非空约束 | 是{.text-success} | 注: `NOT NULL` 默认情况下,表列隐含 |
|
||||
| E141-02 | 非空列的唯一约束 | 非也。{.text-danger} | |
|
||||
| E141-03 | 主键约束 | 非也。{.text-danger} | |
|
||||
| E141-04 | 对于引用删除操作和引用更新操作,具有默认无操作的基本外键约束 | 非也。{.text-danger} | |
|
||||
| E141-06 | 检查约束 | 是{.text-success} | |
|
||||
| E141-07 | 列默认值 | 是{.text-success} | |
|
||||
| E141-08 | 在主键上推断为非NULL | 是{.text-success} | |
|
||||
| E141-10 | 可以按任何顺序指定外键中的名称 | 非也。{.text-danger} | |
|
||||
| E141-01 | 非空约束 | 是 {.text-success} | 注: `NOT NULL` 默认情况下,表列隐含 |
|
||||
| E141-02 | 非空列的唯一约束 | 非也。 {.text-danger} | |
|
||||
| E141-03 | 主键约束 | 非也。 {.text-danger} | |
|
||||
| E141-04 | 对于引用删除操作和引用更新操作,具有默认无操作的基本外键约束 | 非也。 {.text-danger} | |
|
||||
| E141-06 | 检查约束 | 是 {.text-success} | |
|
||||
| E141-07 | 列默认值 | 是 {.text-success} | |
|
||||
| E141-08 | 在主键上推断为非NULL | 是 {.text-success} | |
|
||||
| E141-10 | 可以按任何顺序指定外键中的名称 | 非也。 {.text-danger} | |
|
||||
| **E151** | **交易支持** | **非也。**{.text-danger} | |
|
||||
| E151-01 | 提交语句 | 非也。{.text-danger} | |
|
||||
| E151-02 | 回滚语句 | 非也。{.text-danger} | |
|
||||
| E151-01 | 提交语句 | 非也。 {.text-danger} | |
|
||||
| E151-02 | 回滚语句 | 非也。 {.text-danger} | |
|
||||
| **E152** | **基本设置事务语句** | **非也。**{.text-danger} | |
|
||||
| E152-01 | SET TRANSACTION语句:隔离级别SERIALIZABLE子句 | 非也。{.text-danger} | |
|
||||
| E152-02 | SET TRANSACTION语句:只读和读写子句 | 非也。{.text-danger} | |
|
||||
| E152-01 | SET TRANSACTION语句:隔离级别SERIALIZABLE子句 | 非也。 {.text-danger} | |
|
||||
| E152-02 | SET TRANSACTION语句:只读和读写子句 | 非也。 {.text-danger} | |
|
||||
| **E153** | **具有子查询的可更新查询** | **非也。**{.text-danger} | |
|
||||
| **E161** | **SQL注释使用前导双减** | **是**{.text-success} | |
|
||||
| **E171** | **SQLSTATE支持** | **非也。**{.text-danger} | |
|
||||
| **E182** | **主机语言绑定** | **非也。**{.text-danger} | |
|
||||
| **F031** | **基本架构操作** | **部分**{.text-warning} | |
|
||||
| F031-01 | CREATE TABLE语句创建持久基表 | 部分{.text-warning} | 非也。 `SYSTEM VERSIONING`, `ON COMMIT`, `GLOBAL`, `LOCAL`, `PRESERVE`, `DELETE`, `REF IS`, `WITH OPTIONS`, `UNDER`, `LIKE`, `PERIOD FOR` 子句,不支持用户解析的数据类型 |
|
||||
| F031-02 | 创建视图语句 | 部分{.text-warning} | 非也。 `RECURSIVE`, `CHECK`, `UNDER`, `WITH OPTIONS` 子句,不支持用户解析的数据类型 |
|
||||
| F031-03 | 赠款声明 | 是{.text-success} | |
|
||||
| F031-04 | ALTER TABLE语句:ADD COLUMN子句 | 部分{.text-warning} | 不支持 `GENERATED` 条款和系统时间段 |
|
||||
| F031-13 | DROP TABLE语句:RESTRICT子句 | 非也。{.text-danger} | |
|
||||
| F031-16 | DROP VIEW语句:RESTRICT子句 | 非也。{.text-danger} | |
|
||||
| F031-19 | REVOKE语句:RESTRICT子句 | 非也。{.text-danger} | |
|
||||
| F031-01 | CREATE TABLE语句创建持久基表 | 部分 {.text-warning} | 非也。 `SYSTEM VERSIONING`, `ON COMMIT`, `GLOBAL`, `LOCAL`, `PRESERVE`, `DELETE`, `REF IS`, `WITH OPTIONS`, `UNDER`, `LIKE`, `PERIOD FOR` 子句,不支持用户解析的数据类型 |
|
||||
| F031-02 | 创建视图语句 | 部分 {.text-warning} | 非也。 `RECURSIVE`, `CHECK`, `UNDER`, `WITH OPTIONS` 子句,不支持用户解析的数据类型 |
|
||||
| F031-03 | 赠款声明 | 是 {.text-success} | |
|
||||
| F031-04 | ALTER TABLE语句:ADD COLUMN子句 | 部分 {.text-warning} | 不支持 `GENERATED` 条款和系统时间段 |
|
||||
| F031-13 | DROP TABLE语句:RESTRICT子句 | 非也。 {.text-danger} | |
|
||||
| F031-16 | DROP VIEW语句:RESTRICT子句 | 非也。 {.text-danger} | |
|
||||
| F031-19 | REVOKE语句:RESTRICT子句 | 非也。 {.text-danger} | |
|
||||
| **F041** | **基本连接表** | **部分**{.text-warning} | |
|
||||
| F041-01 | Inner join(但不一定是INNER关键字) | 是{.text-success} | |
|
||||
| F041-02 | 内部关键字 | 是{.text-success} | |
|
||||
| F041-03 | LEFT OUTER JOIN | 是{.text-success} | |
|
||||
| F041-04 | RIGHT OUTER JOIN | 是{.text-success} | |
|
||||
| F041-05 | 可以嵌套外部连接 | 是{.text-success} | |
|
||||
| F041-07 | 左侧或右侧外部联接中的内部表也可用于内部联接 | 是{.text-success} | |
|
||||
| F041-08 | 支持所有比较运算符(而不仅仅是=) | 非也。{.text-danger} | |
|
||||
| F041-01 | Inner join(但不一定是INNER关键字) | 是 {.text-success} | |
|
||||
| F041-02 | 内部关键字 | 是 {.text-success} | |
|
||||
| F041-03 | LEFT OUTER JOIN | 是 {.text-success} | |
|
||||
| F041-04 | RIGHT OUTER JOIN | 是 {.text-success} | |
|
||||
| F041-05 | 可以嵌套外部连接 | 是 {.text-success} | |
|
||||
| F041-07 | 左侧或右侧外部联接中的内部表也可用于内部联接 | 是 {.text-success} | |
|
||||
| F041-08 | 支持所有比较运算符(而不仅仅是=) | 非也。 {.text-danger} | |
|
||||
| **F051** | **基本日期和时间** | **部分**{.text-warning} | |
|
||||
| F051-01 | 日期数据类型(包括对日期文字的支持) | 部分{.text-warning} | 没有文字 |
|
||||
| F051-02 | 时间数据类型(包括对时间文字的支持),秒小数精度至少为0 | 非也。{.text-danger} | |
|
||||
| F051-03 | 时间戳数据类型(包括对时间戳文字的支持),小数秒精度至少为0和6 | 非也。{.text-danger} | `DateTime64` 时间提供了类似的功能 |
|
||||
| F051-04 | 日期、时间和时间戳数据类型的比较谓词 | 部分{.text-warning} | 只有一种数据类型可用 |
|
||||
| F051-05 | Datetime类型和字符串类型之间的显式转换 | 是{.text-success} | |
|
||||
| F051-06 | CURRENT_DATE | 非也。{.text-danger} | `today()` 是相似的 |
|
||||
| F051-07 | LOCALTIME | 非也。{.text-danger} | `now()` 是相似的 |
|
||||
| F051-08 | LOCALTIMESTAMP | 非也。{.text-danger} | |
|
||||
| F051-01 | 日期数据类型(包括对日期文字的支持) | 部分 {.text-warning} | 没有文字 |
|
||||
| F051-02 | 时间数据类型(包括对时间文字的支持),秒小数精度至少为0 | 非也。 {.text-danger} | |
|
||||
| F051-03 | 时间戳数据类型(包括对时间戳文字的支持),小数秒精度至少为0和6 | 非也。 {.text-danger} | `DateTime64` 时间提供了类似的功能 |
|
||||
| F051-04 | 日期、时间和时间戳数据类型的比较谓词 | 部分 {.text-warning} | 只有一种数据类型可用 |
|
||||
| F051-05 | Datetime类型和字符串类型之间的显式转换 | 是 {.text-success} | |
|
||||
| F051-06 | CURRENT_DATE | 非也。 {.text-danger} | `today()` 是相似的 |
|
||||
| F051-07 | LOCALTIME | 非也。 {.text-danger} | `now()` 是相似的 |
|
||||
| F051-08 | LOCALTIMESTAMP | 非也。 {.text-danger} | |
|
||||
| **F081** | **联盟和视图除外** | **部分**{.text-warning} | |
|
||||
| **F131** | **分组操作** | **部分**{.text-warning} | |
|
||||
| F131-01 | WHERE、GROUP BY和HAVING子句在具有分组视图的查询中受支持 | 是{.text-success} | |
|
||||
| F131-02 | 具有分组视图的查询中支持的多个表 | 是{.text-success} | |
|
||||
| F131-03 | 设置具有分组视图的查询中支持的函数 | 是{.text-success} | |
|
||||
| F131-04 | 具有分组依据和具有子句和分组视图的子查询 | 是{.text-success} | |
|
||||
| F131-05 | 单行选择具有GROUP BY和具有子句和分组视图 | 非也。{.text-danger} | |
|
||||
| F131-01 | WHERE、GROUP BY和HAVING子句在具有分组视图的查询中受支持 | 是 {.text-success} | |
|
||||
| F131-02 | 具有分组视图的查询中支持的多个表 | 是 {.text-success} | |
|
||||
| F131-03 | 设置具有分组视图的查询中支持的函数 | 是 {.text-success} | |
|
||||
| F131-04 | 具有分组依据和具有子句和分组视图的子查询 | 是 {.text-success} | |
|
||||
| F131-05 | 单行选择具有GROUP BY和具有子句和分组视图 | 非也。 {.text-danger} | |
|
||||
| **F181** | **多模块支持** | **非也。**{.text-danger} | |
|
||||
| **F201** | **投函数** | **是**{.text-success} | |
|
||||
| **F221** | **显式默认值** | **非也。**{.text-danger} | |
|
||||
| **F261** | **案例表达式** | **是**{.text-success} | |
|
||||
| F261-01 | 简单案例 | 是{.text-success} | |
|
||||
| F261-02 | 检索案例 | 是{.text-success} | |
|
||||
| F261-03 | NULLIF | 是{.text-success} | |
|
||||
| F261-04 | COALESCE | 是{.text-success} | |
|
||||
| F261-01 | 简单案例 | 是 {.text-success} | |
|
||||
| F261-02 | 检索案例 | 是 {.text-success} | |
|
||||
| F261-03 | NULLIF | 是 {.text-success} | |
|
||||
| F261-04 | COALESCE | 是 {.text-success} | |
|
||||
| **F311** | **架构定义语句** | **部分**{.text-warning} | |
|
||||
| F311-01 | CREATE SCHEMA | 非也。{.text-danger} | |
|
||||
| F311-02 | 为持久基表创建表 | 是{.text-success} | |
|
||||
| F311-03 | CREATE VIEW | 是{.text-success} | |
|
||||
| F311-04 | CREATE VIEW: WITH CHECK OPTION | 非也。{.text-danger} | |
|
||||
| F311-05 | 赠款声明 | 是{.text-success} | |
|
||||
| F311-01 | CREATE SCHEMA | 非也。 {.text-danger} | |
|
||||
| F311-02 | 为持久基表创建表 | 是 {.text-success} | |
|
||||
| F311-03 | CREATE VIEW | 是 {.text-success} | |
|
||||
| F311-04 | CREATE VIEW: WITH CHECK OPTION | 非也。 {.text-danger} | |
|
||||
| F311-05 | 赠款声明 | 是 {.text-success} | |
|
||||
| **F471** | **标量子查询值** | **是**{.text-success} | |
|
||||
| **F481** | **扩展空谓词** | **是**{.text-success} | |
|
||||
| **F812** | **基本标记** | **非也。**{.text-danger} | |
|
||||
| **T321** | **基本的SQL调用例程** | **非也。**{.text-danger} | |
|
||||
| T321-01 | 无重载的用户定义函数 | 非也。{.text-danger} | |
|
||||
| T321-02 | 无重载的用户定义存储过程 | 非也。{.text-danger} | |
|
||||
| T321-03 | 函数调用 | 非也。{.text-danger} | |
|
||||
| T321-04 | 电话声明 | 非也。{.text-danger} | |
|
||||
| T321-05 | 退货声明 | 非也。{.text-danger} | |
|
||||
| T321-01 | 无重载的用户定义函数 | 非也。 {.text-danger} | |
|
||||
| T321-02 | 无重载的用户定义存储过程 | 非也。 {.text-danger} | |
|
||||
| T321-03 | 函数调用 | 非也。 {.text-danger} | |
|
||||
| T321-04 | 电话声明 | 非也。 {.text-danger} | |
|
||||
| T321-05 | 退货声明 | 非也。 {.text-danger} | |
|
||||
| **T631** | **在一个列表元素的谓词中** | **是**{.text-success} | |
|
||||
|
@ -1,21 +1,21 @@
|
||||
# 字符串替换函数 {#zi-fu-chuan-ti-huan-han-shu}
|
||||
|
||||
## replaceOne(大海捞针,模式,更换) {#replaceonehaystack-pattern-replacement}
|
||||
## replaceOne(haystack, pattern, replacement) {#replaceonehaystack-pattern-replacement}
|
||||
|
||||
用’replacement’子串替换’haystack’中与’pattern’子串第一个匹配的匹配项(如果存在)。
|
||||
用’replacement’子串替换’haystack’中第一次出现的’pattern’子串(如果存在)。
|
||||
’pattern’和’replacement’必须是常量。
|
||||
|
||||
## replaceAll(大海捞针,模式,替换),替换(大海捞针,模式,替换) {#replaceallhaystack-pattern-replacement-replacehaystack-pattern-replacement}
|
||||
## replaceAll(haystack, pattern, replacement), replace(haystack, pattern, replacement) {#replaceallhaystack-pattern-replacement-replacehaystack-pattern-replacement}
|
||||
|
||||
用’replacement’子串替换’haystack’中出现的所有’pattern’子串。
|
||||
用’replacement’子串替换’haystack’中出现的所有的’pattern’子串。
|
||||
|
||||
## replaceRegexpOne(大海捞针,模式,更换) {#replaceregexponehaystack-pattern-replacement}
|
||||
## replaceRegexpOne(haystack, pattern, replacement) {#replaceregexponehaystack-pattern-replacement}
|
||||
|
||||
使用’pattern’正则表达式替换。 ‘pattern’可以是任意一个有效的re2正则表达式。
|
||||
如果存在与正则表达式匹配的匹配项,仅替换第一个匹配项。
|
||||
同时‘replacement’可以指定为正则表达式中的捕获组。可以包含`\0-\9`。
|
||||
在这种情况下,函数将使用正则表达式的整个匹配项替换‘\\0’。使用其他与之对应的子模式替换对应的’\\1-\\9’。要在模版中使用’‘字符,请使用’’将其转义。
|
||||
另外还请记住,字符串文字需要额外的转义。
|
||||
使用’pattern’正则表达式的替换。 ‘pattern’可以是任意一个有效的re2正则表达式。
|
||||
如果存在与’pattern’正则表达式匹配的匹配项,仅替换第一个匹配项。
|
||||
模式pattern可以指定为‘replacement’。此模式可以包含替代`\0-\9`。
|
||||
替代`\0`包含了整个正则表达式。替代`\1-\9`对应于子模式编号。要在模板中使用反斜杠`\`,请使用`\`将其转义。
|
||||
另外还请记住,字符串字面值(literal)需要额外的转义。
|
||||
|
||||
示例1.将日期转换为美国格式:
|
||||
|
||||
@ -46,7 +46,7 @@ SELECT replaceRegexpOne('Hello, World!', '.*', '\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0')
|
||||
│ Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World! │
|
||||
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
## replaceRegexpAll(大海捞针,模式,替换) {#replaceregexpallhaystack-pattern-replacement}
|
||||
## replaceRegexpAll(haystack, pattern, replacement) {#replaceregexpallhaystack-pattern-replacement}
|
||||
|
||||
与replaceRegexpOne相同,但会替换所有出现的匹配项。例如:
|
||||
|
||||
@ -58,7 +58,7 @@ SELECT replaceRegexpAll('Hello, World!', '.', '\\0\\0') AS res
|
||||
│ HHeelllloo,, WWoorrlldd!! │
|
||||
└────────────────────────────┘
|
||||
|
||||
例外的是,如果使用正则表达式捕获空白子串,则仅会进行一次替换。
|
||||
作为例外,对于空子字符串,正则表达式只会进行一次替换。
|
||||
示例:
|
||||
|
||||
``` sql
|
||||
@ -72,8 +72,9 @@ SELECT replaceRegexpAll('Hello, World!', '^', 'here: ') AS res
|
||||
## regexpQuoteMeta(s) {#regexpquotemetas}
|
||||
|
||||
该函数用于在字符串中的某些预定义字符之前添加反斜杠。
|
||||
预定义字符:‘0’,‘\\’,‘\|’,‘(’,‘)’,‘^’,‘$’,‘。’,‘\[’,‘\]’,‘?’,‘\*’,‘+’,‘{’,‘:’,’ - ’。
|
||||
这个实现与re2 :: RE2 :: QuoteMeta略有不同。它以\\0而不是00转义零字节,它只转义所需的字符。
|
||||
有关详细信息,请参阅链接:\[RE2\](https://github.com/google/re2/blob/master/re2/re2.cc#L473)
|
||||
预定义字符:`\0`, `\\`, `|`, `(`, `)`, `^`, `$`, `.`, `[`, `]`, `?`, `*`, `+`, `{`, `:`, `-`。
|
||||
这个实现与re2::RE2::QuoteMeta略有不同。它以`\0` 转义零字节,而不是`\x00`,并且只转义必需的字符。
|
||||
有关详细信息,请参阅链接:[RE2](https://github.com/google/re2/blob/master/re2/re2.cc#L473)
|
||||
|
||||
[来源文章](https://clickhouse.tech/docs/en/query_language/functions/string_replace_functions/) <!--hide-->
|
||||
|
||||
|
@ -14,7 +14,7 @@ toc_title: LIMIT
|
||||
|
||||
## LIMIT … WITH TIES 修饰符 {#limit-with-ties}
|
||||
|
||||
如果为 `LIMIT n[,m]` 设置了 `WITH TIES` ,并且声明了 `ORDER BY expr_list`, you will get in result first `n` or `n,m` rows and all rows with same `ORDER BY` fields values equal to row at position `n` for `LIMIT n` and `m` for `LIMIT n,m`.
|
||||
如果为 `LIMIT n[,m]` 设置了 `WITH TIES` ,并且声明了 `ORDER BY expr_list`, 除了得到无修饰符的结果(正常情况下的 `limit n`, 前n行数据), 还会返回与第`n`行具有相同排序字段的行(即如果第n+1行的字段与第n行 拥有相同的排序字段,同样返回该结果.
|
||||
|
||||
此修饰符可以与: [ORDER BY … WITH FILL modifier](../../../sql-reference/statements/select/order-by.md#orderby-with-fill) 组合使用.
|
||||
|
||||
@ -38,7 +38,7 @@ SELECT * FROM (
|
||||
└───┘
|
||||
```
|
||||
|
||||
单子执行了 `WITH TIES` 修饰符后
|
||||
添加 `WITH TIES` 修饰符后
|
||||
|
||||
``` sql
|
||||
SELECT * FROM (
|
||||
@ -59,4 +59,8 @@ SELECT * FROM (
|
||||
└───┘
|
||||
```
|
||||
|
||||
cause row number 6 have same value “2” for field `n` as row number 5
|
||||
虽然指定了`LIMIT 5`, 但第6行的`n`字段值为2,与第5行相同,因此也作为满足条件的记录返回。
|
||||
简而言之,该修饰符可理解为是否增加“并列行”的数据。
|
||||
|
||||
``` sql,
|
||||
``` sql
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <IO/WriteHelpers.h>
|
||||
#include <IO/Operators.h>
|
||||
#include <IO/ConnectionTimeouts.h>
|
||||
#include <IO/ConnectionTimeoutsContext.h>
|
||||
#include <IO/UseSSL.h>
|
||||
#include <DataStreams/RemoteBlockInputStream.h>
|
||||
#include <Interpreters/Context.h>
|
||||
@ -95,6 +96,7 @@ public:
|
||||
}
|
||||
|
||||
global_context.makeGlobalContext();
|
||||
global_context.setSettings(settings);
|
||||
|
||||
std::cerr << std::fixed << std::setprecision(3);
|
||||
|
||||
@ -404,7 +406,7 @@ private:
|
||||
Stopwatch watch;
|
||||
RemoteBlockInputStream stream(
|
||||
*(*connection_entries[connection_index]),
|
||||
query, {}, global_context, &settings, nullptr, Scalars(), Tables(), query_processing_stage);
|
||||
query, {}, global_context, nullptr, Scalars(), Tables(), query_processing_stage);
|
||||
if (!query_id.empty())
|
||||
stream.setQueryId(query_id);
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <Common/ZooKeeper/ZooKeeper.h>
|
||||
#include <Common/ZooKeeper/KeeperException.h>
|
||||
#include <Common/setThreadName.h>
|
||||
#include <IO/ConnectionTimeoutsContext.h>
|
||||
|
||||
|
||||
namespace DB
|
||||
@ -1588,11 +1589,14 @@ void ClusterCopier::dropParticularPartitionPieceFromAllHelpingTables(const TaskT
|
||||
LOG_DEBUG(log, "All helping tables dropped partition {}", partition_name);
|
||||
}
|
||||
|
||||
String ClusterCopier::getRemoteCreateTable(const DatabaseAndTableName & table, Connection & connection, const Settings * settings)
|
||||
String ClusterCopier::getRemoteCreateTable(const DatabaseAndTableName & table, Connection & connection, const Settings & settings)
|
||||
{
|
||||
Context remote_context(context);
|
||||
remote_context.setSettings(settings);
|
||||
|
||||
String query = "SHOW CREATE TABLE " + getQuotedTable(table);
|
||||
Block block = getBlockWithAllStreamData(std::make_shared<RemoteBlockInputStream>(
|
||||
connection, query, InterpreterShowCreateQuery::getSampleBlock(), context, settings));
|
||||
connection, query, InterpreterShowCreateQuery::getSampleBlock(), remote_context));
|
||||
|
||||
return typeid_cast<const ColumnString &>(*block.safeGetByPosition(0).column).getDataAt(0).toString();
|
||||
}
|
||||
@ -1604,7 +1608,7 @@ ASTPtr ClusterCopier::getCreateTableForPullShard(const ConnectionTimeouts & time
|
||||
String create_query_pull_str = getRemoteCreateTable(
|
||||
task_shard.task_table.table_pull,
|
||||
*connection_entry,
|
||||
&task_cluster->settings_pull);
|
||||
task_cluster->settings_pull);
|
||||
|
||||
ParserCreateQuery parser_create_query;
|
||||
const auto & settings = context.getSettingsRef();
|
||||
@ -1856,6 +1860,9 @@ UInt64 ClusterCopier::executeQueryOnCluster(
|
||||
auto timeouts = ConnectionTimeouts::getTCPTimeoutsWithFailover(shard_settings).getSaturated(shard_settings.max_execution_time);
|
||||
auto connections = shard.pool->getMany(timeouts, &shard_settings, pool_mode);
|
||||
|
||||
Context shard_context(context);
|
||||
shard_context.setSettings(shard_settings);
|
||||
|
||||
for (auto & connection : connections)
|
||||
{
|
||||
if (connection.isNull())
|
||||
@ -1864,7 +1871,7 @@ UInt64 ClusterCopier::executeQueryOnCluster(
|
||||
try
|
||||
{
|
||||
/// CREATE TABLE and DROP PARTITION queries return empty block
|
||||
RemoteBlockInputStream stream{*connection, query, Block{}, context, &shard_settings};
|
||||
RemoteBlockInputStream stream{*connection, query, Block{}, shard_context};
|
||||
NullBlockOutputStream output{Block{}};
|
||||
copyData(stream, output);
|
||||
|
||||
|
@ -154,7 +154,7 @@ protected:
|
||||
/// table we can get rid of partition pieces (partitions in helping tables).
|
||||
void dropParticularPartitionPieceFromAllHelpingTables(const TaskTable & task_table, const String & partition_name);
|
||||
|
||||
String getRemoteCreateTable(const DatabaseAndTableName & table, Connection & connection, const Settings * settings = nullptr);
|
||||
String getRemoteCreateTable(const DatabaseAndTableName & table, Connection & connection, const Settings & settings);
|
||||
|
||||
ASTPtr getCreateTableForPullShard(const ConnectionTimeouts & timeouts, TaskShard & task_shard);
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "ClusterCopierApp.h"
|
||||
#include <Common/StatusFile.h>
|
||||
#include <Common/TerminalSize.h>
|
||||
#include <IO/ConnectionTimeoutsContext.h>
|
||||
#include <Formats/registerFormats.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "Aliases.h"
|
||||
#include <Poco/Util/AbstractConfiguration.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
@ -12,7 +13,9 @@ namespace ErrorCodes
|
||||
struct TaskCluster
|
||||
{
|
||||
TaskCluster(const String & task_zookeeper_path_, const String & default_local_database_)
|
||||
: task_zookeeper_path(task_zookeeper_path_), default_local_database(default_local_database_) {}
|
||||
: task_zookeeper_path(task_zookeeper_path_)
|
||||
, default_local_database(default_local_database_)
|
||||
{}
|
||||
|
||||
void loadTasks(const Poco::Util::AbstractConfiguration & config, const String & base_key = "");
|
||||
|
||||
|
1
programs/server/config.d/test_keeper_port.xml
Symbolic link
1
programs/server/config.d/test_keeper_port.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../../../tests/config/config.d/test_keeper_port.xml
|
@ -534,6 +534,23 @@
|
||||
var theme = window.localStorage.getItem('theme');
|
||||
if (theme) {
|
||||
setColorTheme(theme);
|
||||
} else {
|
||||
/// Obtain system-level user preference
|
||||
var media_query_list = window.matchMedia('prefers-color-scheme: dark')
|
||||
|
||||
if (media_query_list.matches) {
|
||||
/// Set without saving to localstorage
|
||||
document.documentElement.setAttribute('data-theme', 'dark');
|
||||
}
|
||||
|
||||
/// There is a rumor that on some computers, the theme is changing automatically on day/night.
|
||||
media_query_list.addEventListener('change', function(e) {
|
||||
if (e.matches) {
|
||||
document.documentElement.setAttribute('data-theme', 'dark');
|
||||
} else {
|
||||
document.documentElement.setAttribute('data-theme', 'light');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
document.getElementById('toggle-light').onclick = function()
|
||||
|
@ -41,42 +41,7 @@ namespace
|
||||
}
|
||||
|
||||
|
||||
void applyParamsToAccessRights(AccessRights & access, const ContextAccessParams & params)
|
||||
{
|
||||
static const AccessFlags table_ddl = AccessType::CREATE_DATABASE | AccessType::CREATE_TABLE | AccessType::CREATE_VIEW
|
||||
| AccessType::ALTER_TABLE | AccessType::ALTER_VIEW | AccessType::DROP_DATABASE | AccessType::DROP_TABLE | AccessType::DROP_VIEW
|
||||
| AccessType::TRUNCATE;
|
||||
|
||||
static const AccessFlags dictionary_ddl = AccessType::CREATE_DICTIONARY | AccessType::DROP_DICTIONARY;
|
||||
static const AccessFlags table_and_dictionary_ddl = table_ddl | dictionary_ddl;
|
||||
static const AccessFlags write_table_access = AccessType::INSERT | AccessType::OPTIMIZE;
|
||||
static const AccessFlags write_dcl_access = AccessType::ACCESS_MANAGEMENT - AccessType::SHOW_ACCESS;
|
||||
|
||||
if (params.readonly)
|
||||
access.revoke(write_table_access | table_and_dictionary_ddl | write_dcl_access | AccessType::SYSTEM | AccessType::KILL_QUERY);
|
||||
|
||||
if (params.readonly == 1)
|
||||
{
|
||||
/// Table functions are forbidden in readonly mode.
|
||||
/// For readonly = 2 they're allowed.
|
||||
access.revoke(AccessType::CREATE_TEMPORARY_TABLE);
|
||||
}
|
||||
|
||||
if (!params.allow_ddl)
|
||||
access.revoke(table_and_dictionary_ddl);
|
||||
|
||||
if (!params.allow_introspection)
|
||||
access.revoke(AccessType::INTROSPECTION);
|
||||
|
||||
if (params.readonly)
|
||||
{
|
||||
/// No grant option in readonly mode.
|
||||
access.revokeGrantOption(AccessType::ALL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void addImplicitAccessRights(AccessRights & access)
|
||||
AccessRights addImplicitAccessRights(const AccessRights & access)
|
||||
{
|
||||
auto modifier = [&](const AccessFlags & flags, const AccessFlags & min_flags_with_children, const AccessFlags & max_flags_with_children, const std::string_view & database, const std::string_view & table, const std::string_view & column) -> AccessFlags
|
||||
{
|
||||
@ -150,23 +115,12 @@ namespace
|
||||
return res;
|
||||
};
|
||||
|
||||
access.modifyFlags(modifier);
|
||||
|
||||
/// Transform access to temporary tables into access to "_temporary_and_external_tables" database.
|
||||
if (access.isGranted(AccessType::CREATE_TEMPORARY_TABLE))
|
||||
access.grant(AccessFlags::allTableFlags() | AccessFlags::allColumnFlags(), DatabaseCatalog::TEMPORARY_DATABASE);
|
||||
AccessRights res = access;
|
||||
res.modifyFlags(modifier);
|
||||
|
||||
/// Anyone has access to the "system" database.
|
||||
access.grant(AccessType::SELECT, DatabaseCatalog::SYSTEM_DATABASE);
|
||||
}
|
||||
|
||||
|
||||
AccessRights calculateFinalAccessRights(const AccessRights & access_from_user_and_roles, const ContextAccessParams & params)
|
||||
{
|
||||
AccessRights res_access = access_from_user_and_roles;
|
||||
applyParamsToAccessRights(res_access, params);
|
||||
addImplicitAccessRights(res_access);
|
||||
return res_access;
|
||||
res.grant(AccessType::SELECT, DatabaseCatalog::SYSTEM_DATABASE);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@ -176,6 +130,12 @@ namespace
|
||||
ids[0] = id;
|
||||
return ids;
|
||||
}
|
||||
|
||||
/// Helper for using in templates.
|
||||
std::string_view getDatabase() { return {}; }
|
||||
|
||||
template <typename... OtherArgs>
|
||||
std::string_view getDatabase(const std::string_view & arg1, const OtherArgs &...) { return arg1; }
|
||||
}
|
||||
|
||||
|
||||
@ -203,10 +163,7 @@ void ContextAccess::setUser(const UserPtr & user_) const
|
||||
/// User has been dropped.
|
||||
auto nothing_granted = std::make_shared<AccessRights>();
|
||||
access = nothing_granted;
|
||||
access_without_readonly = nothing_granted;
|
||||
access_with_allow_ddl = nothing_granted;
|
||||
access_with_allow_introspection = nothing_granted;
|
||||
access_from_user_and_roles = nothing_granted;
|
||||
access_with_implicit = nothing_granted;
|
||||
subscription_for_user_change = {};
|
||||
subscription_for_roles_changes = {};
|
||||
enabled_roles = nullptr;
|
||||
@ -270,12 +227,8 @@ void ContextAccess::setRolesInfo(const std::shared_ptr<const EnabledRolesInfo> &
|
||||
|
||||
void ContextAccess::calculateAccessRights() const
|
||||
{
|
||||
access_from_user_and_roles = std::make_shared<AccessRights>(mixAccessRightsFromUserAndRoles(*user, *roles_info));
|
||||
access = std::make_shared<AccessRights>(calculateFinalAccessRights(*access_from_user_and_roles, params));
|
||||
|
||||
access_without_readonly = nullptr;
|
||||
access_with_allow_ddl = nullptr;
|
||||
access_with_allow_introspection = nullptr;
|
||||
access = std::make_shared<AccessRights>(mixAccessRightsFromUserAndRoles(*user, *roles_info));
|
||||
access_with_implicit = std::make_shared<AccessRights>(addImplicitAccessRights(*access));
|
||||
|
||||
if (trace_log)
|
||||
{
|
||||
@ -287,6 +240,7 @@ void ContextAccess::calculateAccessRights() const
|
||||
}
|
||||
LOG_TRACE(trace_log, "Settings: readonly={}, allow_ddl={}, allow_introspection_functions={}", params.readonly, params.allow_ddl, params.allow_introspection);
|
||||
LOG_TRACE(trace_log, "List of all grants: {}", access->toString());
|
||||
LOG_TRACE(trace_log, "List of all grants including implicit: {}", access_with_implicit->toString());
|
||||
}
|
||||
}
|
||||
|
||||
@ -340,6 +294,7 @@ std::shared_ptr<const ContextAccess> ContextAccess::getFullAccess()
|
||||
static const std::shared_ptr<const ContextAccess> res = []
|
||||
{
|
||||
auto full_access = std::shared_ptr<ContextAccess>(new ContextAccess);
|
||||
full_access->is_full_access = true;
|
||||
full_access->access = std::make_shared<AccessRights>(AccessRights::getFullAccess());
|
||||
full_access->enabled_quota = EnabledQuota::getUnlimitedQuota();
|
||||
return full_access;
|
||||
@ -362,323 +317,303 @@ std::shared_ptr<const SettingsConstraints> ContextAccess::getSettingsConstraints
|
||||
}
|
||||
|
||||
|
||||
std::shared_ptr<const AccessRights> ContextAccess::getAccess() const
|
||||
std::shared_ptr<const AccessRights> ContextAccess::getAccessRights() const
|
||||
{
|
||||
std::lock_guard lock{mutex};
|
||||
return access;
|
||||
}
|
||||
|
||||
|
||||
template <bool grant_option, typename... Args>
|
||||
bool ContextAccess::isGrantedImpl2(const AccessFlags & flags, const Args &... args) const
|
||||
std::shared_ptr<const AccessRights> ContextAccess::getAccessRightsWithImplicit() const
|
||||
{
|
||||
bool access_granted;
|
||||
if constexpr (grant_option)
|
||||
access_granted = getAccess()->hasGrantOption(flags, args...);
|
||||
else
|
||||
access_granted = getAccess()->isGranted(flags, args...);
|
||||
|
||||
if (trace_log)
|
||||
LOG_TRACE(trace_log, "Access {}: {}{}", (access_granted ? "granted" : "denied"), (AccessRightsElement{flags, args...}.toString()),
|
||||
(grant_option ? " WITH GRANT OPTION" : ""));
|
||||
|
||||
return access_granted;
|
||||
std::lock_guard lock{mutex};
|
||||
return access_with_implicit;
|
||||
}
|
||||
|
||||
template <bool grant_option>
|
||||
bool ContextAccess::isGrantedImpl(const AccessFlags & flags) const
|
||||
|
||||
template <bool throw_if_denied, bool grant_option>
|
||||
bool ContextAccess::checkAccessImpl(const AccessFlags & flags) const
|
||||
{
|
||||
return isGrantedImpl2<grant_option>(flags);
|
||||
return checkAccessImpl2<throw_if_denied, grant_option>(flags);
|
||||
}
|
||||
|
||||
template <bool grant_option, typename... Args>
|
||||
bool ContextAccess::isGrantedImpl(const AccessFlags & flags, const std::string_view & database, const Args &... args) const
|
||||
template <bool throw_if_denied, bool grant_option, typename... Args>
|
||||
bool ContextAccess::checkAccessImpl(const AccessFlags & flags, const std::string_view & database, const Args &... args) const
|
||||
{
|
||||
return isGrantedImpl2<grant_option>(flags, database.empty() ? params.current_database : database, args...);
|
||||
return checkAccessImpl2<throw_if_denied, grant_option>(flags, database.empty() ? params.current_database : database, args...);
|
||||
}
|
||||
|
||||
template <bool grant_option>
|
||||
bool ContextAccess::isGrantedImpl(const AccessRightsElement & element) const
|
||||
template <bool throw_if_denied, bool grant_option>
|
||||
bool ContextAccess::checkAccessImpl(const AccessRightsElement & element) const
|
||||
{
|
||||
if (element.any_database)
|
||||
return isGrantedImpl<grant_option>(element.access_flags);
|
||||
return checkAccessImpl<throw_if_denied, grant_option>(element.access_flags);
|
||||
else if (element.any_table)
|
||||
return isGrantedImpl<grant_option>(element.access_flags, element.database);
|
||||
return checkAccessImpl<throw_if_denied, grant_option>(element.access_flags, element.database);
|
||||
else if (element.any_column)
|
||||
return isGrantedImpl<grant_option>(element.access_flags, element.database, element.table);
|
||||
return checkAccessImpl<throw_if_denied, grant_option>(element.access_flags, element.database, element.table);
|
||||
else
|
||||
return isGrantedImpl<grant_option>(element.access_flags, element.database, element.table, element.columns);
|
||||
return checkAccessImpl<throw_if_denied, grant_option>(element.access_flags, element.database, element.table, element.columns);
|
||||
}
|
||||
|
||||
template <bool grant_option>
|
||||
bool ContextAccess::isGrantedImpl(const AccessRightsElements & elements) const
|
||||
template <bool throw_if_denied, bool grant_option>
|
||||
bool ContextAccess::checkAccessImpl(const AccessRightsElements & elements) const
|
||||
{
|
||||
for (const auto & element : elements)
|
||||
if (!isGrantedImpl<grant_option>(element))
|
||||
if (!checkAccessImpl<throw_if_denied, grant_option>(element))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ContextAccess::isGranted(const AccessFlags & flags) const { return isGrantedImpl<false>(flags); }
|
||||
bool ContextAccess::isGranted(const AccessFlags & flags, const std::string_view & database) const { return isGrantedImpl<false>(flags, database); }
|
||||
bool ContextAccess::isGranted(const AccessFlags & flags, const std::string_view & database, const std::string_view & table) const { return isGrantedImpl<false>(flags, database, table); }
|
||||
bool ContextAccess::isGranted(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const std::string_view & column) const { return isGrantedImpl<false>(flags, database, table, column); }
|
||||
bool ContextAccess::isGranted(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const std::vector<std::string_view> & columns) const { return isGrantedImpl<false>(flags, database, table, columns); }
|
||||
bool ContextAccess::isGranted(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const Strings & columns) const { return isGrantedImpl<false>(flags, database, table, columns); }
|
||||
bool ContextAccess::isGranted(const AccessRightsElement & element) const { return isGrantedImpl<false>(element); }
|
||||
bool ContextAccess::isGranted(const AccessRightsElements & elements) const { return isGrantedImpl<false>(elements); }
|
||||
|
||||
bool ContextAccess::hasGrantOption(const AccessFlags & flags) const { return isGrantedImpl<true>(flags); }
|
||||
bool ContextAccess::hasGrantOption(const AccessFlags & flags, const std::string_view & database) const { return isGrantedImpl<true>(flags, database); }
|
||||
bool ContextAccess::hasGrantOption(const AccessFlags & flags, const std::string_view & database, const std::string_view & table) const { return isGrantedImpl<true>(flags, database, table); }
|
||||
bool ContextAccess::hasGrantOption(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const std::string_view & column) const { return isGrantedImpl<true>(flags, database, table, column); }
|
||||
bool ContextAccess::hasGrantOption(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const std::vector<std::string_view> & columns) const { return isGrantedImpl<true>(flags, database, table, columns); }
|
||||
bool ContextAccess::hasGrantOption(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const Strings & columns) const { return isGrantedImpl<true>(flags, database, table, columns); }
|
||||
bool ContextAccess::hasGrantOption(const AccessRightsElement & element) const { return isGrantedImpl<true>(element); }
|
||||
bool ContextAccess::hasGrantOption(const AccessRightsElements & elements) const { return isGrantedImpl<true>(elements); }
|
||||
|
||||
|
||||
template <bool grant_option, typename... Args>
|
||||
void ContextAccess::checkAccessImpl2(const AccessFlags & flags, const Args &... args) const
|
||||
template <bool throw_if_denied, bool grant_option, typename... Args>
|
||||
bool ContextAccess::checkAccessImpl2(const AccessFlags & flags, const Args &... args) const
|
||||
{
|
||||
if constexpr (grant_option)
|
||||
auto access_granted = [&]
|
||||
{
|
||||
if (hasGrantOption(flags, args...))
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isGranted(flags, args...))
|
||||
return;
|
||||
}
|
||||
|
||||
auto show_error = [&](const String & msg, int error_code)
|
||||
{
|
||||
throw Exception(user_name + ": " + msg, error_code);
|
||||
if (trace_log)
|
||||
LOG_TRACE(trace_log, "Access granted: {}{}", (AccessRightsElement{flags, args...}.toString()),
|
||||
(grant_option ? " WITH GRANT OPTION" : ""));
|
||||
return true;
|
||||
};
|
||||
|
||||
std::lock_guard lock{mutex};
|
||||
|
||||
if (!user)
|
||||
show_error("User has been dropped", ErrorCodes::UNKNOWN_USER);
|
||||
|
||||
if (grant_option && access->isGranted(flags, args...))
|
||||
auto access_denied = [&](const String & error_msg, int error_code)
|
||||
{
|
||||
show_error(
|
||||
"Not enough privileges. "
|
||||
"The required privileges have been granted, but without grant option. "
|
||||
"To execute this query it's necessary to have the grant "
|
||||
+ AccessRightsElement{flags, args...}.toString() + " WITH GRANT OPTION",
|
||||
if (trace_log)
|
||||
LOG_TRACE(trace_log, "Access denied: {}{}", (AccessRightsElement{flags, args...}.toString()),
|
||||
(grant_option ? " WITH GRANT OPTION" : ""));
|
||||
if constexpr (throw_if_denied)
|
||||
throw Exception(getUserName() + ": " + error_msg, error_code);
|
||||
return false;
|
||||
};
|
||||
|
||||
if (!flags || is_full_access)
|
||||
return access_granted();
|
||||
|
||||
if (!getUser())
|
||||
return access_denied("User has been dropped", ErrorCodes::UNKNOWN_USER);
|
||||
|
||||
/// If the current user was allowed to create a temporary table
|
||||
/// then he is allowed to do with it whatever he wants.
|
||||
if ((sizeof...(args) >= 2) && (getDatabase(args...) == DatabaseCatalog::TEMPORARY_DATABASE))
|
||||
return access_granted();
|
||||
|
||||
auto acs = getAccessRightsWithImplicit();
|
||||
bool granted;
|
||||
if constexpr (grant_option)
|
||||
granted = acs->hasGrantOption(flags, args...);
|
||||
else
|
||||
granted = acs->isGranted(flags, args...);
|
||||
|
||||
if (!granted)
|
||||
{
|
||||
if (grant_option && acs->isGranted(flags, args...))
|
||||
{
|
||||
return access_denied(
|
||||
"Not enough privileges. "
|
||||
"The required privileges have been granted, but without grant option. "
|
||||
"To execute this query it's necessary to have grant "
|
||||
+ AccessRightsElement{flags, args...}.toString() + " WITH GRANT OPTION",
|
||||
ErrorCodes::ACCESS_DENIED);
|
||||
}
|
||||
|
||||
return access_denied(
|
||||
"Not enough privileges. To execute this query it's necessary to have grant "
|
||||
+ AccessRightsElement{flags, args...}.toString() + (grant_option ? " WITH GRANT OPTION" : ""),
|
||||
ErrorCodes::ACCESS_DENIED);
|
||||
}
|
||||
|
||||
struct PrecalculatedFlags
|
||||
{
|
||||
const AccessFlags table_ddl = AccessType::CREATE_DATABASE | AccessType::CREATE_TABLE | AccessType::CREATE_VIEW
|
||||
| AccessType::ALTER_TABLE | AccessType::ALTER_VIEW | AccessType::DROP_DATABASE | AccessType::DROP_TABLE | AccessType::DROP_VIEW
|
||||
| AccessType::TRUNCATE;
|
||||
|
||||
const AccessFlags dictionary_ddl = AccessType::CREATE_DICTIONARY | AccessType::DROP_DICTIONARY;
|
||||
const AccessFlags table_and_dictionary_ddl = table_ddl | dictionary_ddl;
|
||||
const AccessFlags write_table_access = AccessType::INSERT | AccessType::OPTIMIZE;
|
||||
const AccessFlags write_dcl_access = AccessType::ACCESS_MANAGEMENT - AccessType::SHOW_ACCESS;
|
||||
|
||||
const AccessFlags not_readonly_flags = write_table_access | table_and_dictionary_ddl | write_dcl_access | AccessType::SYSTEM | AccessType::KILL_QUERY;
|
||||
const AccessFlags not_readonly_1_flags = AccessType::CREATE_TEMPORARY_TABLE;
|
||||
|
||||
const AccessFlags ddl_flags = table_ddl | dictionary_ddl;
|
||||
const AccessFlags introspection_flags = AccessType::INTROSPECTION;
|
||||
};
|
||||
static const PrecalculatedFlags precalc;
|
||||
|
||||
if (params.readonly)
|
||||
{
|
||||
if (!access_without_readonly)
|
||||
{
|
||||
Params changed_params = params;
|
||||
changed_params.readonly = 0;
|
||||
access_without_readonly = std::make_shared<AccessRights>(calculateFinalAccessRights(*access_from_user_and_roles, changed_params));
|
||||
}
|
||||
|
||||
if (access_without_readonly->isGranted(flags, args...))
|
||||
if constexpr (grant_option)
|
||||
return access_denied("Cannot change grants in readonly mode.", ErrorCodes::READONLY);
|
||||
if ((flags & precalc.not_readonly_flags) ||
|
||||
((params.readonly == 1) && (flags & precalc.not_readonly_1_flags)))
|
||||
{
|
||||
if (params.interface == ClientInfo::Interface::HTTP && params.http_method == ClientInfo::HTTPMethod::GET)
|
||||
show_error(
|
||||
{
|
||||
return access_denied(
|
||||
"Cannot execute query in readonly mode. "
|
||||
"For queries over HTTP, method GET implies readonly. You should use method POST for modifying queries",
|
||||
ErrorCodes::READONLY);
|
||||
}
|
||||
else
|
||||
show_error("Cannot execute query in readonly mode", ErrorCodes::READONLY);
|
||||
return access_denied("Cannot execute query in readonly mode", ErrorCodes::READONLY);
|
||||
}
|
||||
}
|
||||
|
||||
if (!params.allow_ddl)
|
||||
if (!params.allow_ddl && !grant_option)
|
||||
{
|
||||
if (!access_with_allow_ddl)
|
||||
{
|
||||
Params changed_params = params;
|
||||
changed_params.allow_ddl = true;
|
||||
access_with_allow_ddl = std::make_shared<AccessRights>(calculateFinalAccessRights(*access_from_user_and_roles, changed_params));
|
||||
}
|
||||
|
||||
if (access_with_allow_ddl->isGranted(flags, args...))
|
||||
{
|
||||
show_error("Cannot execute query. DDL queries are prohibited for the user", ErrorCodes::QUERY_IS_PROHIBITED);
|
||||
}
|
||||
if (flags & precalc.ddl_flags)
|
||||
return access_denied("Cannot execute query. DDL queries are prohibited for the user", ErrorCodes::QUERY_IS_PROHIBITED);
|
||||
}
|
||||
|
||||
if (!params.allow_introspection)
|
||||
if (!params.allow_introspection && !grant_option)
|
||||
{
|
||||
if (!access_with_allow_introspection)
|
||||
{
|
||||
Params changed_params = params;
|
||||
changed_params.allow_introspection = true;
|
||||
access_with_allow_introspection = std::make_shared<AccessRights>(calculateFinalAccessRights(*access_from_user_and_roles, changed_params));
|
||||
}
|
||||
|
||||
if (access_with_allow_introspection->isGranted(flags, args...))
|
||||
{
|
||||
show_error("Introspection functions are disabled, because setting 'allow_introspection_functions' is set to 0", ErrorCodes::FUNCTION_NOT_ALLOWED);
|
||||
}
|
||||
if (flags & precalc.introspection_flags)
|
||||
return access_denied("Introspection functions are disabled, because setting 'allow_introspection_functions' is set to 0", ErrorCodes::FUNCTION_NOT_ALLOWED);
|
||||
}
|
||||
|
||||
show_error(
|
||||
"Not enough privileges. To execute this query it's necessary to have the grant "
|
||||
+ AccessRightsElement{flags, args...}.toString() + (grant_option ? " WITH GRANT OPTION" : ""),
|
||||
ErrorCodes::ACCESS_DENIED);
|
||||
return access_granted();
|
||||
}
|
||||
|
||||
template <bool grant_option>
|
||||
void ContextAccess::checkAccessImpl(const AccessFlags & flags) const
|
||||
|
||||
bool ContextAccess::isGranted(const AccessFlags & flags) const { return checkAccessImpl<false, false>(flags); }
|
||||
bool ContextAccess::isGranted(const AccessFlags & flags, const std::string_view & database) const { return checkAccessImpl<false, false>(flags, database); }
|
||||
bool ContextAccess::isGranted(const AccessFlags & flags, const std::string_view & database, const std::string_view & table) const { return checkAccessImpl<false, false>(flags, database, table); }
|
||||
bool ContextAccess::isGranted(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const std::string_view & column) const { return checkAccessImpl<false, false>(flags, database, table, column); }
|
||||
bool ContextAccess::isGranted(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const std::vector<std::string_view> & columns) const { return checkAccessImpl<false, false>(flags, database, table, columns); }
|
||||
bool ContextAccess::isGranted(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const Strings & columns) const { return checkAccessImpl<false, false>(flags, database, table, columns); }
|
||||
bool ContextAccess::isGranted(const AccessRightsElement & element) const { return checkAccessImpl<false, false>(element); }
|
||||
bool ContextAccess::isGranted(const AccessRightsElements & elements) const { return checkAccessImpl<false, false>(elements); }
|
||||
|
||||
bool ContextAccess::hasGrantOption(const AccessFlags & flags) const { return checkAccessImpl<false, true>(flags); }
|
||||
bool ContextAccess::hasGrantOption(const AccessFlags & flags, const std::string_view & database) const { return checkAccessImpl<false, true>(flags, database); }
|
||||
bool ContextAccess::hasGrantOption(const AccessFlags & flags, const std::string_view & database, const std::string_view & table) const { return checkAccessImpl<false, true>(flags, database, table); }
|
||||
bool ContextAccess::hasGrantOption(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const std::string_view & column) const { return checkAccessImpl<false, true>(flags, database, table, column); }
|
||||
bool ContextAccess::hasGrantOption(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const std::vector<std::string_view> & columns) const { return checkAccessImpl<false, true>(flags, database, table, columns); }
|
||||
bool ContextAccess::hasGrantOption(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const Strings & columns) const { return checkAccessImpl<false, true>(flags, database, table, columns); }
|
||||
bool ContextAccess::hasGrantOption(const AccessRightsElement & element) const { return checkAccessImpl<false, true>(element); }
|
||||
bool ContextAccess::hasGrantOption(const AccessRightsElements & elements) const { return checkAccessImpl<false, true>(elements); }
|
||||
|
||||
void ContextAccess::checkAccess(const AccessFlags & flags) const { checkAccessImpl<true, false>(flags); }
|
||||
void ContextAccess::checkAccess(const AccessFlags & flags, const std::string_view & database) const { checkAccessImpl<true, false>(flags, database); }
|
||||
void ContextAccess::checkAccess(const AccessFlags & flags, const std::string_view & database, const std::string_view & table) const { checkAccessImpl<true, false>(flags, database, table); }
|
||||
void ContextAccess::checkAccess(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const std::string_view & column) const { checkAccessImpl<true, false>(flags, database, table, column); }
|
||||
void ContextAccess::checkAccess(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const std::vector<std::string_view> & columns) const { checkAccessImpl<true, false>(flags, database, table, columns); }
|
||||
void ContextAccess::checkAccess(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const Strings & columns) const { checkAccessImpl<true, false>(flags, database, table, columns); }
|
||||
void ContextAccess::checkAccess(const AccessRightsElement & element) const { checkAccessImpl<true, false>(element); }
|
||||
void ContextAccess::checkAccess(const AccessRightsElements & elements) const { checkAccessImpl<true, false>(elements); }
|
||||
|
||||
void ContextAccess::checkGrantOption(const AccessFlags & flags) const { checkAccessImpl<true, true>(flags); }
|
||||
void ContextAccess::checkGrantOption(const AccessFlags & flags, const std::string_view & database) const { checkAccessImpl<true, true>(flags, database); }
|
||||
void ContextAccess::checkGrantOption(const AccessFlags & flags, const std::string_view & database, const std::string_view & table) const { checkAccessImpl<true, true>(flags, database, table); }
|
||||
void ContextAccess::checkGrantOption(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const std::string_view & column) const { checkAccessImpl<true, true>(flags, database, table, column); }
|
||||
void ContextAccess::checkGrantOption(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const std::vector<std::string_view> & columns) const { checkAccessImpl<true, true>(flags, database, table, columns); }
|
||||
void ContextAccess::checkGrantOption(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const Strings & columns) const { checkAccessImpl<true, true>(flags, database, table, columns); }
|
||||
void ContextAccess::checkGrantOption(const AccessRightsElement & element) const { checkAccessImpl<true, true>(element); }
|
||||
void ContextAccess::checkGrantOption(const AccessRightsElements & elements) const { checkAccessImpl<true, true>(elements); }
|
||||
|
||||
|
||||
template <bool throw_if_denied>
|
||||
bool ContextAccess::checkAdminOptionImpl(const UUID & role_id) const
|
||||
{
|
||||
checkAccessImpl2<grant_option>(flags);
|
||||
return checkAdminOptionImpl2<throw_if_denied>(to_array(role_id), [this](const UUID & id, size_t) { return manager->tryReadName(id); });
|
||||
}
|
||||
|
||||
template <bool grant_option, typename... Args>
|
||||
void ContextAccess::checkAccessImpl(const AccessFlags & flags, const std::string_view & database, const Args &... args) const
|
||||
template <bool throw_if_denied>
|
||||
bool ContextAccess::checkAdminOptionImpl(const UUID & role_id, const String & role_name) const
|
||||
{
|
||||
checkAccessImpl2<grant_option>(flags, database.empty() ? params.current_database : database, args...);
|
||||
return checkAdminOptionImpl2<throw_if_denied>(to_array(role_id), [&role_name](const UUID &, size_t) { return std::optional<String>{role_name}; });
|
||||
}
|
||||
|
||||
template <bool grant_option>
|
||||
void ContextAccess::checkAccessImpl(const AccessRightsElement & element) const
|
||||
template <bool throw_if_denied>
|
||||
bool ContextAccess::checkAdminOptionImpl(const UUID & role_id, const std::unordered_map<UUID, String> & names_of_roles) const
|
||||
{
|
||||
if (element.any_database)
|
||||
checkAccessImpl<grant_option>(element.access_flags);
|
||||
else if (element.any_table)
|
||||
checkAccessImpl<grant_option>(element.access_flags, element.database);
|
||||
else if (element.any_column)
|
||||
checkAccessImpl<grant_option>(element.access_flags, element.database, element.table);
|
||||
else
|
||||
checkAccessImpl<grant_option>(element.access_flags, element.database, element.table, element.columns);
|
||||
return checkAdminOptionImpl2<throw_if_denied>(to_array(role_id), [&names_of_roles](const UUID & id, size_t) { auto it = names_of_roles.find(id); return (it != names_of_roles.end()) ? it->second : std::optional<String>{}; });
|
||||
}
|
||||
|
||||
template <bool grant_option>
|
||||
void ContextAccess::checkAccessImpl(const AccessRightsElements & elements) const
|
||||
template <bool throw_if_denied>
|
||||
bool ContextAccess::checkAdminOptionImpl(const std::vector<UUID> & role_ids) const
|
||||
{
|
||||
for (const auto & element : elements)
|
||||
checkAccessImpl<grant_option>(element);
|
||||
return checkAdminOptionImpl2<throw_if_denied>(role_ids, [this](const UUID & id, size_t) { return manager->tryReadName(id); });
|
||||
}
|
||||
|
||||
void ContextAccess::checkAccess(const AccessFlags & flags) const { checkAccessImpl<false>(flags); }
|
||||
void ContextAccess::checkAccess(const AccessFlags & flags, const std::string_view & database) const { checkAccessImpl<false>(flags, database); }
|
||||
void ContextAccess::checkAccess(const AccessFlags & flags, const std::string_view & database, const std::string_view & table) const { checkAccessImpl<false>(flags, database, table); }
|
||||
void ContextAccess::checkAccess(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const std::string_view & column) const { checkAccessImpl<false>(flags, database, table, column); }
|
||||
void ContextAccess::checkAccess(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const std::vector<std::string_view> & columns) const { checkAccessImpl<false>(flags, database, table, columns); }
|
||||
void ContextAccess::checkAccess(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const Strings & columns) const { checkAccessImpl<false>(flags, database, table, columns); }
|
||||
void ContextAccess::checkAccess(const AccessRightsElement & element) const { checkAccessImpl<false>(element); }
|
||||
void ContextAccess::checkAccess(const AccessRightsElements & elements) const { checkAccessImpl<false>(elements); }
|
||||
|
||||
void ContextAccess::checkGrantOption(const AccessFlags & flags) const { checkAccessImpl<true>(flags); }
|
||||
void ContextAccess::checkGrantOption(const AccessFlags & flags, const std::string_view & database) const { checkAccessImpl<true>(flags, database); }
|
||||
void ContextAccess::checkGrantOption(const AccessFlags & flags, const std::string_view & database, const std::string_view & table) const { checkAccessImpl<true>(flags, database, table); }
|
||||
void ContextAccess::checkGrantOption(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const std::string_view & column) const { checkAccessImpl<true>(flags, database, table, column); }
|
||||
void ContextAccess::checkGrantOption(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const std::vector<std::string_view> & columns) const { checkAccessImpl<true>(flags, database, table, columns); }
|
||||
void ContextAccess::checkGrantOption(const AccessFlags & flags, const std::string_view & database, const std::string_view & table, const Strings & columns) const { checkAccessImpl<true>(flags, database, table, columns); }
|
||||
void ContextAccess::checkGrantOption(const AccessRightsElement & element) const { checkAccessImpl<true>(element); }
|
||||
void ContextAccess::checkGrantOption(const AccessRightsElements & elements) const { checkAccessImpl<true>(elements); }
|
||||
|
||||
|
||||
template <typename Container, typename GetNameFunction>
|
||||
bool ContextAccess::checkAdminOptionImpl(bool throw_on_error, const Container & role_ids, const GetNameFunction & get_name_function) const
|
||||
template <bool throw_if_denied>
|
||||
bool ContextAccess::checkAdminOptionImpl(const std::vector<UUID> & role_ids, const Strings & names_of_roles) const
|
||||
{
|
||||
return checkAdminOptionImpl2<throw_if_denied>(role_ids, [&names_of_roles](const UUID &, size_t i) { return std::optional<String>{names_of_roles[i]}; });
|
||||
}
|
||||
|
||||
template <bool throw_if_denied>
|
||||
bool ContextAccess::checkAdminOptionImpl(const std::vector<UUID> & role_ids, const std::unordered_map<UUID, String> & names_of_roles) const
|
||||
{
|
||||
return checkAdminOptionImpl2<throw_if_denied>(role_ids, [&names_of_roles](const UUID & id, size_t) { auto it = names_of_roles.find(id); return (it != names_of_roles.end()) ? it->second : std::optional<String>{}; });
|
||||
}
|
||||
|
||||
template <bool throw_if_denied, typename Container, typename GetNameFunction>
|
||||
bool ContextAccess::checkAdminOptionImpl2(const Container & role_ids, const GetNameFunction & get_name_function) const
|
||||
{
|
||||
if (!std::size(role_ids) || is_full_access)
|
||||
return true;
|
||||
|
||||
auto show_error = [this](const String & msg, int error_code)
|
||||
{
|
||||
UNUSED(this);
|
||||
if constexpr (throw_if_denied)
|
||||
throw Exception(getUserName() + ": " + msg, error_code);
|
||||
};
|
||||
|
||||
if (!getUser())
|
||||
{
|
||||
show_error("User has been dropped", ErrorCodes::UNKNOWN_USER);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isGranted(AccessType::ROLE_ADMIN))
|
||||
return true;
|
||||
|
||||
auto info = getRolesInfo();
|
||||
if (!info)
|
||||
{
|
||||
if (!user)
|
||||
{
|
||||
if (throw_on_error)
|
||||
throw Exception(user_name + ": User has been dropped", ErrorCodes::UNKNOWN_USER);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t i = 0;
|
||||
for (auto it = std::begin(role_ids); it != std::end(role_ids); ++it, ++i)
|
||||
{
|
||||
const UUID & role_id = *it;
|
||||
if (info->enabled_roles_with_admin_option.count(role_id))
|
||||
if (info && info->enabled_roles_with_admin_option.count(role_id))
|
||||
continue;
|
||||
|
||||
auto role_name = get_name_function(role_id, i);
|
||||
if (!role_name)
|
||||
role_name = "ID {" + toString(role_id) + "}";
|
||||
String msg = "To execute this query it's necessary to have the role " + backQuoteIfNeed(*role_name) + " granted with ADMIN option";
|
||||
if (info->enabled_roles.count(role_id))
|
||||
msg = "Role " + backQuote(*role_name) + " is granted, but without ADMIN option. " + msg;
|
||||
if (throw_on_error)
|
||||
throw Exception(getUserName() + ": Not enough privileges. " + msg, ErrorCodes::ACCESS_DENIED);
|
||||
else
|
||||
return false;
|
||||
if (throw_if_denied)
|
||||
{
|
||||
auto role_name = get_name_function(role_id, i);
|
||||
if (!role_name)
|
||||
role_name = "ID {" + toString(role_id) + "}";
|
||||
|
||||
if (info && info->enabled_roles.count(role_id))
|
||||
show_error("Not enough privileges. "
|
||||
"Role " + backQuote(*role_name) + " is granted, but without ADMIN option. "
|
||||
"To execute this query it's necessary to have the role " + backQuoteIfNeed(*role_name) + " granted with ADMIN option.",
|
||||
ErrorCodes::ACCESS_DENIED);
|
||||
else
|
||||
show_error("Not enough privileges. "
|
||||
"To execute this query it's necessary to have the role " + backQuoteIfNeed(*role_name) + " granted with ADMIN option.",
|
||||
ErrorCodes::ACCESS_DENIED);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ContextAccess::hasAdminOption(const UUID & role_id) const
|
||||
{
|
||||
return checkAdminOptionImpl(false, to_array(role_id), [this](const UUID & id, size_t) { return manager->tryReadName(id); });
|
||||
}
|
||||
bool ContextAccess::hasAdminOption(const UUID & role_id) const { return checkAdminOptionImpl<false>(role_id); }
|
||||
bool ContextAccess::hasAdminOption(const UUID & role_id, const String & role_name) const { return checkAdminOptionImpl<false>(role_id, role_name); }
|
||||
bool ContextAccess::hasAdminOption(const UUID & role_id, const std::unordered_map<UUID, String> & names_of_roles) const { return checkAdminOptionImpl<false>(role_id, names_of_roles); }
|
||||
bool ContextAccess::hasAdminOption(const std::vector<UUID> & role_ids) const { return checkAdminOptionImpl<false>(role_ids); }
|
||||
bool ContextAccess::hasAdminOption(const std::vector<UUID> & role_ids, const Strings & names_of_roles) const { return checkAdminOptionImpl<false>(role_ids, names_of_roles); }
|
||||
bool ContextAccess::hasAdminOption(const std::vector<UUID> & role_ids, const std::unordered_map<UUID, String> & names_of_roles) const { return checkAdminOptionImpl<false>(role_ids, names_of_roles); }
|
||||
|
||||
bool ContextAccess::hasAdminOption(const UUID & role_id, const String & role_name) const
|
||||
{
|
||||
return checkAdminOptionImpl(false, to_array(role_id), [&role_name](const UUID &, size_t) { return std::optional<String>{role_name}; });
|
||||
}
|
||||
|
||||
bool ContextAccess::hasAdminOption(const UUID & role_id, const std::unordered_map<UUID, String> & names_of_roles) const
|
||||
{
|
||||
return checkAdminOptionImpl(false, to_array(role_id), [&names_of_roles](const UUID & id, size_t) { auto it = names_of_roles.find(id); return (it != names_of_roles.end()) ? it->second : std::optional<String>{}; });
|
||||
}
|
||||
|
||||
bool ContextAccess::hasAdminOption(const std::vector<UUID> & role_ids) const
|
||||
{
|
||||
return checkAdminOptionImpl(false, role_ids, [this](const UUID & id, size_t) { return manager->tryReadName(id); });
|
||||
}
|
||||
|
||||
bool ContextAccess::hasAdminOption(const std::vector<UUID> & role_ids, const Strings & names_of_roles) const
|
||||
{
|
||||
return checkAdminOptionImpl(false, role_ids, [&names_of_roles](const UUID &, size_t i) { return std::optional<String>{names_of_roles[i]}; });
|
||||
}
|
||||
|
||||
bool ContextAccess::hasAdminOption(const std::vector<UUID> & role_ids, const std::unordered_map<UUID, String> & names_of_roles) const
|
||||
{
|
||||
return checkAdminOptionImpl(false, role_ids, [&names_of_roles](const UUID & id, size_t) { auto it = names_of_roles.find(id); return (it != names_of_roles.end()) ? it->second : std::optional<String>{}; });
|
||||
}
|
||||
|
||||
void ContextAccess::checkAdminOption(const UUID & role_id) const
|
||||
{
|
||||
checkAdminOptionImpl(true, to_array(role_id), [this](const UUID & id, size_t) { return manager->tryReadName(id); });
|
||||
}
|
||||
|
||||
void ContextAccess::checkAdminOption(const UUID & role_id, const String & role_name) const
|
||||
{
|
||||
checkAdminOptionImpl(true, to_array(role_id), [&role_name](const UUID &, size_t) { return std::optional<String>{role_name}; });
|
||||
}
|
||||
|
||||
void ContextAccess::checkAdminOption(const UUID & role_id, const std::unordered_map<UUID, String> & names_of_roles) const
|
||||
{
|
||||
checkAdminOptionImpl(true, to_array(role_id), [&names_of_roles](const UUID & id, size_t) { auto it = names_of_roles.find(id); return (it != names_of_roles.end()) ? it->second : std::optional<String>{}; });
|
||||
}
|
||||
|
||||
void ContextAccess::checkAdminOption(const std::vector<UUID> & role_ids) const
|
||||
{
|
||||
checkAdminOptionImpl(true, role_ids, [this](const UUID & id, size_t) { return manager->tryReadName(id); });
|
||||
}
|
||||
|
||||
void ContextAccess::checkAdminOption(const std::vector<UUID> & role_ids, const Strings & names_of_roles) const
|
||||
{
|
||||
checkAdminOptionImpl(true, role_ids, [&names_of_roles](const UUID &, size_t i) { return std::optional<String>{names_of_roles[i]}; });
|
||||
}
|
||||
|
||||
void ContextAccess::checkAdminOption(const std::vector<UUID> & role_ids, const std::unordered_map<UUID, String> & names_of_roles) const
|
||||
{
|
||||
checkAdminOptionImpl(true, role_ids, [&names_of_roles](const UUID & id, size_t) { auto it = names_of_roles.find(id); return (it != names_of_roles.end()) ? it->second : std::optional<String>{}; });
|
||||
}
|
||||
void ContextAccess::checkAdminOption(const UUID & role_id) const { checkAdminOptionImpl<true>(role_id); }
|
||||
void ContextAccess::checkAdminOption(const UUID & role_id, const String & role_name) const { checkAdminOptionImpl<true>(role_id, role_name); }
|
||||
void ContextAccess::checkAdminOption(const UUID & role_id, const std::unordered_map<UUID, String> & names_of_roles) const { checkAdminOptionImpl<true>(role_id, names_of_roles); }
|
||||
void ContextAccess::checkAdminOption(const std::vector<UUID> & role_ids) const { checkAdminOptionImpl<true>(role_ids); }
|
||||
void ContextAccess::checkAdminOption(const std::vector<UUID> & role_ids, const Strings & names_of_roles) const { checkAdminOptionImpl<true>(role_ids, names_of_roles); }
|
||||
void ContextAccess::checkAdminOption(const std::vector<UUID> & role_ids, const std::unordered_map<UUID, String> & names_of_roles) const { checkAdminOptionImpl<true>(role_ids, names_of_roles); }
|
||||
|
||||
}
|
||||
|
@ -96,7 +96,8 @@ public:
|
||||
std::shared_ptr<const SettingsConstraints> getSettingsConstraints() const;
|
||||
|
||||
/// Returns the current access rights.
|
||||
std::shared_ptr<const AccessRights> getAccess() const;
|
||||
std::shared_ptr<const AccessRights> getAccessRights() const;
|
||||
std::shared_ptr<const AccessRights> getAccessRightsWithImplicit() const;
|
||||
|
||||
/// Checks if a specified access is granted.
|
||||
bool isGranted(const AccessFlags & flags) const;
|
||||
@ -166,41 +167,45 @@ private:
|
||||
void setSettingsAndConstraints() const;
|
||||
void calculateAccessRights() const;
|
||||
|
||||
template <bool grant_option>
|
||||
bool isGrantedImpl(const AccessFlags & flags) const;
|
||||
template <bool throw_if_denied, bool grant_option>
|
||||
bool checkAccessImpl(const AccessFlags & flags) const;
|
||||
|
||||
template <bool grant_option, typename... Args>
|
||||
bool isGrantedImpl(const AccessFlags & flags, const std::string_view & database, const Args &... args) const;
|
||||
template <bool throw_if_denied, bool grant_option, typename... Args>
|
||||
bool checkAccessImpl(const AccessFlags & flags, const std::string_view & database, const Args &... args) const;
|
||||
|
||||
template <bool grant_option>
|
||||
bool isGrantedImpl(const AccessRightsElement & element) const;
|
||||
template <bool throw_if_denied, bool grant_option>
|
||||
bool checkAccessImpl(const AccessRightsElement & element) const;
|
||||
|
||||
template <bool grant_option>
|
||||
bool isGrantedImpl(const AccessRightsElements & elements) const;
|
||||
template <bool throw_if_denied, bool grant_option>
|
||||
bool checkAccessImpl(const AccessRightsElements & elements) const;
|
||||
|
||||
template <bool grant_option, typename... Args>
|
||||
bool isGrantedImpl2(const AccessFlags & flags, const Args &... args) const;
|
||||
template <bool throw_if_denied, bool grant_option, typename... Args>
|
||||
bool checkAccessImpl2(const AccessFlags & flags, const Args &... args) const;
|
||||
|
||||
template <bool grant_option>
|
||||
void checkAccessImpl(const AccessFlags & flags) const;
|
||||
template <bool throw_if_denied>
|
||||
bool checkAdminOptionImpl(const UUID & role_id) const;
|
||||
|
||||
template <bool grant_option, typename... Args>
|
||||
void checkAccessImpl(const AccessFlags & flags, const std::string_view & database, const Args &... args) const;
|
||||
template <bool throw_if_denied>
|
||||
bool checkAdminOptionImpl(const UUID & role_id, const String & role_name) const;
|
||||
|
||||
template <bool grant_option>
|
||||
void checkAccessImpl(const AccessRightsElement & element) const;
|
||||
template <bool throw_if_denied>
|
||||
bool checkAdminOptionImpl(const UUID & role_id, const std::unordered_map<UUID, String> & names_of_roles) const;
|
||||
|
||||
template <bool grant_option>
|
||||
void checkAccessImpl(const AccessRightsElements & elements) const;
|
||||
template <bool throw_if_denied>
|
||||
bool checkAdminOptionImpl(const std::vector<UUID> & role_ids) const;
|
||||
|
||||
template <bool grant_option, typename... Args>
|
||||
void checkAccessImpl2(const AccessFlags & flags, const Args &... args) const;
|
||||
template <bool throw_if_denied>
|
||||
bool checkAdminOptionImpl(const std::vector<UUID> & role_ids, const Strings & names_of_roles) const;
|
||||
|
||||
template <typename Container, typename GetNameFunction>
|
||||
bool checkAdminOptionImpl(bool throw_on_error, const Container & role_ids, const GetNameFunction & get_name_function) const;
|
||||
template <bool throw_if_denied>
|
||||
bool checkAdminOptionImpl(const std::vector<UUID> & role_ids, const std::unordered_map<UUID, String> & names_of_roles) const;
|
||||
|
||||
template <bool throw_if_denied, typename Container, typename GetNameFunction>
|
||||
bool checkAdminOptionImpl2(const Container & role_ids, const GetNameFunction & get_name_function) const;
|
||||
|
||||
const AccessControlManager * manager = nullptr;
|
||||
const Params params;
|
||||
bool is_full_access = false;
|
||||
mutable Poco::Logger * trace_log = nullptr;
|
||||
mutable UserPtr user;
|
||||
mutable String user_name;
|
||||
@ -209,13 +214,10 @@ private:
|
||||
mutable ext::scope_guard subscription_for_roles_changes;
|
||||
mutable std::shared_ptr<const EnabledRolesInfo> roles_info;
|
||||
mutable std::shared_ptr<const AccessRights> access;
|
||||
mutable std::shared_ptr<const AccessRights> access_with_implicit;
|
||||
mutable std::shared_ptr<const EnabledRowPolicies> enabled_row_policies;
|
||||
mutable std::shared_ptr<const EnabledQuota> enabled_quota;
|
||||
mutable std::shared_ptr<const EnabledSettings> enabled_settings;
|
||||
mutable std::shared_ptr<const AccessRights> access_without_readonly;
|
||||
mutable std::shared_ptr<const AccessRights> access_with_allow_ddl;
|
||||
mutable std::shared_ptr<const AccessRights> access_with_allow_introspection;
|
||||
mutable std::shared_ptr<const AccessRights> access_from_user_and_roles;
|
||||
mutable std::mutex mutex;
|
||||
};
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user