Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Processors/Formats/Impl/Parquet/SchemaConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ void SchemaConverter::processPrimitiveColumn(
if (precision > max_precision)
throw Exception(ErrorCodes::INCORRECT_DATA, "Parquet decimal type precision or scale is too big ({} digits) for physical type {}", precision, thriftToString(type));

out_inferred_type = createDecimal<DataTypeDecimal>(max_precision, scale);
out_inferred_type = createDecimal<DataTypeDecimal>(precision, scale);
size_t output_size = out_inferred_type->getSizeOfValueInMemory();
out_decoder.allow_stats = is_output_type_decimal(output_size, scale);

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
100
col-1de12c05-5dd5-4fa7-9f93-33c43c9a4028 Decimal(20, 0)
col-5e1b97f1-dade-4c7d-b71b-e31d789e01a4 String
col-1de12c05-5dd5-4fa7-9f93-33c43c9a4028 Decimal(20, 0)
col-5e1b97f1-dade-4c7d-b71b-e31d789e01a4 String
3 changes: 3 additions & 0 deletions tests/queries/0_stateless/02845_parquet_odd_decimals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ ${CLICKHOUSE_CLIENT} --query="drop table if exists 02845_parquet_odd_decimals"
${CLICKHOUSE_CLIENT} --query="create table 02845_parquet_odd_decimals (\`col-1de12c05-5dd5-4fa7-9f93-33c43c9a4028\` Decimal(20, 0), \`col-5e1b97f1-dade-4c7d-b71b-e31d789e01a4\` String) engine Memory"
${CLICKHOUSE_CLIENT} --query="insert into 02845_parquet_odd_decimals from infile '$CUR_DIR/data_parquet/nine_byte_decimals_from_spark.parquet'"
${CLICKHOUSE_CLIENT} --query="select count() from 02845_parquet_odd_decimals"

${CLICKHOUSE_LOCAL} --query="desc file('$CUR_DIR/data_parquet/nine_byte_decimals_from_spark.parquet') settings schema_inference_make_columns_nullable=0, input_format_parquet_use_native_reader_v3=0"
${CLICKHOUSE_LOCAL} --query="desc file('$CUR_DIR/data_parquet/nine_byte_decimals_from_spark.parquet') settings schema_inference_make_columns_nullable=0, input_format_parquet_use_native_reader_v3=1"
Loading