2018 Changelog

#### Experimental Features:[​](#experimental-features-2 "Direct link to Experimental Features:")

- Added the ability to calculate `and` arguments only where they are needed ([Anastasia Tsarkova](https://github.com/ClickHouse/ClickHouse/pull/2272))
- JIT compilation to native code is now available for some expressions ([pyos](https://github.com/ClickHouse/ClickHouse/pull/2277)).

#### Bug Fixes:[​](#bug-fixes-20 "Direct link to Bug Fixes:")

- Duplicates no longer appear for a query with `DISTINCT` and `ORDER BY`.
- Queries with `ARRAY JOIN` and `arrayFilter` no longer return an incorrect result.
- Fixed an error when reading an array column from a Nested structure ([#2066](https://github.com/ClickHouse/ClickHouse/issues/2066)).
- Fixed an error when analyzing queries with a HAVING clause like `HAVING tuple IN (...)`.
- Fixed an error when analyzing queries with recursive aliases.
- Fixed an error when reading from ReplacingMergeTree with a condition in PREWHERE that filters all rows ([#2525](https://github.com/ClickHouse/ClickHouse/issues/2525)).
- User profile settings were not applied when using sessions in the HTTP interface.
- Fixed how settings are applied from the command line parameters in clickhouse-local.
- The ZooKeeper client library now uses the session timeout received from the server.
- Fixed a bug in the ZooKeeper client library when the client waited for the server response longer than the timeout.
- Fixed pruning of parts for queries with conditions on partition key columns ([#2342](https://github.com/ClickHouse/ClickHouse/issues/2342)).
- Merges are now possible after `CLEAR COLUMN IN PARTITION` ([#2315](https://github.com/ClickHouse/ClickHouse/issues/2315)).
- Type mapping in the ODBC table function has been fixed ([sundy-li](https://github.com/ClickHouse/ClickHouse/pull/2268)).
- Type comparisons have been fixed for `DateTime` with and without the time zone ([Alexander Bocharov](https://github.com/ClickHouse/ClickHouse/pull/2400)).
- Fixed syntactic parsing and formatting of the `CAST` operator.
- Fixed insertion into a materialized view for the Distributed table engine ([Babacar Diassé](https://github.com/ClickHouse/ClickHouse/pull/2411)).
- Fixed a race condition when writing data from the `Kafka` engine to materialized views ([Yangkuan Liu](https://github.com/ClickHouse/ClickHouse/pull/2448)).
- Fixed SSRF in the remote() table function.
- Fixed exit behavior of `clickhouse-client` in multiline mode ([#2510](https://github.com/ClickHouse/ClickHouse/issues/2510)).

#### Improvements:[​](#improvements-11 "Direct link to Improvements:")

- Background tasks in replicated tables are now performed in a thread pool instead of in separate threads ([Silviu Caragea](https://github.com/ClickHouse/ClickHouse/pull/1722)).
- Improved LZ4 compression performance.
- Faster analysis for queries with a large number of JOINs and sub-queries.
- The DNS cache is now updated automatically when there are too many network errors.
- Table inserts no longer occur if the insert into one of the materialized views is not possible because it has too many parts.
- Corrected the discrepancy in the event counters `Query`, `SelectQuery`, and `InsertQuery`.
- Expressions like `tuple IN (SELECT tuple)` are allowed if the tuple types match.
- A server with replicated tables can start even if you haven't configured ZooKeeper.
- When calculating the number of available CPU cores, limits on cgroups are now taken into account ([Atri Sharma](https://github.com/ClickHouse/ClickHouse/pull/2325)).
- Added chown for config directories in the systemd config file ([Mikhail Shiryaev](https://github.com/ClickHouse/ClickHouse/pull/2421)).

#### Build Changes:[​](#build-changes-4 "Direct link to Build Changes:")

- The gcc8 compiler can be used for builds.
- Added the ability to build llvm from submodule.
- The version of the librdkafka library has been updated to v0.11.4.
- Added the ability to use the system libcpuid library. The library version has been updated to 0.4.0.
- Fixed the build using the vectorclass library ([Babacar Diassé](https://github.com/ClickHouse/ClickHouse/pull/2274)).
- Cmake now generates files for ninja by default (like when using `-G Ninja`).
- Added the ability to use the libtinfo library instead of libtermcap ([Georgy Kondratiev](https://github.com/ClickHouse/ClickHouse/pull/2519)).
- Fixed a header file conflict in Fedora Rawhide ([#2520](https://github.com/ClickHouse/ClickHouse/issues/2520)).

#### Backward Incompatible Changes:[​](#backward-incompatible-changes-7 "Direct link to Backward Incompatible Changes:")

- Removed escaping in `Vertical` and `Pretty*` formats and deleted the `VerticalRaw` format.
- If servers with version 1.1.54388 (or newer) and servers with an older version are used simultaneously in a distributed query and the query has the `cast(x, 'Type')` expression without the `AS` keyword and does not have the word `cast` in uppercase, an exception will be thrown with a message like `Not found column cast(0, 'UInt8') in block`. Solution: Update the server on the entire cluster.

### ClickHouse Release 1.1.54385, 2018-06-01[​](#clickhouse-release-1-1-54385-2018-06-01 "Direct link to ClickHouse Release 1.1.54385, 2018-06-01")

#### Bug Fixes:[​](#bug-fixes-21 "Direct link to Bug Fixes:")

- Fixed an error that in some cases caused ZooKeeper operations to block.

### ClickHouse Release 1.1.54383, 2018-05-22[​](#clickhouse-release-1-1-54383-2018-05-22 "Direct link to ClickHouse Release 1.1.54383, 2018-05-22")

#### Bug Fixes:[​](#bug-fixes-22 "Direct link to Bug Fixes:")

- Fixed a slowdown of replication queue if a table has many replicas.

### ClickHouse Release 1.1.54381, 2018-05-14[​](#clickhouse-release-1-1-54381-2018-05-14 "Direct link to ClickHouse Release 1.1.54381, 2018-05-14")

#### Bug Fixes:[​](#bug-fixes-23 "Direct link to Bug Fixes:")

- Fixed a nodes leak in ZooKeeper when ClickHouse loses connection to ZooKeeper server.

### ClickHouse Release 1.1.54380, 2018-04-21[​](#clickhouse-release-1-1-54380-2018-04-21 "Direct link to ClickHouse Release 1.1.54380, 2018-04-21")

#### New Features:[​](#new-features-13 "Direct link to New Features:")

- Added the table function `file(path, format, structure)`. An example reading bytes from `/dev/urandom`: ``` ln -s /dev/urandom /var/lib/clickhouse/user_files/random``clickhouse-client -q "SELECT * FROM file('random', 'RowBinary', 'd UInt8') LIMIT 10" ```.

#### Improvements:[​](#improvements-12 "Direct link to Improvements:")

- Subqueries can be wrapped in `()` brackets to enhance query readability. For example: `(SELECT 1) UNION ALL (SELECT 1)`.
- Simple `SELECT` queries from the `system.processes` table are not included in the `max_concurrent_queries` limit.

#### Bug Fixes:[​](#bug-fixes-24 "Direct link to Bug Fixes:")

- Fixed incorrect behavior of the `IN` operator when select from `MATERIALIZED VIEW`.
- Fixed incorrect filtering by partition index in expressions like `partition_key_column IN (...)`.
- Fixed inability to execute `OPTIMIZE` query on non-leader replica if `REANAME` was performed on the table.
- Fixed the authorization error when executing `OPTIMIZE` or `ALTER` queries on a non-leader replica.
- Fixed freezing of `KILL QUERY`.
- Fixed an error in ZooKeeper client library which led to loss of watches, freezing of distributed DDL queue, and slowdowns in the replication queue if a non-empty `chroot` prefix is used in the ZooKeeper configuration.

#### Backward Incompatible Changes:[​](#backward-incompatible-changes-8 "Direct link to Backward Incompatible Changes:")

- Removed support for expressions like `(a, b) IN (SELECT (a, b))` (you can use the equivalent expression `(a, b) IN (SELECT a, b)`). In previous releases, these expressions led to undetermined `WHERE` filtering or caused errors.

### ClickHouse Release 1.1.54378, 2018-04-16[​](#clickhouse-release-1-1-54378-2018-04-16 "Direct link to ClickHouse Release 1.1.54378, 2018-04-16")

#### New Features:[​](#new-features-14 "Direct link to New Features:")