[ 
https://issues.apache.org/jira/browse/ORC-443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16705120#comment-16705120
 ] 

ASF GitHub Bot commented on ORC-443:
------------------------------------

wgtmac commented on a change in pull request #344: ORC-443: [C++] Code 
improvements in ColumnWriter.
URL: https://github.com/apache/orc/pull/344#discussion_r237956620
 
 

 ##########
 File path: c++/src/ColumnWriter.cc
 ##########
 @@ -1477,22 +1508,25 @@ namespace orc {
   void Decimal64ColumnWriter::add(ColumnVectorBatch& rowBatch,
                                   uint64_t offset,
                                   uint64_t numValues) {
-    ColumnWriter::add(rowBatch, offset, numValues);
     const Decimal64VectorBatch* decBatch =
       dynamic_cast<const Decimal64VectorBatch*>(&rowBatch);
     if (decBatch == nullptr) {
       throw InvalidArgument("Failed to cast to Decimal64VectorBatch");
     }
 
-    const char* notNull = decBatch->hasNulls ?
-                          decBatch->notNull.data() + offset : nullptr;
-    const int64_t* values = decBatch->values.data() + offset;
     DecimalColumnStatisticsImpl* decStats =
-      dynamic_cast<DecimalColumnStatisticsImpl*>(colIndexStatistics.get());
+        dynamic_cast<DecimalColumnStatisticsImpl*>(colIndexStatistics.get());
 
 Review comment:
   same here and below

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> [C++] Code improvements in ColumnWriter
> ---------------------------------------
>
>                 Key: ORC-443
>                 URL: https://issues.apache.org/jira/browse/ORC-443
>             Project: ORC
>          Issue Type: Improvement
>          Components: C++
>            Reporter: Fang Zheng
>            Priority: Minor
>
> A few changes to ColumnWriter and its derived classes:
> 1. in add() function, re-order code to verify input parameters before 
> modifying any internal state.
> 2. in add() function, move the calls to colIndexStatistics->increase(1) out 
> of the loop. Many of those are virtual function calls.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to