This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 00573b1e0296248d557e1a74ead6189664fc7483
Author: Ashin Gau <[email protected]>
AuthorDate: Mon Dec 19 14:24:12 2022 +0800

    [fix](multi-catalog) add support for orc binary type (#15141)
    
    Fix three bugs:
    1. DataTypeFactory::create_data_type is missing the conversion of binary 
type, and OrcReader will failed
    2. ScalarType#createType is missing the conversion of binary type, and 
ExternalFileTableValuedFunction will failed
    3. fmt::format can't generate right format string, and will be failed
---
 be/src/vec/data_types/data_type_factory.cpp                      | 1 +
 be/src/vec/exec/format/orc/vorc_reader.cpp                       | 2 +-
 be/src/vec/exec/scan/vfile_scanner.cpp                           | 9 ++++-----
 .../src/main/java/org/apache/doris/catalog/ScalarType.java       | 2 ++
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/be/src/vec/data_types/data_type_factory.cpp 
b/be/src/vec/data_types/data_type_factory.cpp
index 1d6f89b467..85dfc445ba 100644
--- a/be/src/vec/data_types/data_type_factory.cpp
+++ b/be/src/vec/data_types/data_type_factory.cpp
@@ -98,6 +98,7 @@ DataTypePtr DataTypeFactory::create_data_type(const 
TypeDescriptor& col_desc, bo
     case TYPE_STRING:
     case TYPE_CHAR:
     case TYPE_VARCHAR:
+    case TYPE_BINARY:
         nested = std::make_shared<vectorized::DataTypeString>();
         break;
     case TYPE_JSONB:
diff --git a/be/src/vec/exec/format/orc/vorc_reader.cpp 
b/be/src/vec/exec/format/orc/vorc_reader.cpp
index 538f91e732..4998bc2486 100644
--- a/be/src/vec/exec/format/orc/vorc_reader.cpp
+++ b/be/src/vec/exec/format/orc/vorc_reader.cpp
@@ -529,7 +529,7 @@ TypeDescriptor OrcReader::_convert_to_doris_type(const 
orc::Type* orc_type) {
     case orc::TypeKind::STRING:
         return TypeDescriptor(PrimitiveType::TYPE_STRING);
     case orc::TypeKind::BINARY:
-        return TypeDescriptor(PrimitiveType::TYPE_BINARY);
+        return TypeDescriptor(PrimitiveType::TYPE_STRING);
     case orc::TypeKind::TIMESTAMP:
         return TypeDescriptor(PrimitiveType::TYPE_DATETIMEV2);
     case orc::TypeKind::DECIMAL:
diff --git a/be/src/vec/exec/scan/vfile_scanner.cpp 
b/be/src/vec/exec/scan/vfile_scanner.cpp
index 60815a5236..8599029cf3 100644
--- a/be/src/vec/exec/scan/vfile_scanner.cpp
+++ b/be/src/vec/exec/scan/vfile_scanner.cpp
@@ -209,11 +209,10 @@ Status VFileScanner::_init_src_block(Block* block) {
             data_type = 
DataTypeFactory::instance().create_data_type(it->second, true);
         }
         if (data_type == nullptr) {
-            return Status::NotSupported(
-                    fmt::format("Not support data type:{} for column: {}",
-                                (it == _name_to_col_type.end() ? 
slot->type().debug_string()
-                                                               : 
it->second.debug_string()),
-                                slot->col_name()));
+            return Status::NotSupported("Not support data type {} for column 
{}",
+                                        it == _name_to_col_type.end() ? 
slot->type().debug_string()
+                                                                      : 
it->second.debug_string(),
+                                        slot->col_name());
         }
         MutableColumnPtr data_column = data_type->create_column();
         _src_block.insert(
diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/ScalarType.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/ScalarType.java
index 08c5659bad..e97471f73d 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/ScalarType.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/ScalarType.java
@@ -160,6 +160,8 @@ public class ScalarType extends Type {
                 return CHAR;
             case VARCHAR:
                 return createVarcharType();
+            case BINARY:
+                return createStringType();
             case JSONB:
                 return createJsonbType();
             case STRING:


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to