Skip to content

Commit

Permalink
Merge pull request #51195 from ClickHouse/backport/23.5/50873
Browse files Browse the repository at this point in the history
Backport #50873 to 23.5: Fallback to parsing big integer from String instead of exception in Parquet format
  • Loading branch information
Avogar committed Jun 21, 2023
2 parents 416c535 + d79a81a commit 4fa10a8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Processors/Formats/Impl/ArrowColumnToCHColumn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,10 @@ static ColumnWithTypeAndName readColumnWithBigNumberFromBinaryData(std::shared_p

for (size_t i = 0; i != chunk_length; ++i)
{
/// If at least one value size is not equal to the size if big integer, fallback to reading String column and further cast to result type.
if (!chunk.IsNull(i) && chunk.value_length(i) != sizeof(ValueType))
throw Exception(
ErrorCodes::BAD_ARGUMENTS,
"Cannot insert data into {} column from binary value, expected data with size {}, got {}",
column_type->getName(),
sizeof(ValueType),
chunk.value_length(i));
return readColumnWithStringData<arrow::BinaryArray>(arrow_column, column_name);

total_size += chunk_length;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
424242424242424242424242424242424242424242424242424242
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Tags: no-fasttest

CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CUR_DIR"/../shell_config.sh

$CLICKHOUSE_LOCAL -q "select toString(424242424242424242424242424242424242424242424242424242::UInt256) as x format Parquet" | $CLICKHOUSE_LOCAL --input-format=Parquet --structure='x UInt256' -q "select * from table"

0 comments on commit 4fa10a8

Please sign in to comment.