Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions be/src/core/data_type/data_type_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ class DataTypeFile final : public IDataType {
public:
static constexpr PrimitiveType PType = TYPE_FILE;
static constexpr size_t FIELD_COUNT = 6;
static constexpr size_t URI_FIELD_INDEX = 0;
static constexpr size_t OFFSET_FIELD_INDEX = 1;
static constexpr size_t SIZE_FIELD_INDEX = 2;
static constexpr size_t CONTENT_TYPE_FIELD_INDEX = 3;
static constexpr size_t CHECKSUM_FIELD_INDEX = 4;
static constexpr size_t INLINE_FIELD_INDEX = 5;

DataTypeFile();
Expand Down
4 changes: 4 additions & 0 deletions be/src/exec/scan/access_path_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,10 @@ Status build_nested_children_from_access_node(format::ColumnDefinition* column,
}

switch (nested_type->get_primitive_type()) {
case TYPE_FILE:
// FILE has a fixed six-child schema. Keep the whole value in the scan projection;
// element_at selects its public field after the reader materializes the FILE column.
return Status::OK();
case TYPE_STRUCT:
return build_struct_children_from_access_node(
column, assert_cast<const DataTypeStruct&>(*nested_type), node, path, schema_column,
Expand Down
11 changes: 11 additions & 0 deletions be/src/exec/scan/file_scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include "core/column/column_nullable.h"
#include "core/column/column_vector.h"
#include "core/data_type/data_type.h"
#include "core/data_type/data_type_file.h"
#include "core/data_type/data_type_nullable.h"
#include "core/data_type/data_type_string.h"
#include "core/string_ref.h"
Expand Down Expand Up @@ -1055,6 +1056,16 @@ Status FileScanner::_get_next_reader() {
const TFileRangeDesc& range = _current_range;
_current_range_path = range.path;

if (range.__isset.table_format_params && range.table_format_params.__isset.paimon_params &&
(range.table_format_params.paimon_params.__isset.blob_files ||
std::ranges::any_of(_file_slot_descs, [](const SlotDescriptor* slot) {
return contains_file_type(slot->get_data_type_ptr());
}))) {
return Status::NotSupported(
"Paimon BLOB columns require enable_file_scanner_v2=true for both native "
"and JNI readers");
}

if (!_partition_slot_descs.empty()) {
// we need get partition columns first for runtime filter partition pruning
RETURN_IF_ERROR(_generate_partition_columns());
Expand Down
8 changes: 4 additions & 4 deletions be/src/exprs/function/cast/cast_to_variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ struct CastToVariant {
};

// create corresponding variant value to wrap from_type
WrapperType create_cast_to_variant_wrapper(const DataTypePtr& from_type,
const DataTypeVariant& to_type) {
inline WrapperType create_cast_to_variant_wrapper(const DataTypePtr& from_type,
const DataTypeVariant& to_type) {
if (from_type->get_primitive_type() == TYPE_VARIANT) {
// variant_max_subcolumns_count is not equal
return create_unsupport_wrapper(from_type->get_name(), to_type.get_name());
Expand All @@ -190,8 +190,8 @@ WrapperType create_cast_to_variant_wrapper(const DataTypePtr& from_type,
}

// create corresponding type convert from variant
WrapperType create_cast_from_variant_wrapper(const DataTypeVariant& from_type,
const DataTypePtr& to_type) {
inline WrapperType create_cast_from_variant_wrapper(const DataTypeVariant& from_type,
const DataTypePtr& to_type) {
if (to_type->get_primitive_type() == TYPE_VARIANT) {
// variant_max_subcolumns_count is not equal
return create_unsupport_wrapper(from_type.get_name(), to_type->get_name());
Expand Down
26 changes: 26 additions & 0 deletions be/src/format/jni/jni_data_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@

#include "core/block/block.h"
#include "core/column/column_array.h"
#include "core/column/column_file.h"
#include "core/column/column_map.h"
#include "core/column/column_nullable.h"
#include "core/column/column_string.h"
#include "core/column/column_struct.h"
#include "core/column/column_varbinary.h"
#include "core/column/variant_v2/column_variant_v2.h"
#include "core/data_type/data_type_array.h"
#include "core/data_type/data_type_file.h"
#include "core/data_type/data_type_map.h"
#include "core/data_type/data_type_nullable.h"
#include "core/data_type/data_type_struct.h"
Expand Down Expand Up @@ -146,6 +148,15 @@ Status JniDataBridge::fill_column(TableMetaAddress& address, ColumnPtr& doris_co
case PrimitiveType::TYPE_STRUCT:
status = _fill_struct_column(address, data_column, data_type, num_rows);
break;
case PrimitiveType::TYPE_FILE: {
auto& file = assert_cast<ColumnFile&>(*data_column);
const auto& file_type = assert_cast<const DataTypeFile&>(*remove_nullable(data_type));
for (size_t i = 0; i < DataTypeFile::FIELD_COUNT && status.ok(); ++i) {
status = fill_column(address, file.get_column_ptr(i), file_type.get_element(i),
num_rows);
}
break;
}
case PrimitiveType::TYPE_VARBINARY:
status = _fill_varbinary_column(address, data_column, num_rows);
break;
Expand Down Expand Up @@ -297,6 +308,8 @@ std::string JniDataBridge::get_jni_type(const DataTypePtr& data_type) {
DataTypePtr type = remove_nullable(data_type);
std::ostringstream buffer;
switch (type->get_primitive_type()) {
case TYPE_FILE:
return "file";
case TYPE_BOOLEAN:
return "boolean";
case TYPE_TINYINT:
Expand Down Expand Up @@ -403,6 +416,8 @@ std::string JniDataBridge::get_jni_type_with_different_string(const DataTypePtr&
DataTypePtr type = remove_nullable(data_type);
std::ostringstream buffer;
switch (data_type->get_primitive_type()) {
case TYPE_FILE:
return "file";
case TYPE_BOOLEAN:
return "boolean";
case TYPE_TINYINT:
Expand Down Expand Up @@ -535,6 +550,8 @@ std::string JniDataBridge::encode_string_list(const std::vector<std::string>& va

std::string JniDataBridge::get_jni_type_with_encoded_struct_fields(const DataTypePtr& data_type) {
switch (data_type->get_primitive_type()) {
case TYPE_FILE:
return "file";
case TYPE_STRUCT: {
const auto* type_struct =
assert_cast<const DataTypeStruct*>(remove_nullable(data_type).get());
Expand Down Expand Up @@ -634,6 +651,15 @@ Status JniDataBridge::_fill_column_meta(const ColumnPtr& doris_column, const Dat
}
break;
}
case PrimitiveType::TYPE_FILE: {
const auto& file = assert_cast<const ColumnFile&>(*data_column);
const auto& file_type = assert_cast<const DataTypeFile&>(*remove_nullable(data_type));
for (size_t i = 0; i < DataTypeFile::FIELD_COUNT; ++i) {
RETURN_IF_ERROR(
_fill_column_meta(file.get_column_ptr(i), file_type.get_element(i), meta_data));
}
break;
}
case PrimitiveType::TYPE_MAP: {
const auto& map = assert_cast<const ColumnMap&>(*data_column);
const auto& key_type =
Expand Down
3 changes: 2 additions & 1 deletion be/src/format/jni/jni_data_bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ class JniDataBridge {

/**
* Convert a Doris DataType to its JNI type string representation.
* e.g., TYPE_INT -> "int", TYPE_DECIMAL128I -> "decimal128(p,s)"
* e.g., TYPE_INT -> "int", TYPE_DECIMAL128I -> "decimal128(p,s)", TYPE_FILE -> "file".
* FILE retains its logical type; both sides use the canonical six-child physical layout.
*/
static std::string get_jni_type(const DataTypePtr& data_type);

Expand Down
Loading
Loading