morningman commented on code in PR #22347:
URL: https://github.com/apache/doris/pull/22347#discussion_r1282854944


##########
fe/fe-core/src/main/java/org/apache/doris/planner/external/HiveScanNode.java:
##########
@@ -104,10 +110,52 @@ protected void doInitialize() throws UserException {
         String inputFormat = 
hmsTable.getRemoteTable().getSd().getInputFormat();
         if (inputFormat.contains("TextInputFormat")) {
             for (SlotDescriptor slot : desc.getSlots()) {
-                if (slot.getType().isMapType() || 
slot.getType().isStructType()) {
+                if (slot.getType().isScalarType()) {
+                    continue;
+                }
+                boolean supported = true;
+
+                // support Array<primitive_type> and array<array<...>>
+                if (slot.getType().isArrayType()) {
+                    ArrayType arraySubType = (ArrayType) slot.getType();
+                    while (true) {
+                        if (arraySubType.getItemType().isArrayType()) {
+                            arraySubType = (ArrayType) 
arraySubType.getItemType();
+                            continue;
+                        }
+                        if (!arraySubType.getItemType().isScalarType()) {
+                            supported = false;
+                        }
+                        break;
+                    }
+                }
+
+                //support map<primitive_type,primitive_type>
+                if (slot.getType().isMapType()) {
+                    if (!((MapType) 
slot.getType()).getValueType().isScalarType()) {
+                        supported = false;
+                    }
+                }
+
+                //support Struct< primitive_type,primitive_type ... >
+                if (slot.getType().isStructType()) {

Review Comment:
   ```suggestion
                  else if (slot.getType().isStructType()) {
   ```



##########
be/src/exec/text_converter.cpp:
##########
@@ -62,12 +66,14 @@ void TextConverter::write_string_column(const 
SlotDescriptor* slot_desc,
     }
 }
 
-bool TextConverter::write_vec_column(const SlotDescriptor* slot_desc,
-                                     vectorized::IColumn* nullable_col_ptr, 
const char* data,
-                                     size_t len, bool copy_string, bool 
need_escape, size_t rows) {
+bool TextConverter::write_date(const TypeDescriptor& type_desc,

Review Comment:
   ```suggestion
   bool TextConverter::write_data(const TypeDescriptor& type_desc,
   ```



##########
be/src/vec/exec/format/csv/csv_reader.h:
##########
@@ -142,7 +142,12 @@ class CsvReader : public GenericReader {
 
     std::string _value_separator;
     std::string _line_delimiter;
-    std::string _array_delimiter;
+    //    std::string _array_delimiter;

Review Comment:
   delete it



##########
be/src/exec/text_converter.cpp:
##########
@@ -62,12 +66,14 @@ void TextConverter::write_string_column(const 
SlotDescriptor* slot_desc,
     }
 }
 
-bool TextConverter::write_vec_column(const SlotDescriptor* slot_desc,
-                                     vectorized::IColumn* nullable_col_ptr, 
const char* data,
-                                     size_t len, bool copy_string, bool 
need_escape, size_t rows) {
+bool TextConverter::write_date(const TypeDescriptor& type_desc,
+                               vectorized::IColumn* nullable_col_ptr, const 
char* data, size_t len,
+                               bool copy_string, bool need_escape, size_t rows,
+                               char array_delimiter) {
     vectorized::IColumn* col_ptr = nullable_col_ptr;
     // \N means it's NULL
-    if (slot_desc->is_nullable()) {
+    std::string col_type_name = col_ptr->get_name();
+    if (col_type_name.substr(0, 8) == "Nullable") {

Review Comment:
   Why change to this?



##########
fe/fe-core/src/main/java/org/apache/doris/planner/external/HiveScanNode.java:
##########
@@ -104,10 +110,52 @@ protected void doInitialize() throws UserException {
         String inputFormat = 
hmsTable.getRemoteTable().getSd().getInputFormat();
         if (inputFormat.contains("TextInputFormat")) {
             for (SlotDescriptor slot : desc.getSlots()) {
-                if (slot.getType().isMapType() || 
slot.getType().isStructType()) {
+                if (slot.getType().isScalarType()) {
+                    continue;
+                }
+                boolean supported = true;
+
+                // support Array<primitive_type> and array<array<...>>
+                if (slot.getType().isArrayType()) {
+                    ArrayType arraySubType = (ArrayType) slot.getType();
+                    while (true) {
+                        if (arraySubType.getItemType().isArrayType()) {
+                            arraySubType = (ArrayType) 
arraySubType.getItemType();
+                            continue;
+                        }
+                        if (!arraySubType.getItemType().isScalarType()) {
+                            supported = false;
+                        }
+                        break;
+                    }
+                }
+
+                //support map<primitive_type,primitive_type>
+                if (slot.getType().isMapType()) {

Review Comment:
   ```suggestion
                  else if (slot.getType().isMapType()) {
   ```



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to