zhangweilst commented on code in PR #373:
URL: https://github.com/apache/paimon-cpp/pull/373#discussion_r4119665955


##########
src/paimon/common/data/columnar/columnar_utils.h:
##########
@@ -73,13 +73,15 @@ class ColumnarUtils {
                 dict_index = indices->Value(pos);
             }
             assert(dict_index >= 0);
-            if (value_type_id == arrow::Type::type::STRING) {
+            if (value_type_id == arrow::Type::type::STRING ||
+                value_type_id == arrow::Type::type::BINARY) {
                 auto dictionary =
-                    
checked_cast<arrow::StringArray*>(typed_array->dictionary().get());
+                    
checked_cast<arrow::BinaryArray*>(typed_array->dictionary().get());
                 return dictionary->GetView(dict_index);
-            } else if (value_type_id == arrow::Type::type::LARGE_STRING) {
+            } else if (value_type_id == arrow::Type::type::LARGE_STRING ||
+                       value_type_id == arrow::Type::type::LARGE_BINARY) {
                 auto dictionary =
-                    
checked_cast<arrow::LargeStringArray*>(typed_array->dictionary().get());
+                    
checked_cast<arrow::LargeBinaryArray*>(typed_array->dictionary().get());
                 return dictionary->GetView(dict_index);

Review Comment:
   By definition, arrow dictionary can have both index and dictionary slot be 
null, and both resulting a null value. But the common practice (like in 
parquet) represents null values as null indices. Considering dropping the 
second check to have the consistent behavior. Thanks.
   
   Also I believe you meant `GetLiteralFromDictionaryArray` in 
`iteral_converter.h` instead of the codes here :)



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

Reply via email to