Skip to content

Commit aaad9d4

Browse files
author
lik40
committed
[fix](iceberg) fix the iceberg timstamp_ntz write schema and values bug.
1 parent d3a247e commit aaad9d4

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

be/src/vec/exec/format/table/iceberg/arrow_schema_util.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ Status ArrowSchemaUtil::convert_to(const iceberg::NestedField& field,
7070
break;
7171

7272
case iceberg::TypeID::TIMESTAMP: {
73-
arrow_type = std::make_shared<arrow::TimestampType>(arrow::TimeUnit::MICRO, timezone);
73+
iceberg::TimestampType* t_type = static_cast<iceberg::TimestampType*>(field.field_type());
74+
std::string real_tz = t_type->should_adjust_to_utc() ? timezone : "";
75+
arrow_type = std::make_shared<arrow::TimestampType>(arrow::TimeUnit::MICRO, real_tz);
7476
break;
7577
}
7678

be/src/vec/runtime/vparquet_transformer.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,7 @@ Status VParquetTransformer::_parse_properties() {
228228
builder.max_row_group_length(std::numeric_limits<int64_t>::max());
229229
builder.memory_pool(pool);
230230
_parquet_writer_properties = builder.build();
231-
_arrow_properties = parquet::ArrowWriterProperties::Builder()
232-
.enable_deprecated_int96_timestamps()
233-
->store_schema()
234-
->build();
231+
_arrow_properties = parquet::ArrowWriterProperties::Builder().store_schema()->build();
235232
} catch (const parquet::ParquetException& e) {
236233
return Status::InternalError("parquet writer parse properties error: {}", e.what());
237234
}

0 commit comments

Comments
 (0)