You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2019/11/07 03:22:31 UTC

[GitHub] [incubator-doris] imay commented on a change in pull request #2139: Add null bit verification for row_batch transformation

imay commented on a change in pull request #2139: Add null bit verification for row_batch transformation
URL: https://github.com/apache/incubator-doris/pull/2139#discussion_r343461424
 
 

 ##########
 File path: be/src/util/arrow/row_batch.cpp
 ##########
 @@ -211,47 +211,52 @@ class FromRowBatchConverter : public arrow::TypeVisitor {
         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 == nullptr) {
-                        ARROW_RETURN_NOT_OK(builder.AppendNull());
-                    } else {
-                        if (string_val->len == 0) {
-                            // 0x01 is a magic num, not usefull actually, just for present ""
-                            //char* tmp_val = reinterpret_cast<char*>(0x01);
-                            ARROW_RETURN_NOT_OK(builder.Append(""));        
+            bool is_null = _cur_slot_ref->is_null_bit_set(_batch.get_row(i));
+            if (is_null) {
+                ARROW_RETURN_NOT_OK(builder.AppendNull());
 
 Review comment:
   ```suggestion
                   ARROW_RETURN_NOT_OK(builder.AppendNull());
                   continue;
   ```
   then you can remove` else {`

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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