FAQ

Q: Why does CHYT have cliques, while regular ClickHouse has nothing analogous? What is a clique?

A: There is a dedicated article about this.


Q: I am getting the "DB::NetException: Connection refused" or the "DB::Exception: Attempt to read after eof: while receiving packet" error. What does it mean?

A: This normally means that the CHYT process inside the Vanilla transaction crashed. You can view the aborted/failed job counters in the operation UI. If there are recent jobs aborted due to preemption, it means that the clique is short on resources. If there are recent failed jobs, please contact your system administrator.


Q: I am getting the "Subquery exceeds data weight limit: XXX > YYY" error. What does it mean?


Q: How do I save to a table?

A: There are INSERT INTO and CREATE TABLE functions. Learn more in the section on Differences from ClickHouse.


Q: How do I load geo-dicts in my own clique?

A: When starting any clique, you can specify the --cypress-geodata-path option that enables you to specify the path to geo-dicts in Cypress.


Q: Can CHYT handle dates in TzDatetime format?

A: CHYT can handle dates in TzDatetime format just as well as conventional ClickHouse. You will have to store data as strings or numbers and convert them for reading and writing. Example date extraction by @gri201:

toDate(reinterpretAsInt64(reverse(unhex(substring(hex(payment_dt), 1, 8)))))

Q: How do I move a table to an SSD?

A: First, make sure that your YTsaurus account has a quota for the ssd_blobs medium. To do this, go to the account page, switch your medium type to ssd_blobs, and enter your account name. If you have no quota for the ssd_blobs medium, you can request it via a special form.

After obtaining the quota for the ssd_blobs medium, you will need to change the value of the primary_medium attribute, and the data will be moved to the corresponding medium in the background. Learn more in the section on storage.

For static tables, you can force a move using the Merge operation:

yt set //home/dev/test_table/@primary_medium ssd_blobs
yt merge --mode auto --spec '{"force_transform"=true;}' --src //home/dev/test_table --dst //home/dev/test_table

If the table is dynamic, to change the medium, you must first unmount the table,
set the attribute, and then re-mount it:

yt unmount-table //home/dev/test_table --sync
yt set //home/dev/test_table/@primary_medium ssd_blobs
yt mount-table //home/dev/test_table --sync

You can speed up the move further with forced_compaction but using this method creates a heavy load in the cluster and is strongly discouraged.

To verify that the table has in fact changed its medium, use the command below:

$ yt get //home/dev/test_table/@chunk_media_statistics

{
    "ssd_blobs" = {
        "chunk_count" = 2126;
        "uncompressed_data_size" = 9667220402266;
        "compressed_data_size" = 4954465956017;
        "data_weight" = 10764306825793;
        "max_block_size" = 6584787;
    };
}

Q: Is the SAMPLE construct of the ClickHouse language supported?

A: CHYT supports the Sample construction. The difference is that CHYT ignores the OFFSET ... command, so you cannot get a sample from another part of the selected data.

Example:

SELECT count(*) FROM "//tmp/sample_table" SAMPLE 0.05;

SELECT count(*) FROM "//tmp/sample_table" SAMPLE 1/20;

SELECT count(*) FROM "//tmp/sample_table" SAMPLE 100500;

Q: How do I get the table name in a query?

A: You can use the $table_name and $table_path virtual columns. For more information about the virtual columns, see Working with YTsaurus tables.