Project: ClickHouse (App Definition and Development / Database)
File: v21.7.1.7283-prestable.md

sidebar_position: 1 sidebar_label: 2022 Improved performance of queries with explicitly defined large sets. Added compatibility setting `legacycolumnnameoftuple_literal`. It makes sense to set it to `true`, while doing rolling update of cluster from version lower than 21.7 to any higher version. Otherwise distributed queries with explicitly defined sets at `IN` clause may fail during update. (). Forward/backward incompatible change of maximum buffer size in clickhouse-keeper. Better to do it now (before production), than later. (). Add support for VFS over HDFS. (). Provides a way to restore replicated table when the data is (possibly) present, but the ZooKeeper metadata is lost. Resolves . (). Implement `sequenceNextNode()` function useful for `flow analysis`. (). Added YAML configuration support to configuration loader. This closes . (). Added dateName function. (). Add `quantileBFloat16` aggregate function as well as the corresponding `quantilesBFloat16` and `medianBFloat16`. It is very simple and fast quantile estimator with relative error not more than 0.390625%. This closes . (). Support `ALTER DELETE` queries for `Join` table engine. (). Add a new boolean setting `preferglobalinandjoin` which defaults all IN/JOIN as GLOBAL IN/JOIN. (). add bitpositionToArray function. (). Add aggregate function `segmentLengthSum`. (). Support structs and maps in Arrow/Parquet/ORC and dictionaries in Arrow input/output formats. Present new setting `outputformatarrowlowcardinalityasdictionary`. (). Support `compile_expression` setting for AARCH64. (). Now clickhouse-keeper supports ZooKeeper-like `digest` ACLs. (). Implements the `h3ToGeo` function. (). Now querylog has two new columns : initialquerystarttime / initialquerystarttimemicrosecond that record the starting time of a distributed query if any. (). Dictionaries added support for Array type. (). Add `toJSONString` function to serialize columns to their JSON representations. (). ClickHouse database created with MaterializeMySQL now contains all column comments from the MySQL database that materialized. (). Added function `dateName`. Author (). Added function `bitPositionsToArray`. Closes . Author (). (remove from changelog) Integrate and test experimental compression libraries. Will be available under the flag `allowexperimentalcodecs`. This closes . (). Add exponential backoff to reschedule read attempt in case RabbitMQ queues are empty. Closes . (). Index of type bloom_filter can be used for expressions with `hasAny` function with constant arrays. This closes: . (). Fix Zero-Copy replication with several S3 volumes (Fixes ). (). Add ability to push down LIMIT for distributed queries. (). Respect `insertallowmaterialized_columns` (allows materialized columns) for INSERT into `Distributed` table. (). Here will be listed all the bugs that I am gonna to fix in this PR. (). Display progress for File table engine in clickhouse-local and on INSERT query in clickhouse-client when data is passed to stdin. Closes . (). Handle column name clashes for storage join, close . (). Add ability to split distributed batch on failures (i.e. due to memory limits, corruptions), under `distributeddirectorymonitorsplitbatchonfailure` (OFF by default). (). Add standalone `clickhouse-keeper` symlink to the main `clickhouse` binary. Now it's possible to run coordination without the main clickhouse server. (). Suppress exceptions from logger code. (). Use global settings for query to `VIEW`. Fixed the behavior when queries to `VIEW` use local settings, that leads to errors if setting on `CREATE VIEW` and `SELECT` were different. As for now, `VIEW` won't use these modified settings, but you can still pass additional settings in `SETTINGS` section of `CREATE VIEW` query. Close . (). Add settings (`connectionautoclose`/`connectionmaxtries`/`connectionpoolsize`) for MySQL storage engine.

Fix trailing whitespaces in FROM clause with subqueries in multiline mode, and also changes the output of the queries slightly in a more human friendly way. (). Recognize IPv4 addresses like `127.0.1.1` as local. This is controversial and closes . Michael Filimonov will test this feature. (). Fix IPv6 addresses resolving (i.e. fixes `select from remote(' (). Now querylog has two new columns : `initialquerystarttime / initialquerystarttimemicrosecond` that record the starting time of a distributed query if any. (). Rewrite more columns to possible alias expressions. This may enable better optimization, such as projections. (). Added optimization, that transforms some functions to reading of subcolumns to reduce amount of read data. E.g., statement `col IS NULL` is transformed to reading of subcolumn `col.null`. Optimization can be enabled by setting `optimizefunctionsto_subcolumns`. (). Fix a data race on Keeper shutdown. (). Support postgres schema for insert queries. Closes . (). If SSDDictionary is created with DDL query, it can be created only inside user_files directory. (). Make String-to-Int parser stricter so that `toInt64('+')` will throw. (). Add merge tree setting `maxpartstomergeat_once` which limits the number of parts that can be merged in the background at once. Doesn't affect `OPTIMIZE FINAL` query. Fixes . (). Avoid hiding errors like `Limit for rows or bytes to read exceeded` for scalar subqueries. (). Add two ReplicatedMergeTree settings: `maxreplicatedfetchesnetworkbandwidth` and `maxreplicatedsendsnetworkbandwidth` which allows to limit maximum speed of replicated fetches/sends for table. Add two server-wide settings (in `default` user profile): `maxreplicatedfetchesnetworkbandwidthforserver` and `maxreplicatedsendsnetworkbandwidthforserver` which limit maximum speed of replication for all tables. The settings are not followed perfectly accurately. Turned off by default. Fixes . (). Respect `maxdistributedconnections` for `insertdistributedsync` (otherwise for huge clusters and sync insert it may run out of `maxthreadpool_size`). (). Fixed a bug in `Replicated` database engine that might rarely cause some replica to skip enqueued DDL query. (). Some queries require multi-pass semantic analysis. Try reusing built sets for `IN` in this case. (). Allow `not in` operator to be used in partition pruning. (). Improved logging of S3 errors, no more double spaces in case of empty keys and buckets. (). For distributed query, when `optimizeskipunused_shards=1`, allow to skip shard with condition like `(sharding key) IN (one-element-tuple)`. (Tuples with many elements were supported. Tuple with single element did not work because it is parsed as literal). (). Detect linux version at runtime (for worked nested epoll, that is required for `asyncsocketforremote`/`usehedged_requests`, otherwise remote queries may stuck). (). Increase size of background schedule pool to 128 (`backgroundschedulepool_size` setting). It allows avoiding replication queue hung on slow zookeeper connection. (). Fix topLevelDomain() for IDN hosts (i.e. `example.`), before it returns empty string for such hosts. (). On server start, parts with incorrect partition ID would not be ever removed, but always detached. . (). Correct memory tracking in aggregate function `topK`. This closes . (). Use separate `clickhouse-bridge` group and user for bridge processes. Set oomscoreadj so the bridges will be first subjects for OOM killer. Set set maximum RSS to 1 GiB. Closes . (). Update prompt in `clickhouse-client` and display a message when reconnecting. This closes . (). Add support for function `if` with Decimal and Int types on its branches. This closes . This closes . (). Add settings `httpmaxfields`, `httpmaxfieldnamesize`, `httpmaxfieldvaluesize`. (). Add == operator on time conditions for sequenceMatch and sequenceCount functions. For eg: sequenceMatch('(?1)(?t==1)(?2)')(time, data = 1, data = 2). (). Support Interval for LowCardinality, close . (). Flatbuffers library updated to v.2.0.0. Improvements list https://github.com/google/flatbuffers/releases/tag/v2.0.0.

Drop replicas from dirname for internal_replication=true (allows INSERT into Distributed with cluster from any number of replicas, before only 15 replicas was supported, everything more will fail with ENAMETOOLONG while creating directory for async blocks). (). Resolve the actual port number bound when a user requests any available port from the operating system. (). Improve startup time of Distributed engine. (). Fix the bug in failover behavior when Engine=Kafka was not able to start consumption if the same consumer had an empty assignment previously. Closes . (). Fix waiting of automatic dropping of empty parts. It could lead to full filling of background pool and stuck of replication. (). Column cardinality in join output same as at the input, close , close . (). Use old modulo function version when used in partition key. Closes . (). Set `max_threads = 1` to fix mutation fail of StorageMemory. Closes . (). Allow empty HTTP headers. Fixes . (). Fixed a bug in moving Materialized View from Ordinary to Atomic database (`RENAME TABLE` query). Now inner table is moved to new database together with Materialized View. Fixes . (). Fix drop partition with intersect fake parts. In rare cases there might be parts with mutation version greater than current block number. (). In "multipart/form-data" message consider the CRLF preceding a boundary as part of it. Fixes . (). - Fixed the deadlock that can happen during LDAP role (re)mapping, when LDAP group is mapped to a nonexistent local role. (). Fix incorrect monotonicity of toWeek function. This fixes . This bug was introduced in https://github.com/ClickHouse/ClickHouse/pull/5212 , and was exposed later by smarter partition pruner. (). In current CH version total_writes.bytes counter decreases too much during the buffer flush. It leads to counter overflow and totalBytes return something around 17.44 EB some time after the flush. This pr should fix it. ... (). Fixed the behavior when query `SYSTEM RESTART REPLICA` or `SYSTEM SYNC REPLICA` is being processed infinitely. This was detected on server with extremely little amount of RAM. (). Fix usage of tuples in `CREATE .. AS SELECT` queries. (). Enable reading of subcolumns for distributed tables. (). Disallow building uniqXXXXStates of other aggregation states. (). Fixed bug in deserialization of random generator state with might cause some data types such as `AggregateFunction(groupArraySample(N), T))` to behave in a non-deterministic way. (). Fix bug which can lead to ZooKeeper client hung inside clickhouse-server. (). - If ZooKeeper connection was lost and replica was cloned after restoring the connection, its replication queue might contain outdated entries. It's fixed. - Fixed crash when replication queue contains intersecting virtual parts. It may rarely happen if some data part was lost. Print error in log instead of terminating. (). Fix bug when exception `Mutation was killed` can be thrown to the client on mutation wait when mutation not loaded into memory yet. (). Allow NULL values in postgresql protocol. Closes . (). Fix "Missing columns" exception when joining Distributed Materialized View. (). Fix extremely rare bug on low-memory servers which can lead to the inability to perform merges without restart. Possibly fixes . (). Fixed possible error 'Cannot read from istream at offset 0' when reading a file from DiskS3. (). Fixed bug with declaring S3 disk at root of bucket. Earlier, it reported an error: ``` (). Fix possible heap-buffer-overflow in Arrow.

Fix limit/offset settings for distributed queries (ignore on the remote nodes). (). Fix extremely rare error `Tagging already tagged part` in replication queue during concurrent `alter move/replace partition`. Possibly fixes . (). Fix serialization of splitted nested messages in Protobuf format. This PR fixes . (). Fix potential crash when calculating aggregate function states by aggregation of aggregate function states of other aggregate functions (not a practical use case). See . (). Distinguish KILL MUTATION for different tables (fixes unexpected `Cancelled mutating parts` error). (). Fix wrong result when using aggregate projection with not empty `GROUP BY` key to execute query with `GROUP BY` by empty* key. (). Fix bug which allows creating tables with columns referencing themselves like `a UInt32 ALIAS a + 1` or `b UInt32 MATERIALIZED b`. Fixes , . (). Fix bug with constant maps in mapContains that lead to error `empty column was returned by function mapContains`. Closes . (). Fix crash in query with cross join and `joinedsubqueryrequires_alias = 0`. Fixes . (). Fix possible parts loss after updating up to 21.5 in case table used `UUID` in partition key. (It is not recommended to use `UUID` in partition key). Fixes . (). Do not use table's projection for `SELECT` with `FINAL`. It is not supported yet. (). Fixed an error which occurred while inserting a subset of columns using CSVWithNames format. Fixes . (). Fix TOCTOU error in installation script. (). Fix incorrect behaviour and UBSan report in big integers. In previous versions `CAST(1e19 AS UInt128)` returned zero. (). Fix joinGetOrNull with not-nullable columns. This fixes . (). Fix error `Bad cast from type DB::ColumnLowCardinality to DB::ColumnVector<char8_t>` for queries where `LowCardinality` argument was used for IN (this bug appeared in 21.6). Fixes . (). Fix Logical Error Cannot sum Array/Tuple in min/maxMap. (). Support `SimpleAggregateFunction(LowCardinality)` for `SummingMergeTree`. Fixes . (). On ZooKeeper connection loss `ReplicatedMergeTree` table might wait for background operations to complete before trying to reconnect. It's fixed, now background operations are stopped forcefully. (). Fix the possibility of non-deterministic behaviour of the `quantileDeterministic` function and similar. This closes . (). Fix lost `WHERE` condition in expression-push-down optimization of query plan (setting `queryplanfilterpushdown = 1` by default). Fixes . (). Fix `REPLACE` column transformer when used in DDL by correctly quoting the formated query. This fixes . (). Fix segfault when sharding_key is absent in task config for copier. (). Fix excessive underscore before the names of the preprocessed configuration files. (). Fix convertion of datetime with timezone for MySQL, PostgreSQL, ODBC. Closes . (). Fix segfault in `Arrow` format when using `Decimal256`. Add arrow `Decimal256` support. (). Fixed case, when sometimes conversion of postgres arrays resulted in String data type, not n-dimensional array, because `attndims` works incorrectly in some cases. Closes . (). Fix wrong totals for query `WITH TOTALS` and `WITH FILL`. Fixes . (). Fix error `Key expression contains comparison between inconvertible types` for queries with `ARRAY JOIN` in case if array is used in primary key. Fixes . (). Fix bug which can lead to intersecting parts after merges with TTL: `Part all40400 is covered by all40401 but should be merged into all4041_1. This shouldn't happen often.`. (). Fix restore S3 table. (). Fix null pointer dereference in `EXPLAIN AST` without query. (). `REPLACE PARTITION` might be ignored in rare cases if the source partition was empty. It's fixed. Fixes .

