You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@doris.apache.org by GitBox <gi...@apache.org> on 2019/08/14 02:53:57 UTC

[GitHub] [incubator-doris] imay commented on a change in pull request #1635: Enable parsing columns from file path for Broker Load (#1582)

imay commented on a change in pull request #1635: Enable parsing columns from file path for Broker Load (#1582)
URL: https://github.com/apache/incubator-doris/pull/1635#discussion_r313686877
 
 

 ##########
 File path: be/src/exec/parquet_reader.cpp
 ##########
 @@ -396,6 +412,35 @@ Status ParquetReaderWrap::read(Tuple* tuple, const std::vector<SlotDescriptor*>&
                     }
                     break;
                 }
+                case arrow::Type::type::DATE32: {
+                    auto ts_array = std::dynamic_pointer_cast<arrow::Date32Array>(_batch->column(column_index));
+                    if (ts_array->IsNull(_current_line_of_group)) {
+                        RETURN_IF_ERROR(set_field_null(tuple, slot_desc));
+                    } else {
+                        time_t timestamp = (time_t)((int64_t)ts_array->Value(_current_line_of_group) * 24 * 60 * 60);
+                        tm* local;
+                        local = localtime(&timestamp);
 
 Review comment:
   use localtime_r which is thread-safe

----------------------------------------------------------------
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: dev-unsubscribe@doris.apache.org
For additional commands, e-mail: dev-help@doris.apache.org