mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12:02 +00:00
Merge pull request #50873 from Avogar/parquet-big-integers
Fallback to parsing big integer from String instead of exception in Parquet format
This commit is contained in:
commit
0edfbb45ad
@ -202,13 +202,10 @@ static ColumnWithTypeAndName readColumnWithBigNumberFromBinaryData(std::shared_p
|
|||||||
|
|
||||||
for (size_t i = 0; i != chunk_length; ++i)
|
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))
|
if (!chunk.IsNull(i) && chunk.value_length(i) != sizeof(ValueType))
|
||||||
throw Exception(
|
return readColumnWithStringData<arrow::BinaryArray>(arrow_column, column_name);
|
||||||
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));
|
|
||||||
total_size += chunk_length;
|
total_size += chunk_length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
424242424242424242424242424242424242424242424242424242
|
9
tests/queries/0_stateless/02786_parquet_big_integer_compatibility.sh
Executable file
9
tests/queries/0_stateless/02786_parquet_big_integer_compatibility.sh
Executable file
@ -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"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user