github-actions[bot] commented on code in PR #70808:
URL: https://github.com/apache/doris/pull/70808#discussion_r4661214400


##########
be/src/format_v2/avro/avro_container_reader.cpp:
##########
@@ -0,0 +1,835 @@
+// 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_v2/avro/avro_container_reader.h"
+
+#include <snappy.h>
+#include <zlib.h>
+#define ZSTD_STATIC_LINKING_ONLY
+#include <zstd.h>
+
+#include <algorithm>
+#include <array>
+#include <avro/Compiler.hh>
+#include <avro/Generic.hh>
+#include <avro/NodeImpl.hh>
+#include <bit>
+#include <cstring>
+#include <limits>
+#include <type_traits>
+#include <unordered_map>
+#include <utility>
+#include <vector>
+
+#include "common/exception.h"
+#include "io/fs/file_reader.h"
+#include "io/io_common.h"
+#include "runtime/runtime_profile.h"
+
+namespace doris::format::avro {
+namespace {
+
+void require(bool condition, const char* message) {
+    if (!condition) {
+        throw Exception(ErrorCode::INVALID_ARGUMENT, message);
+    }
+}
+
+template <typename Cursor>
+int64_t read_long(Cursor& cursor) {
+    uint64_t value = 0;
+    for (unsigned shift = 0; shift < 64; shift += 7) {
+        const uint8_t byte = cursor.byte();
+        // The tenth byte has only one available bit in a 64-bit Avro varint.
+        require(shift != 63 || byte <= 1, "Avro varint overflows");
+        value |= static_cast<uint64_t>(byte & 127) << shift;
+        if ((byte & 128) == 0) {
+            return static_cast<int64_t>(value >> 1) ^ 
-static_cast<int64_t>(value & 1);
+        }
+    }
+    throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid Avro varint");
+}
+
+struct MemoryCursor {
+    const uint8_t* data = nullptr;
+    size_t length = 0;
+    size_t position = 0;
+    size_t remaining() const { return length - position; }
+    uint8_t byte() {
+        require(remaining() != 0, "Truncated Avro value");
+        return data[position++];
+    }
+    void read(void* output, size_t size) {
+        require(size <= remaining(), "Truncated Avro value");
+        if (size != 0) {
+            memcpy(output, data + position, size);
+        }
+        position += size;
+    }
+    void skip(size_t size) {
+        require(size <= remaining(), "Truncated Avro value");
+        position += size;
+    }
+};
+
+class FileCursor {
+public:
+    FileCursor(io::FileReaderSPtr file, std::shared_ptr<io::IOContext> context)
+            : _file(std::move(file)), _context(std::move(context)) {}
+    size_t position() const { return _position; }
+    size_t remaining() const { return _file->size() - _position; }
+    size_t scratch_bytes() const { return _prefix_buffer.capacity(); }
+    void coalesce_prefix(const AvroContainerReader::Reserve& reserve) {
+        reserve(1024 * 1024);
+        _prefix_buffer.resize(1024 * 1024);
+        _buffer_size = 0;
+    }
+    void seek(size_t position) {
+        require(position <= _file->size(), "Invalid Avro file offset");
+        _position = position;
+    }
+    uint8_t byte() {
+        uint8_t value;
+        read(&value, 1);
+        return value;
+    }
+    void read(void* output, size_t size) {
+        require(size <= remaining(), "Truncated Avro container");
+        auto* destination = static_cast<uint8_t*>(output);
+        while (size != 0) {
+            if (_context != nullptr && _context->should_stop) {
+                throw Exception(ErrorCode::CANCELLED, "Avro scan cancelled");
+            }
+            if (_position < _buffer_start || _position >= _buffer_start + 
_buffer_size) {
+                size_t read = 0;
+                auto* buffer = _prefix_buffer.empty() ? _buffer.data() : 
_prefix_buffer.data();
+                const auto capacity =
+                        _prefix_buffer.empty() ? _buffer.size() : 
_prefix_buffer.size();
+                auto status =
+                        _file->read_at(_position, Slice(buffer, 
std::min(capacity, remaining())),
+                                       &read, _context.get());
+                if (!status.ok()) {
+                    throw Exception(status);
+                }
+                require(read != 0, "Truncated Avro container");
+                _buffer_start = _position;
+                _buffer_size = read;
+            }
+            const size_t count = std::min(size, _buffer_start + _buffer_size - 
_position);
+            const auto* buffer = _prefix_buffer.empty() ? _buffer.data() : 
_prefix_buffer.data();
+            memcpy(destination, buffer + _position - _buffer_start, count);
+            destination += count;
+            size -= count;
+            _position += count;
+        }
+    }
+
+private:
+    io::FileReaderSPtr _file;
+    std::shared_ptr<io::IOContext> _context;
+    std::array<char, 64 * 1024> _buffer;
+    std::vector<char> _prefix_buffer;
+    size_t _position = 0;
+    size_t _buffer_start = 0;
+    size_t _buffer_size = 0;
+};
+
+::avro::NodePtr resolved(const ::avro::NodePtr& node) {
+    return node->type() == ::avro::AVRO_SYMBOLIC ? ::avro::resolveSymbol(node) 
: node;
+}
+
+} // namespace
+
+struct AvroContainerReader::Impl {
+    FileCursor file;
+    Reserve reserve;
+    Checkpoint checkpoint;
+    Workspace workspace;
+    RuntimeProfile::Counter* decompress_time = nullptr;
+    ::avro::ValidSchema schema;
+    ::avro::ValidSchema projected_schema;
+    std::unordered_map<std::string, std::string> metadata;
+    std::array<uint8_t, 16> sync;
+    std::vector<uint8_t> compressed;
+    std::vector<uint8_t> uncompressed;
+    std::unordered_map<const ::avro::Node*, size_t> datum_sizes;
+    std::unordered_map<size_t, size_t> selected;
+    MemoryCursor data;
+    size_t header_end = 0;
+    int64_t remaining_rows = 0;
+    int64_t total_rows = 0;
+    size_t schema_charge = 0;
+    bool loaded = false;
+
+    Impl(io::FileReaderSPtr input, std::shared_ptr<io::IOContext> context, 
Reserve allocation,
+         Checkpoint reset, Workspace codec_workspace, RuntimeProfile* profile)
+            : file(std::move(input), std::move(context)),
+              reserve(std::move(allocation)),
+              checkpoint(std::move(reset)),
+              workspace(std::move(codec_workspace)) {
+        if (profile != nullptr) {
+            decompress_time = ADD_CHILD_TIMER_WITH_LEVEL(profile, 
"AvroDecompressTime",
+                                                         
"AvroDecodeAndMaterializeTime", 1);
+        }
+        std::array<uint8_t, 4> magic;
+        file.read(magic.data(), magic.size());
+        require(magic == std::array<uint8_t, 4> {'O', 'b', 'j', 1}, "Invalid 
Avro magic");
+        for (int64_t count = read_long(file); count != 0; count = 
read_long(file)) {
+            if (count < 0) {
+                require(count != std::numeric_limits<int64_t>::min(),
+                        "Invalid Avro metadata count");
+                count = -count;
+                const auto bytes = read_long(file);
+                require(bytes >= 0 && static_cast<uint64_t>(bytes) <= 
file.remaining(),
+                        "Invalid Avro metadata block");
+            }
+            growth(0, count, 128);
+            require(static_cast<uint64_t>(count) <= file.remaining() / 2,
+                    "Truncated Avro metadata");
+            for (int64_t i = 0; i < count; ++i) {
+                auto key = read_string(file);
+                auto value = read_string(file);
+                metadata.insert_or_assign(std::move(key), std::move(value));
+            }
+        }
+        file.read(sync.data(), sync.size());
+        header_end = file.position();
+        const auto found = metadata.find("avro.schema");
+        require(found != metadata.end(), "Avro schema metadata is missing");
+        // The upstream JSON compiler recurses. Bound nesting before entering 
it, even for a
+        // header-only file; braces inside escaped JSON strings do not 
contribute to depth.
+        size_t depth = 0;
+        bool quoted = false, escaped = false;
+        for (const char c : found->second) {
+            if (quoted) {
+                if (escaped) {
+                    escaped = false;
+                } else if (c == '\\') {
+                    escaped = true;
+                } else if (c == '"') {
+                    quoted = false;
+                }
+            } else if (c == '"') {
+                quoted = true;
+            } else if (c == '{' || c == '[') {
+                require(++depth <= 128, "Avro schema nesting is unsupported");
+            } else if (c == '}' || c == ']') {
+                require(depth != 0, "Invalid Avro schema JSON");
+                --depth;
+            }
+        }
+        growth(0, found->second.size(), 16);
+        schema_charge = found->second.size() * 16;
+        schema = ::avro::compileJsonSchemaFromString(found->second);
+    }
+
+    void growth(size_t capacity, size_t count, size_t item_size = 1) const {
+        require(count <= std::numeric_limits<int64_t>::max() / 2 / item_size,
+                "Avro allocation size overflows");
+        if (count > capacity) {
+            reserve(std::max(count, capacity * 2) * item_size);
+        }
+    }
+
+    template <typename Cursor>
+    std::string read_string(Cursor& input) {
+        const auto length = read_long(input);
+        require(length >= 0, "Invalid Avro string length");
+        growth(0, length);
+        require(static_cast<uint64_t>(length) <= input.remaining(), "Truncated 
Avro string");
+        std::string value(static_cast<size_t>(length), '\0');
+        input.read(value.data(), value.size());
+        return value;
+    }
+
+    size_t datum_size(const ::avro::NodePtr& input) {
+        const auto node = resolved(input);
+        if (const auto found = datum_sizes.find(node.get()); found != 
datum_sizes.end()) {
+            return found->second;
+        }
+        size_t size = 0;
+        switch (node->type()) {
+        case ::avro::AVRO_STRING:
+            size = sizeof(std::string);
+            break;
+        case ::avro::AVRO_BYTES:
+            size = sizeof(std::vector<uint8_t>);
+            break;
+        case ::avro::AVRO_FIXED:
+            size = sizeof(::avro::GenericFixed) + node->fixedSize();
+            break;
+        case ::avro::AVRO_ARRAY:
+            size = sizeof(::avro::GenericArray);
+            break;
+        case ::avro::AVRO_MAP:
+            size = sizeof(::avro::GenericMap);
+            break;
+        case ::avro::AVRO_ENUM:
+            size = sizeof(::avro::GenericEnum);
+            break;
+        case ::avro::AVRO_UNION: {
+            // Estimate the canonical null-first skeleton even when this is a 
writer node used
+            // to admit a nested branch. An unused large FIXED alternative 
must not consume budget.
+            const size_t first =
+                    node->leaves() == 2 && node->leafAt(1)->type() == 
::avro::AVRO_NULL ? 1 : 0;
+            size = sizeof(::avro::GenericUnion) + 
datum_size(node->leafAt(first));
+            break;
+        }
+        case ::avro::AVRO_RECORD:
+            size = sizeof(::avro::GenericRecord) + node->leaves() * 
sizeof(::avro::GenericDatum);
+            for (size_t i = 0; i < node->leaves(); ++i) {
+                const auto child = datum_size(node->leafAt(i));
+                require(child <= std::numeric_limits<int64_t>::max() - size,
+                        "Avro datum size overflows");
+                size += child;
+            }
+            break;
+        default:
+            break;
+        }
+        datum_sizes.emplace(node.get(), size);
+        return size;
+    }
+
+    bool zero_width(const ::avro::NodePtr& input) {
+        const auto node = resolved(input);
+        if (node->type() == ::avro::AVRO_NULL) {
+            return true;
+        }
+        if (node->type() == ::avro::AVRO_FIXED) {
+            return node->fixedSize() == 0;
+        }
+        if (node->type() != ::avro::AVRO_RECORD) {
+            return false;
+        }
+        for (size_t i = 0; i < node->leaves(); ++i) {
+            if (!zero_width(node->leafAt(i))) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    int64_t block_header(size_t* payload_end) {
+        const int64_t count = read_long(file);
+        const int64_t bytes = read_long(file);
+        require(count >= 0 && bytes >= 0 && file.remaining() >= sync.size() &&
+                        static_cast<uint64_t>(bytes) <= file.remaining() - 
sync.size(),
+                "Invalid Avro data block bounds");
+        *payload_end = file.position() + bytes;
+        return count;
+    }
+
+    void verify_sync() {
+        std::array<uint8_t, 16> marker;
+        file.read(marker.data(), marker.size());
+        require(marker == sync, "Avro sync mismatch");
+    }
+
+    bool valid_sync_boundary() {
+        const size_t offset = file.position();
+        const size_t remaining = file.remaining();
+        // The final block's sync marker ends at EOF, so it has no following 
header.
+        if (remaining == 0) {
+            return true;
+        }
+        // A candidate needs at most two ten-byte varints. Keep file I/O 
outside the parsing
+        // catch: a read failure or cancellation must not be mistaken for a 
payload collision.
+        std::array<uint8_t, 20> header;
+        const size_t length = std::min(header.size(), remaining);
+        file.read(header.data(), length);
+        MemoryCursor cursor {.data = header.data(), .length = length};
+        int64_t count;
+        int64_t bytes;
+        try {
+            count = read_long(cursor);
+            bytes = read_long(cursor);
+        } catch (const Exception&) {
+            return false;
+        }
+        const size_t available = remaining - cursor.position;
+        // Payload bytes can mimic a header while describing a negative or 
past-EOF block.
+        if (count < 0 || bytes < 0 || available < sync.size() ||
+            static_cast<uint64_t>(bytes) > available - sync.size()) {
+            return false;

Review Comment:
   [P1] Do not accept a sync marker based only on locally valid framing. A 
legal bytes/string payload can contain `<sync><zigzag count=1><zigzag 
size=1><encoded empty bytes datum><sync>`. When a split starts at that embedded 
marker, `valid_sync_boundary()` accepts it, `init()` treats the payload as a 
new OCF block, and the second range can emit a fake row or lose the enclosing 
block's rows. Prove the boundary by walking from the header/known block index 
(or otherwise establish an unambiguous block boundary), and add this fully 
framed payload collision to the regression.



##########
be/src/format_v2/avro/avro_reader.cpp:
##########
@@ -0,0 +1,1185 @@
+// 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_v2/avro/avro_reader.h"
+
+#include <algorithm>
+#include <array>
+#include <avro/Generic.hh>
+#include <avro/NodeImpl.hh>
+#include <charconv>
+#include <limits>
+#include <mutex>
+#include <string_view>
+#include <type_traits>
+#include <unordered_set>
+#include <utility>
+
+#include "common/exception.h"
+#include "core/assert_cast.h"
+#include "core/block/block.h"
+#include "core/column/column_array.h"
+#include "core/column/column_map.h"
+#include "core/column/column_nullable.h"
+#include "core/column/column_struct.h"
+#include "core/column/column_vector.h"
+#include "core/custom_allocator.h"
+#include "core/data_type/data_type_array.h"
+#include "core/data_type/data_type_date_or_datetime_v2.h"
+#include "core/data_type/data_type_decimal.h"
+#include "core/data_type/data_type_map.h"
+#include "core/data_type/data_type_nullable.h"
+#include "core/data_type/data_type_number.h"
+#include "core/data_type/data_type_string.h"
+#include "core/data_type/data_type_struct.h"
+#include "core/data_type/data_type_time.h"
+#include "core/data_type/data_type_timestamp_ns.h"
+#include "core/data_type/data_type_timestamptz.h"
+#include "core/data_type/data_type_uuid.h"
+#include "core/data_type/data_type_varbinary.h"
+#include "core/value/timestamp_ns_value.h"
+#include "core/value/timestamptz_value.h"
+#include "format_v2/avro/avro_container_reader.h"
+#include "format_v2/column_mapper.h"
+#include "format_v2/materialized_reader_util.h"
+#include "io/fs/file_reader.h"
+#include "io/io_common.h"
+#include "runtime/file_scan_profile.h"
+#include "runtime/memory/mem_tracker_limiter.h"
+#include "runtime/memory/thread_mem_tracker_mgr.h"
+#include "runtime/runtime_state.h"
+#include "runtime/thread_context.h"
+#include "storage/utils.h"
+#include "util/timezone_utils.h"
+
+namespace doris::format::avro {
+namespace {
+
+::avro::NodePtr resolved_node(const ::avro::NodePtr& node) {
+    return node->type() == ::avro::AVRO_SYMBOLIC ? ::avro::resolveSymbol(node) 
: node;
+}
+
+struct AvroTemporalPolicy {
+    cctz::time_zone timezone = cctz::utc_time_zone();
+    bool legacy_calendar = false;
+    bool legacy_timezone = false;
+};
+
+bool parse_writer_timezone(const std::string& name, cctz::time_zone* zone) {
+    std::string_view offset(name);
+    bool prefixed = false;
+    if (offset.starts_with("GMT") || offset.starts_with("UTC")) {
+        offset.remove_prefix(3);
+        prefixed = true;
+    } else if (offset.starts_with("UT")) {
+        offset.remove_prefix(2);
+        prefixed = true;
+    }
+    if ((prefixed && offset.empty()) || name == "Z") {
+        *zone = cctz::utc_time_zone();
+        return true;
+    }
+    if (offset.empty()) {
+        return false;
+    }
+    if (offset.front() != '+' && offset.front() != '-') {
+        // Hive emits normalized Java ZoneIds. Use named TZDB rules without 
SQL-only aliases.
+        return cctz::load_time_zone(name, zone);
+    }
+    const bool negative = offset.front() == '-';
+    offset.remove_prefix(1);
+    auto parse = [](std::string_view part, int* value) {
+        if (part.empty() || part.size() > 2 ||
+            !std::ranges::all_of(part, [](char c) { return c >= '0' && c <= 
'9'; })) {
+            return false;
+        }
+        const auto result = std::from_chars(part.data(), part.data() + 
part.size(), *value);
+        return result.ec == std::errc() && result.ptr == part.data() + 
part.size();
+    };
+    int hours = 0, minutes = 0, seconds = 0;
+    const auto colon = offset.find(':');
+    if (!parse(offset.substr(0, colon), &hours)) {
+        return false;
+    }
+    if (colon != std::string_view::npos) {
+        offset.remove_prefix(colon + 1);
+        const auto second_colon = offset.find(':');
+        const auto minute = offset.substr(0, second_colon);
+        if (minute.size() != 2 || !parse(minute, &minutes)) {
+            return false;
+        }
+        if (second_colon != std::string_view::npos) {
+            const auto second = offset.substr(second_colon + 1);
+            if (second.size() != 2 || !parse(second, &seconds)) {
+                return false;
+            }
+        }
+    }
+    // Java ZoneOffset permits +/-18h, unlike the SQL session's -12h/+14h 
setting.
+    if (hours > 18 || minutes > 59 || seconds > 59 ||
+        (hours == 18 && (minutes != 0 || seconds != 0))) {
+        return false;
+    }
+    const int total = (negative ? -1 : 1) * (hours * 3600 + minutes * 60 + 
seconds);
+    *zone = TimezoneUtils::create_fixed_offset_time_zone(total);
+    return true;
+}
+
+size_t expanded_schema_bytes(const ::avro::NodePtr& input,
+                             std::unordered_map<const ::avro::Node*, size_t>* 
sizes,
+                             std::unordered_set<const ::avro::Node*>* 
ancestors) {
+    const auto node = resolved_node(input);
+    if (ancestors->size() >= 64 || !ancestors->insert(node.get()).second) {
+        throw Exception(ErrorCode::NOT_IMPLEMENTED_ERROR,
+                        "Recursive or excessively nested Avro schemas are 
unsupported");
+    }
+    Defer pop([&] { ancestors->erase(node.get()); });
+    if (const auto found = sizes->find(node.get()); found != sizes->end()) {
+        return found->second;
+    }
+    // Named schemas share Avro nodes, but Doris expands each use into a 
distinct column tree.
+    // Memoize the expanded cost: N_i={a:N_(i-1),b:N_(i-1)} doubles without a 
deep schema.
+    constexpr size_t max_schema_bytes = 64 * 1024 * 1024;
+    size_t bytes = 1024;
+    for (size_t i = 0; i < node->leaves(); ++i) {
+        const auto child = expanded_schema_bytes(node->leafAt(i), sizes, 
ancestors);
+        if (child > max_schema_bytes || bytes > max_schema_bytes - child) {
+            throw Exception(ErrorCode::NOT_IMPLEMENTED_ERROR,
+                            "Expanded Avro schema size is unsupported");
+        }
+        bytes += child;
+    }
+    sizes->emplace(node.get(), bytes);
+    return bytes;
+}
+
+std::string lowercase(std::string name) {
+    for (auto& c : name) {
+        if (c >= 'A' && c <= 'Z') {
+            c += 'a' - 'A';
+        }
+    }
+    return name;
+}
+
+Status set_identifier(const ::avro::NodePtr& node, size_t attributes_index, 
const char* attribute,
+                      ColumnDefinition* column) {
+    if (attributes_index >= node->customAttributes()) {
+        return Status::OK();
+    }
+    const auto value = 
node->customAttributesAt(attributes_index).getAttribute(attribute);
+    if (!value.has_value()) {
+        return Status::OK();
+    }
+    int32_t id = 0;
+    const auto parsed = std::from_chars(value->data(), value->data() + 
value->size(), id);
+    if (parsed.ec != std::errc() || parsed.ptr != value->data() + 
value->size() || id <= 0) {
+        return Status::InvalidArgument("Invalid Avro field identifier");
+    }
+    column->identifier = Field::create_field<TYPE_INT>(id);
+    return Status::OK();
+}
+
+bool is_logical_map(const ::avro::NodePtr& node) {
+    const auto logical = node->logicalType();
+    return node->type() == ::avro::AVRO_ARRAY && logical.type() == 
::avro::LogicalType::CUSTOM &&
+           logical.customLogicalType()->name() == "map";
+}
+
+// Keep logical and physical alternatives in one visitor so nullable handling 
is shared.
+// 
NOLINTNEXTLINE(readability-function-size,readability-function-cognitive-complexity)
+Status build_schema(const ::avro::NodePtr& input, const std::string& name, 
int32_t ordinal,
+                    bool timestamp_tz, bool varbinary,
+                    std::unordered_set<const ::avro::Node*>* ancestors, 
ColumnDefinition* column) {
+    const auto node = resolved_node(input);
+    // A recursive Avro record cannot be represented by a finite Doris STRUCT 
type.
+    if (ancestors->size() >= 64 || !ancestors->insert(node.get()).second) {
+        return Status::NotSupported("Recursive or excessively nested Avro 
schemas are unsupported");
+    }
+    struct Pop {
+        std::unordered_set<const ::avro::Node*>* nodes;
+        const ::avro::Node* node;
+        ~Pop() { nodes->erase(node); }
+    } pop {.nodes = ancestors, .node = node.get()};
+    if (node->leaves() > 
static_cast<size_t>(std::numeric_limits<int32_t>::max())) {
+        return Status::NotSupported("Avro schema has too many fields");
+    }
+    column->name = lowercase(name);
+    column->local_id = ordinal;
+    column->identifier = Field::create_field<TYPE_STRING>(column->name);

Review Comment:
   [P2] Reject case-colliding Avro fields before lowercasing them. Avro field 
names are case-sensitive, so a valid record may contain both `Foo` and `foo`; 
this builder turns both into `foo`, while the BY_NAME mapper returns the first 
case-insensitive match. A Hive table reading such a file can therefore bind 
both logical lookups to the wrong physical field. Detect duplicate lowercase 
names at each record level and return an explicit unsupported/ambiguous-schema 
error.



##########
fe/fe-connector/fe-connector-hive/src/main/java/org/apache/doris/connector/hive/HiveFileFormat.java:
##########
@@ -43,6 +44,7 @@ public enum HiveFileFormat {
 
     PARQUET("parquet"),
     ORC("orc"),
+    AVRO("avro"),
     // Hive text family (LazySimpleSerDe / MultiDelimitSerDe) -> BE 
FORMAT_TEXT.

Review Comment:
   [P2] Mark Avro as splittable now that the native reader owns OCF sync 
alignment. `isSplittable()` still excludes AVRO, so HiveScanPlanProvider emits 
one unsplittable range per file even though `AvroReader::seek_range(false)` 
safely starts at the next sync block. Large Hive Avro files lose parallelism 
and can create scan skew; include AVRO in the capability and add a planner test 
for multiple ranges.



-- 
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]

Reply via email to