Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: panic viewing clustering_information with a <8 character cluster key #16763

Closed
1 of 2 tasks
nickb937 opened this issue Nov 4, 2024 · 1 comment · Fixed by #16792
Closed
1 of 2 tasks

bug: panic viewing clustering_information with a <8 character cluster key #16763

nickb937 opened this issue Nov 4, 2024 · 1 comment · Fixed by #16792
Assignees
Labels
C-bug Category: something isn't working

Comments

@nickb937
Copy link

nickb937 commented Nov 4, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

Version

Databend: v1.2.615

What's Wrong?

Panic when viewing the clustering_information after setting the cluster key to a size less than 8 characters

panicked at src/query/expression/src/values.rs:1837:34:
internal error: entered unreachable code: unable to push NULL to String(StringColumnBuilder { need_estimated: true, data: [], offsets: [0, 0] })

e6435026-eb5a-4fe4-a42a-c645c861584c 2024-11-04T18:38:19.370271Z ERROR databend_common_tracing::panic_hook: panic_hook.rs:55 panicked at src/query/expression/src/values.rs:1837:34:
internal error: entered unreachable code: unable to push NULL to String(StringColumnBuilder { need_estimated: true, data: [], offsets: [0, 0] }) backtrace= panic.file=src/query/expression/src/values.rs panic.line=1837 panic.column=34
e6435026-eb5a-4fe4-a42a-c645c861584c 2024-11-04T18:38:19.440486Z ERROR databend_query::servers::mysql::writers::query_result_writer: query_result_writer.rs:223 result row write failed: PanicError. Code: 1104, Text = internal error: entered unreachable code: unable to push NULL to String(StringColumnBuilder { need_estimated: true, data: [], offsets: [0, 0] }).

<Backtrace disabled by default. Please use RUST_BACKTRACE=1 to enable> 

How to Reproduce?

I have a table that I'd like to improve the clustering on. The id field is a UUIDv7 value and looks like this:

> select id from hl7 limit 10;
+--------------------------------------+
| id                                   |
+--------------------------------------+
| 0190f655-2d1c-7490-9e98-642395ba9bb3 |
| 0190f655-2df5-7010-bc65-de7b42316d39 |
| 0190f655-2e10-7dc3-a9f5-7cd800734b0d |
| 0190f655-2e13-7ca0-be26-efd3db6e6955 |
| 0190f655-2e56-7913-920a-c8803a29801a |
| 0190f655-2e87-7183-b068-8f97bdab4afb |
| 0190f655-2ed9-75c3-9826-9cc384d4acad |
| 0190f655-2efb-7291-aaee-0916c2aef2ee |
| 0190f655-2f25-7293-8bec-241703f408a8 |
| 0190f655-2f45-7472-a93f-2422a8372bee |
+--------------------------------------+

The table definition is:

CREATE TABLE hl7 (
  hospital_id BIGINT NULL,
  recv_time TIMESTAMP NOT NULL,
  commit_time TIMESTAMP NULL,
  process_error VARCHAR NULL,
  msg VARCHAR NULL,
  id VARCHAR NOT NULL
) ENGINE=FUSE CLUSTER BY (SUBSTRING(id FROM 1 FOR 8))

If I reduce the id substring from 8 characters, then I receive the following panic:

MySQL [hospital_dev]> alter table hospital_dev.hl7 cluster by (substring(id, 2, 8));
Query OK, 0 rows affected (0.161 sec)

MySQL [hospital_dev]> select * from clustering_information('hospital_dev', 'hl7');
ERROR 1105 (HY000): PanicError. Code: 1104, Text = internal error: entered unreachable code: unable to push NULL to String(StringColumnBuilder { need_estimated: true, data: [], offsets: [0] }).

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@nickb937 nickb937 added the C-bug Category: something isn't working label Nov 4, 2024
@dantengsky
Copy link
Member

@zhyass please take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants