Gabriel39 commented on code in PR #66007:
URL: https://github.com/apache/doris/pull/66007#discussion_r3673448018
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergSnapshotCacheValue.java:
##########
@@ -54,4 +77,65 @@ public IcebergSnapshot getSnapshot() {
public Optional<Map<Integer, List<String>>> getNameMapping() {
return nameMapping;
}
+
+ public Optional<Table> getIcebergTable() {
+ return icebergTable;
+ }
+
+ private static Table freezeTableGeneration(Table table) {
+ if (!(table instanceof HasTableOperations)) {
+ return table;
+ }
+ TableOperations operations = ((HasTableOperations) table).operations();
+ TableOperations frozenOperations = new
FrozenTableOperations(operations, operations.current());
+ if (table instanceof BaseTable) {
+ return new BaseTable(frozenOperations, table.name(), ((BaseTable)
table).reporter());
+ }
+ return new BaseTable(frozenOperations, table.name());
+ }
+
+ private static class FrozenTableOperations implements TableOperations {
+ private final TableOperations delegate;
+ private final TableMetadata metadata;
+
+ private FrozenTableOperations(TableOperations delegate, TableMetadata
metadata) {
+ this.delegate = delegate;
+ this.metadata = metadata;
+ }
+
+ @Override
+ public TableMetadata current() {
+ return metadata;
+ }
+
+ @Override
+ public TableMetadata refresh() {
+ return metadata;
+ }
+
+ @Override
+ public void commit(TableMetadata base, TableMetadata newMetadata) {
+ throw new UnsupportedOperationException("Frozen Iceberg table
generation is read-only");
Review Comment:
Fixed in 8e6c5fabbdb. The retained table remains the read/validation view,
while transactions wrap writable catalog operations and delegate commit with
the retained metadata as the optimistic base. Added real HadoopCatalog coverage
for both a successful commit and rejection after a concurrent metadata advance.
##########
be/src/core/data_type_serde/orc_serde_utils.h:
##########
@@ -0,0 +1,69 @@
+// 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.
+
+#pragma once
+
+#include <cstring>
+#include <orc/Vector.hh>
+
+#include "core/arena.h"
+
+namespace doris {
+
+inline void copy_orc_string_data_to_arena(orc::ColumnVectorBatch* batch,
Arena& arena) {
+ if (auto* strings = dynamic_cast<orc::StringVectorBatch*>(batch)) {
+ size_t total_size = 0;
+ for (size_t i = 0; i < strings->numElements; ++i) {
+ total_size += static_cast<size_t>(strings->length[i]);
+ }
+ char* cursor = total_size == 0 ? nullptr : arena.alloc(total_size);
Review Comment:
Fixed in 8e6c5fabbdb. Arena now detects whether a byte range is already
owned, and the ORC lifetime helper copies only borrowed leaves. Added an ASAN
unit test that verifies the owned pointer is preserved and Arena growth equals
only the borrowed payload.
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/check/CheckCast.java:
##########
@@ -414,7 +414,9 @@ && check(((MapType) originalType).getValueType(),
((MapType) targetType).getValu
return false;
}
for (int i = 0; i < targetFields.size(); i++) {
- if (originalFields.get(i).isNullable() !=
targetFields.get(i).isNullable()) {
+ // A nullable target can safely accept a required source, but
the inverse would
+ // allow a possible NULL into a required nested field.
+ if (originalFields.get(i).isNullable() &&
!targetFields.get(i).isNullable()) {
return false;
}
Review Comment:
Fixed in 8e6c5fabbdb. The FE named_struct path in this PR preserves
value-child nullability; BE struct and named_struct now use the same contract
instead of widening every child to nullable. The related StructLiteral and
planner tests pass locally.
--
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]