Skip to content

18.16.1 Exception when querying empty arrays of LowCardinality(String) #3907

@SaltTan

Description

@SaltTan

There is an issue with empty arrays of LowCardinality(String). Disabling low_cardinality_allow_in_native_format fixes this issue.
A script to reproduce:

create table test.lc (names Array(LowCardinality(String))) engine=Memory;
insert into test.lc values ([]);
insert into test.lc select emptyArrayString();
select * from test.lc;
set low_cardinality_allow_in_native_format=0;
select * from test.lc;

This is how the script runs:

 :) create table test.lc (names Array(LowCardinality(String))) engine=Memory;

CREATE TABLE test.lc
(
    names Array(LowCardinality(String))
)
ENGINE = Memory

Ok.

0 rows in set. Elapsed: 0.003 sec.

 :) insert into test.lc values ([]);

INSERT INTO test.lc VALUES

Received exception from server (version 18.16.1):
Code: 62. DB::Exception: Received from localhost:9000, ::1. DB::Exception: Empty query.

1 rows in set. Elapsed: 0.001 sec.

 :) insert into test.lc select emptyArrayString();

INSERT INTO test.lc SELECT emptyArrayString()

Ok.

0 rows in set. Elapsed: 0.002 sec.

 :) select * from test.lc;

SELECT *
FROM test.lc

┌─names─┐
│ []    │
└───────┘
↓ Progress: 1.00 rows, 17.00 B (934.01 rows/s., 15.88 KB/s.)
Exception on client:
Code: 62. DB::Exception: Empty query: while receiving packet from localhost:9000, ::1

Connecting to localhost:9000.
Connected to ClickHouse server version 18.16.1 revision 54412.

 :) set low_cardinality_allow_in_native_format=0;

SET low_cardinality_allow_in_native_format = 0

Ok.

0 rows in set. Elapsed: 0.001 sec.

 :) select * from test.lc

SELECT *
FROM test.lc

┌─names─┐
│ []    │
└───────┘

1 rows in set. Elapsed: 0.002 sec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions