eldenmoon commented on code in PR #63192:
URL: https://github.com/apache/doris/pull/63192#discussion_r3234146086
##########
be/src/format/parquet/vparquet_column_reader.cpp:
##########
@@ -103,6 +119,753 @@ static void fill_array_offset(FieldSchema* field,
ColumnArray::Offsets64& offset
}
}
+static constexpr int64_t UNIX_EPOCH_DAYNR = 719528;
+static constexpr int64_t MICROS_PER_SECOND = 1000000;
+
+static int64_t variant_date_value(const VecDateTimeValue& value) {
+ return value.daynr() - UNIX_EPOCH_DAYNR;
+}
+
+static int64_t variant_date_value(const DateV2Value<DateV2ValueType>& value) {
+ return value.daynr() - UNIX_EPOCH_DAYNR;
+}
+
+static int64_t variant_datetime_value(const VecDateTimeValue& value) {
+ int64_t timestamp = 0;
+ value.unix_timestamp(×tamp, cctz::utc_time_zone());
+ return timestamp * MICROS_PER_SECOND;
+}
+
+static int64_t variant_datetime_value(const DateV2Value<DateTimeV2ValueType>&
value) {
+ int64_t timestamp = 0;
+ value.unix_timestamp(×tamp, cctz::utc_time_zone());
+ return timestamp * MICROS_PER_SECOND + value.microsecond();
+}
+
+static int64_t variant_datetime_value(const TimestampTzValue& value) {
+ int64_t timestamp = 0;
+ value.unix_timestamp(×tamp, cctz::utc_time_zone());
+ return timestamp * MICROS_PER_SECOND + value.microsecond();
+}
+
+static int find_child_idx(const FieldSchema& field, std::string_view name) {
+ for (int i = 0; i < field.children.size(); ++i) {
+ if (field.children[i].lower_case_name == name) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+static bool is_variant_wrapper_field(const FieldSchema& field) {
+ auto type = remove_nullable(field.data_type);
Review Comment:
Fixed in current head `9084f82a0ae8c8ca055f19549ac56d6fb71a510c`. Wrapper
detection is now context-aware for nested typed-only structs: direct typed-only
object traversal does not unwrap primitive user fields named `typed_value` or
`value`, while array-element scalar typed wrappers remain supported. Added BE
coverage in
`ParquetVariantReaderTest.DirectTypedOnlyKeepsNestedStructuralNameUserKeys`
plus Hive/Iceberg pruning tests for nested structural-name user keys. Verified
locally with `./run-be-ut.sh --run
--filter="ParquetVariantReaderTest.*:NestedColumnAccessHelperTest.*"`,
`./build.sh --be`, `./run-regression-test.sh --run --conf
tmp/regression-conf.auto.groovy -d external_table_p0/tvf -s
test_local_tvf_iceberg_variant`, `build-support/check-format.sh`, and `git diff
--check`.
--
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]