Fixed `No such file or directory` error on moving `Distributed` table between databases. Fixes . (). Fix mysql select user() return empty. Fixes . (). Fix data race when querying `system.clusters` while reloading the cluster configuration at the same time. (). Ubuntu 20.04 is now used to run integration tests, docker-compose version used to run integration tests is updated to 1.28.2. Environment variables now take effect on docker-compose. Rework testdictionariesalllayoutsseparate_sources to allow parallel run. (). Testing for big ints using the following functions: Arithmetic Array, tuple, and map Bit Comparison Conversion Logical Mathematical Null Rounding - Creating a table with columns that use the data types. (). Add libfuzzer tests for YAMLParser class. (). Adding support to save clickhouse server logs in TestFlows check. (). Integration tests configuration has special treatment for dictionaries. Removed remaining dictionaries manual setup. (). Add integration test cases to cover JDBC bridge. (). Disabling extended precision data types TestFlows tests. (). Fix using Yandex dockerhub registries for TestFlows. (). Adding `leadInFrame` and `lagInFrame` window functions TestFlows tests. (). Enable build with s3 module in osx . (). - Added rounding to mathematical and arithmetic function tests for consistent snapshot comparison. - Cleaned up test names so they're more uniform. (). Increase LDAP verification cooldown performance tests timeout to 600 sec. (). Enabling TestFlows RBAC tests. (). Add CI check for darwin-aarch64 cross-compilation. (). Changed CSS theme to dark for better code highlighting. (). Introduce ASTTableIdentifier into the code. (). Use std::filesystem instad of Poco::File. (). Fix init script so it does not print 'usage' message for each 'status' command run. (). Fix cron.d task so it does not spam with email messages about current service status. (). NO CL ENTRY: 'Revert "Pass Settings to aggregate function creator"'. (). NO CL ENTRY: 'Revert "Add initialquerystart_time to query log"'. (). NO CL ENTRY: 'Revert "Add run-id option to integration tests"'. (). NO CL ENTRY: 'Revert "Implement h3ToGeo function"'. (). Part movement between shards (). Pass Settings to aggregate function creator (). Add uniqTheta in performance test (). More pytest fixes (). Improved `teststorages3getunstable` (). CompileExpressions comparison function constant case fix (). Added llvm-project submodule (). complain about unstable perf test queries (). Changelog 21.5 (). Implement antlr parser for projections (). Try to fix GROUP BY shardnum in a different way (). Use memmove in PODArray::insert to handle memory overlapping. (). ExpressionActions compile only necessary places (). consolidate connection loss handling in fuzzer (). Skip data finalization when doing projection materialization. (). One more error to retry in clickhouse-test (). Merging (). Remove AutoArray (). Compile expressions added partition by test (). PODArray insert in the middle tests (). remove retries from fast test (). Better parallelism for functional tests (). AARCH64 hash tables benchmark (). Fix diagnostics in documentation script (). Fix flaky 01033quotadcl (). Fix logical error AggregateFunctionFactory returned nullptr (). Add log record for removed from AWS S3 keys (). Added AggregateFunctionSegmentLengthSum to ya.make (). Stateless tests fixes (). Function constant result with nonconstant arguments (). Libunwind update version (). Do not built clickhouse-keeper w/o NuRaft (). Switch message level to WARNING for FAILONUNSUPPORTEDOPTIONSCOMBINATION=OFF (). Merging "experimental compression codecs" (). Fix formatting of negative values (). Fix dictionary functions documentation (). Mark false positives for PVS-Studio (). ActionsDAG compile expressions update (). LLVM remove orc jit library (). Add YAMLParser to ya.make

Fix cli argument in clickhouse-server.init (). Fix fast test (). Fix flaky test 01085maxdistributed_connections (). Manually disable LLVM parts submodule update (). Account totalrowsapprox as soon as possible (). Fix header mismatch for UNION. (). Try to improve kafka flaky test (). CompileExpression cached functions with context fix (). Fixed IFunction then typos (). Fix several cases in cast operator (). MemoryTracker new no throw (). Revent libunwind (). Log file name on error in FileChecker ctor (). Remove containers in intergational runner entrypoint (). Fix benign race (detected by clang-12) in Keeper snapshots (). (). shellcheck fix (). Do not peerdir enabled-by-default libcxxabi-parts (). Merging (). Fix Arcadia (). Make `get/check/read/list` requests always read in Keeper (). calculate perf test precision thresholds from historical data (). Update jit_example (). Update testmultipledisks (). Fix flaky test (). Fix arcadia (). Fix avro (). Refactor MergeTreeDataSelectExecutor (). allow inheriting from a named window in window definition (). do not auto-apply -OrNull combinator to pure window functions (). fix ORDER BY after window fuctions over Distributed (). ast fuzzer: determine server death more robustly (). Enable tests, utils and examples in builds with clang-tidy (). more fuzzer fixes (). Fix flaky integration tests (). Fix alter table drop projection if exists (). Block memory tracker earlier in `tryLogCurrentException` (). Minor fixes in AggregateFunctionSegmentLengthSumData (). remove mutable references to Context from IFunction interface (). MemoryTracker enable throw logical error (). support expressions in window frame (). Updated libunwind (). ExecuteScalarSubqueriesVisitor fix error code style check (). Process config w/o extensions as XML format (). Update NuRaft (). Fix empty part set with forceuseprojection = 1 (). Better exception for invalid projection creation (). Improve "Cannot schedule a task" error message (). Fix 00953zookeepersuetindeduplicationbug (). Don't capture temporary references in ZooKeeper client callbacks. (). Small improvement for StorageMaterializedView::getActionLock(...) (). Make ContextPtr const by default. (). Fix typo. Remove the "allowexperimentalbigint_types" setting. (). ExpressionJIT remove unncecessary logging (). ExpressionJIT simplify loop (). Fixed clang tidy (). Merging (). Simplify code around TraceCollector, alternative to (). Some improvements in stress test (). Rename ContextConstPtr to ContextPtr. (). Reverted libunwind from upstream (). Testflows Extended Precision Data Type testing - Adding snapshots for output comparison. (). clickhouse-client: echo hint improvements (). docs: update requests (to fix conflicts with urllib3) (). Trying to resurrect woboq (). Get rid of std::stringstream in Suggest (). Suppress RocksDB error (). Remove some outdated integration tests (). Mute testmemoryconsumption before (). Update something in KeyCondition (). Relax hung check (). some perf test script improvements (). RFC: clickhouse-test: do not substitude db name in stderr by default (). Add test issue (). Followup fixes for integration tests (). Fix bad error message in docker entrypoint (). Fix endless wait in replica clone (). Remove subprocess_call from cluster.py (). Delete support for waiting on queue- entries, is this dead code? (). Fix the test after (). Try fix `testconsistentpartsafterclone_replica` (). Fix typo in usage section in s3 documentation (). Cleanup iptables and containers on session start (). Part movement between shards ACL (). Cleanup changelog script (). Add changelog for 21.6 (). clickhouse-test: fix log_comment for .sql tests (). DictionaryLoader unnecessary dictionary configuration creation fix (). Compression codecs refactoring (). Maybe Minio starts for too long in tests (). Fix bad test (). Disks fix ya.make

tests: disable suggestions for expect tests that does not requires it (). fix jemalloc build on OS_DARWIN (). Update waitForTableReplicaToProcessLogEntry comments (). Remove database before model name in docs (). odbc fix (). test for attach partition from (). AggregateFunctionAnyHeavyData use fixed size type (). Update Dockerfile (). Trying to debug fetches bandwith test failures (). Remove strange timeout in test (). Remove copypaste from StorageReplicatedMergeTree (). Less timeouts in integration tests (). Better odbc integration test (). Fix flaky check report in CI runner (). Better hdfs tests (). Use zstd/include in ya.make (). Adds a better way to include binary resources (). check for row_policy defined using user() function (). Update Roaring Bitmaps just in case (). Move code to more appropriate place (). Dictionary sources add update lag option (). RewriteFunctionToSubcolumnVisitor add into ya.make (). Enable back the ANTLR in .sql (). Added ExecutablePool documentation (). Do not optimize query plan for mutations. (). Dictionary added update field documentation (). Dictionaries attribute support default nullable type (). Fix tests (). Try run tests with Replicated database in parallel (). More integration tests improvements (). Add function toJSONString to ya.make (). Minor change (). Add missed #include <condition_variable> (). Add test for (). Add test for (). Add a test for (). Copy-paste some code (). Minor change (). Add a test for (). Add missed #include <optional> (). test for `PARTITION BY 0 id` (). Enable TestFlows LDAP tests (). Add a test for (). Add a test for (). Remove some code from KeyCondition. (). CMake dictionaries disable debug info fix (). Merge ext into common (). test for null array orc load (). Improve Replicated database tests (). SimpleCache key constructor improvement (). Catch ErrnoException during parts cleaning (). Fix flaky test 01520clientprintqueryid and others. (). Fix UBSan report in quantileTiming (). Update testttlreplicated (). Fix `00601killrunning_query` (). Use signal 15 in restartwithlatest_version (). Setting mincounttocompileexpression fix (). Function formatDateTime fix code comments (). Improve Replicated database tests 2 (). Add a test for (). Rename & reimport murmurhash sources from smhasher repo (). Add test from issue (). Turn off WITH_COVERAGE in build with clang-tidy (). Fix container-overflow in replxx during incremental search (Ctrl-R) (). DatabaseMySQL rename (). Support REPLACE DICTIONARY, CREATE OR REPLACE DICTIONARY queries (). Add a test for (). Remove assumeMutable from removeColumnNullability (). DataTypeLowCardinality support DataTypeInterval tests (). Add run-id option to integration tests (). Stable NOT chain formatting (). Fix alternative stack for SIGSEGV handling (). Catch "Maximum parse depth" error in fuzzer (). Fix NOT parsing (). Catch TOODEEPRECURSION in fuzzer for formatted query too (). Fix some bugs in integration tests (). Fix query progress (). Add test for progress bar (). Fix some tests (). Fix flaky test 01249flushinteractive.sh (). METR-41529 (). clickhouse-client: fix NULL dereference for --param w/o value (). Remove only symlinks during forcerestoredata of Atomic engine (). clickhouse-test: use basename (instead of full path) for log_comment (). Fix typo in hardware failure error message (). Small change in Roaring Bitmaps (). Fix ANTLR parser and enable it back in CI (). Fix alternative stack (MINSIGSTKSZ) and stack size check under osx (). Enable MurmurHash in ArcadiaBuild (). Add working test (). Compile expressions updated documentation (). Fix some more missed includes (). Fix native macOS (Xcode) builds (). Fix arcadia (). Change error code in LIVE VIEW (). Add join related options to stress tests. ().