Introduction
Every new release includes new features, enhancements, and numerous bug fixes, and the ChistaDATA team always stays on top of the latest releases. On June 01, 2023, ClickHouse version 23.06 was released, and this version contains the following;
- 10 new features,
- 12 performance optimizations,
- 31 bug fixes.
For further details, please see the official ClickHouse docs here.
- v23.06 Source Code : GitHub Link
- v23.06 Release Webinar: Recording
- v23.06 Release Webinar : Slides
- Installation: ClickHouse Docs
This article will look at the critical features of the ClickHouse 23.06 release.
All Data Types In the Function transform.
All data types were included in the function transform and CASE with value matching. The function transforms, and CASE with value matching begins to support all data types.
SELECT transform( what, [from1, from2, ...], [ab1, ab2, ...], default); SELECT CASE what WHEN from1 THEN ab1 WHEN from2 THEN ab2 ELSE default END;
SELECT … INTO OUTFILE ‘…’ TRUNCATE
Expand the INTO OUTFILE clause’s support for the TRUNCATE modifier. If the file already exists, suggest using APPEND or TRUNCATE for INTO OUTFILE.
:) SELECT * FROM numbers(10) INTO OUTFILE 'numbers.tsv' Ok. :) SELECT * FROM numbers(10) INTO OUTFILE 'numbers.tsv' Cannot open file numbers.tsv, errno: 17, strerror: File exists, consider using APPEND or TRUNCATE. -- this is fine :) SELECT * FROM numbers(10) INTO OUTFILE 'numbers.tsv' TRUNCATE Ok.
Rename Files After Processing
Added option --rename_files_after_processing <pattern>
clickhouse-local --rename_files_after_processing '%f.processed' --query " INSERT INTO table SELECT * FROM file('*.parquet')"
Connection String For clickhouse-client
The normal way:
clickhouse-client --host myhost.clickhouse.cloud --secure --password
Alternative way (since 23.6):
clickhouse-client 'clickhouse://user:password@myhost.clickhouse.cloud/database?secure'
Integration With MongoDB 5.1+
To support MongoDB 5.1 and newer, the MongoDB protocol is to be updated. Support for the older protocol versions (3.6) is still available.
CREATE TABLE test_mongo ... ENGINE = MongoDB( 'mongo1:27017', 'test', 'table', 'testuser', 'clickhouse'); SELECT * FROM test_mongo; SELECT * FROM mongodb( 'mongo1:27017', 'test', 'table', 'testuser', 'clickhouse', 'x String, y UInt64, ...');
Redis Tables
Add table engine Redis
and table function redis
. It allows querying external Redis servers.
CREATE TABLE test_redis (...) ENGINE = Redis('host:6379', 0, 'password') PRIMARY KEY k; SELECT * FROM test_redis; SELECT * FROM test_redis WHERE k = 'example'; SELECT * FROM test_redis WHERE k IN ('a', 'b'); SELECT * FROM redis( 'host:6379', k, 'k String, v String', 0, 'password');
This version has made valuable updates for SQL functions and monitoring. Future releases will allow us to use ClickHouse more efficiently.
These are the ClickHouse 23.06 features. To find out more details, please visit the official ClickHouse Docs.
Conclusion
The ClickHouse June 2023 Release (Version 23.06) brings forth a host of new features, optimizations, and bug fixes, further enhancing its capabilities for real-time analytics. From expanded support for data types to improved integration with MongoDB and Redis, this release empowers users with more efficient and versatile tools for data processing.
To know more about ClickHouse releases, do visit the following articles: