ClickHouse / ClickHouse/ClickHouse

Unexpected encoding: zstd while inserting data from tables in ClickHouse

Open
#94,432 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
49.9k
Forks
9k
Avg merge
21h 32m
Merged PRs (30d)
515

Description

### Company or project name

### Describe what's wrong

Getting strange compression error while trying to insert data from one mergetree table to another

### Does it reproduce on the most recent release?

Yes

### How to reproduce

Using ClickHouse Cloud
cloud provider is gcp region is us-east-1

```sql
CREATE DATABASE IF NOT EXISTS bronze;
CREATE DATABASE IF NOT EXISTS silver;

CREATE OR REPLACE TABLE bronze.stg_users
(
user_id Int64,
reputation UInt32,
created_at DateTime,
display_name String,
last_access_at DateTime,
website_url String,
location String,
about_me String,
profile_views UInt32,
up_votes UInt32,
down_votes UInt32,
account_id Int64,
load_timestamp DateTime DEFAULT now()
)
ENGINE = ReplacingMergeTree
ORDER BY (user_id, load_timestamp)
PARTITION BY toYYYYMM(load_timestamp);

INSERT INTO bronze.stg_users
SELECT
id AS user_id,
reputation,
creation_date AS created_at,
display_name,
last_access_date AS last_access_at,
website_url,
location,
about_me,
views AS profile_views,
up_votes,
down_votes,
account_id,
now() AS load_timestamp
FROM s3('https://learn-clickhouse.s3.us-east-2.amazonaws.com/stack-exchange/users.parquet', 'Parquet');

INSERT INTO silver.int_users
SELECT
user_id,
reputation,
created_at,
display_name,
last_access_at,
website_url,
location,
about_me,
profile_views,
up_votes,
down_votes,
account_id,
dateDiff('day', last_access_at, now()) AS days_since_last_access,
now() AS processing_timestamp
FROM bronze.stg_users
WHERE user_id > 0; -- Filter out invalid users (Community user is -1);
```

### Expected behavior

data is inserted into the table successfully

### Error message and/or stacktrace

Here is the error message: Unexpected encoding: zstd

I don't see why I would be getting this error in this context. I can select from stg_users without issue. the table is populated.

### Additional context

Sometimes I wait a few hours and re-run the same code and the zstd error goes away

At-ing Rich @rfraposa

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.