mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
Fallback to parsing big integer from String instead of exception in Parquet format
This commit is contained in:
parent
f5d88d2c05
commit
5cec4c3161
@ -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