imay commented on a change in pull request #2013: Add arrow IPC serialization 
for Doris-Spark-Connector
URL: https://github.com/apache/incubator-doris/pull/2013#discussion_r339507588
 
 

 ##########
 File path: be/src/util/arrow/row_batch.cpp
 ##########
 @@ -172,6 +201,98 @@ class FromRowBatchConverter : public arrow::TypeVisitor {
 
 #undef PRIMITIVE_VISIT
 
+    // process string-transformable field
+    arrow::Status Visit(const arrow::StringType& type) override {
+        arrow::StringBuilder builder(_pool);
+        size_t num_rows = _batch.num_rows();
+        builder.Reserve(num_rows);
+        for (size_t i = 0; i < num_rows; ++i) {
+            auto cell_ptr = _cur_slot_ref->get_slot(_batch.get_row(i));
+            PrimitiveType primitive_type = _cur_slot_ref->type().type;
+            switch (primitive_type) {
+                case TYPE_VARCHAR:
+                case TYPE_CHAR:
+                case TYPE_HLL: {
+                    const StringValue* string_val = (const 
StringValue*)(cell_ptr);
+                    if (string_val->ptr == NULL) {
 
 Review comment:
   string_val == nullptr means it is null. If string_val is not nullptr, this 
is a normal binary, there is no need to check whether or not string_val-> ptr 
is null.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to