dongjoon-hyun commented on code in PR #2622:
URL: https://github.com/apache/orc/pull/2622#discussion_r3243452532


##########
c++/src/ColumnReader.cc:
##########
@@ -694,17 +698,32 @@ namespace orc {
   size_t StringDirectColumnReader::computeSize(const int64_t* lengths, const 
char* notNull,
                                                uint64_t numValues) {
     size_t totalLength = 0;
+    bool hasNegativeLength = false;
+    bool hasLengthOverflow = false;
+    auto addLength = [&](int64_t value) {
+      hasNegativeLength |= value < 0;
+      size_t length = static_cast<size_t>(value);
+      size_t nextTotalLength = totalLength + length;
+      hasLengthOverflow |= nextTotalLength < totalLength;

Review Comment:
   Like `skip()` method, shall we throw here instead of waiting for the whole 
loop is finished?



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