Skip to content

Commit 97adf86

Browse files
authored
Merge pull request ClickHouse#80156 from Avogar/fix-arrow-lc-fixed-string
Fix logical error in Arrow format with LowCardinality(FixedString)
2 parents 962e5a0 + d7c8d6a commit 97adf86

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

src/Processors/Formats/Impl/CHColumnToArrowColumn.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
M(FLOAT, arrow::FloatType) \
5353
M(DOUBLE, arrow::DoubleType) \
5454
M(BINARY, arrow::BinaryType) \
55-
M(STRING, arrow::StringType)
55+
M(STRING, arrow::StringType) \
56+
M(FIXED_SIZE_BINARY, arrow::FixedSizeBinaryType)
5657

5758
namespace DB
5859
{
@@ -512,7 +513,7 @@ namespace DB
512513
FOR_ARROW_TYPES(DISPATCH)
513514
#undef DISPATCH
514515

515-
throw Exception(ErrorCodes::LOGICAL_ERROR, "Cannot fill arrow array with {} data.", column_type->getName());
516+
throw Exception(ErrorCodes::LOGICAL_ERROR, "Cannot fill arrow array {} with {} data", value_type->name(), column_type->getName());
516517
}
517518

518519
template <typename ColumnType, typename ArrowBuilder>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
c1 LowCardinality(Nullable(FixedString(1)))
2+
a
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
# Tags: no-fasttest
3+
4+
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
5+
# shellcheck source=../shell_config.sh
6+
. "$CURDIR"/../shell_config.sh
7+
8+
$CLICKHOUSE_LOCAL --output_format_arrow_low_cardinality_as_dictionary=1 "select 'a'::LowCardinality(FixedString(1)) as c1 format Arrow" | $CLICKHOUSE_LOCAL --input-format=Arrow --table=test -q "desc test; select * from test"
9+

0 commit comments

Comments
 (0)