yiguolei commented on code in PR #67784:
URL: https://github.com/apache/doris/pull/67784#discussion_r4056321358
##########
be/src/format_v2/table/paimon_reader.cpp:
##########
@@ -179,6 +180,47 @@ Status annotate_paimon_variants(const
std::vector<ColumnDefinition>& table_schem
return Status::OK();
}
+DataTypePtr nullable_like_original(const DataTypePtr& original, DataTypePtr
nested) {
+ return original != nullptr && original->is_nullable() ?
make_nullable(nested) : nested;
+}
+
+DataTypePtr apply_paimon_timestamp_semantics(format::ColumnDefinition* column)
{
+ DORIS_CHECK(column != nullptr);
+ DORIS_CHECK(column->type != nullptr);
+ const auto primitive = remove_nullable(column->type)->get_primitive_type();
+ if (column->timestamp_is_adjusted_to_utc.has_value() &&
+ (primitive == TYPE_DATETIMEV2 || primitive == TYPE_TIMESTAMPTZ)) {
+ const auto target =
+ *column->timestamp_is_adjusted_to_utc ? TYPE_TIMESTAMPTZ :
TYPE_DATETIMEV2;
+ column->type = DataTypeFactory::instance().create_data_type(
+ target, column->type->is_nullable(), 0,
column->type->get_scale());
+ return column->type;
+ }
+
+ std::vector<DataTypePtr> child_types;
+ child_types.reserve(column->children.size());
+ for (auto& child : column->children) {
+ child_types.push_back(apply_paimon_timestamp_semantics(&child));
+ }
+ if (primitive == TYPE_ARRAY && child_types.size() == 1) {
Review Comment:
如果是array,而且child size == 2 是不是该报错?
--
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]