Gabriel39 commented on code in PR #66891:
URL: https://github.com/apache/doris/pull/66891#discussion_r3975894311
##########
be/src/format/arrow/arrow_block_convertor.cpp:
##########
@@ -118,6 +103,42 @@ std::shared_ptr<arrow::DataType> extension_storage_type(
}
}
+bool is_declared_plain_arrow_binding(const DataTypePtr& type,
+ const std::shared_ptr<arrow::DataType>&
plain_arrow_type,
+ const std::shared_ptr<arrow::DataType>&
target_type) {
+ if (plain_arrow_type->Equals(target_type)) {
+ return true;
+ }
+ if (plain_arrow_type->id() == arrow::Type::TIMESTAMP &&
+ target_type->id() == arrow::Type::TIMESTAMP) {
+ const auto& plain_timestamp = assert_cast<const
arrow::TimestampType&>(*plain_arrow_type);
+ const auto& target_timestamp = assert_cast<const
arrow::TimestampType&>(*target_type);
+ if (plain_timestamp.unit() != target_timestamp.unit()) {
+ return false;
+ }
+ cctz::time_zone target_timezone;
+ return TimezoneUtils::find_cctz_time_zone(target_timestamp.timezone(),
target_timezone) &&
+ target_timezone.name() == plain_timestamp.timezone();
Review Comment:
This rejects the timezone-naive DATETIMEV2 schema intentionally produced by
Arrow Flight and `MemoryScratchSink`: when `target_timestamp.timezone()` is
empty, `find_cctz_time_zone` returns false even though the units match. The
existing `DateTimeV2ArrowEncodingFollowsSchemaTimezone` test expects that
conversion to succeed, but the current compile failure prevents the test from
reaching this assertion. Please preserve the valid naive DATETIMEV2 binding,
including recursively inside ARRAY/MAP/STRUCT types.
##########
be/src/format/table/iceberg/iceberg_arrow_write_converter.cpp:
##########
@@ -0,0 +1,40 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "format/table/iceberg/iceberg_arrow_write_converter.h"
+
+namespace doris::iceberg {
+#include "common/compile_check_begin.h"
+
+Status IcebergArrowWriteConverter::write_column(const std::shared_ptr<const
IDataType>& type,
+ const DataTypeSerDe& serde,
const IColumn& column,
+ const NullMap* null_map,
+ const
std::shared_ptr<arrow::Field>& field,
+ arrow::ArrayBuilder*
array_builder, int64_t start,
+ int64_t end, const
cctz::time_zone& ctz) const {
+ return serde.write_column_to_iceberg(type, column, null_map,
+
field->WithType(array_builder->type()), array_builder,
Review Comment:
This translation unit only sees the forward declarations of `arrow::Field`
and `arrow::ArrayBuilder` from `data_type_serde.h`, so both member accesses
fail to compile. BE UT build 1041935 stops here with incomplete-type errors.
Please include the complete definitions (for example, `<arrow/type.h>` and
`<arrow/array/builder_base.h>`). `paimon_arrow_write_converter.cpp` already
includes `arrow/type.h` but has the same missing `ArrayBuilder` definition.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]