Gabriel39 commented on code in PR #65784:
URL: https://github.com/apache/doris/pull/65784#discussion_r3611749499
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergSnapshotCacheValue.java:
##########
@@ -17,14 +17,30 @@
package org.apache.doris.datasource.iceberg;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
public class IcebergSnapshotCacheValue {
private final IcebergPartitionInfo partitionInfo;
private final IcebergSnapshot snapshot;
+ private final Optional<Map<Integer, List<String>>> nameMapping;
public IcebergSnapshotCacheValue(IcebergPartitionInfo partitionInfo,
IcebergSnapshot snapshot) {
+ this(partitionInfo, snapshot, Optional.empty());
+ }
+
+ public IcebergSnapshotCacheValue(IcebergPartitionInfo partitionInfo,
IcebergSnapshot snapshot,
+ Optional<Map<Integer, List<String>>> nameMapping) {
this.partitionInfo = partitionInfo;
this.snapshot = snapshot;
+ this.nameMapping = nameMapping.map(mapping -> {
+ Map<Integer, List<String>> copy = new HashMap<>();
+ mapping.forEach((id, names) -> copy.put(id, List.copyOf(names)));
+ return Map.copyOf(copy);
Review Comment:
Fixed in 512c431cfd0. ID-less NameMapping wrapper entries are now skipped
while nested mappings are still traversed, and the snapshot-cache test covers
the nested ID-bearing alias and immutable map construction.
##########
be/src/format_v2/table/iceberg_reader.h:
##########
@@ -57,12 +57,16 @@ class IcebergTableReader : public format::TableReader {
Status prepare_split(const format::SplitReadOptions& options) override;
std::string debug_string() const override;
format::TableColumnMappingMode mapping_mode() const override {
- return !_data_reader.file_schema.empty() &&
_has_field_id(_data_reader.file_schema)
+ return !_data_reader.file_schema.empty() &&
_has_any_field_id(_data_reader.file_schema)
Review Comment:
Fixed in 512c431cfd0. The normal Iceberg reader and V2 position-delete
reader now share the same existential any-field-id predicate. Added Parquet and
ORC result tests for a renamed ID-bearing field with an ID-less sibling.
--
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]