kbendick commented on a change in pull request #1636:
URL: https://github.com/apache/iceberg/pull/1636#discussion_r508113404



##########
File path: 
flink/src/main/java/org/apache/iceberg/flink/data/FlinkOrcWriters.java
##########
@@ -245,8 +245,19 @@ public void nonNullWrite(int rowId, ArrayData data, 
ColumnVector output) {
       ListColumnVector cv = (ListColumnVector) output;
       cv.lengths[rowId] = data.size();
       cv.offsets[rowId] = cv.childCount;
-      cv.childCount += cv.lengths[rowId];
+      // cv.childCount is for some reason an int, which generates all of these
+      // NarrowingCompoundAssignment warnings. Although this does nothing to 
prevent
+      // overflow from adding too many values to cv.childCount because 
`ListColumnVector`
+      // comes from package `org.apache.orc.storage.ql.exec.vector`, it at 
least removes
+      // the warning message. Whether that's preferred or not, I don't know as 
the
+      // issue still very much remains.
+      // This new statement is equivalent to the old, but because it's adding 
an int vs adding
+      // the int after the it has been cast to long when assigned to 
`cv.lengths[rowId]`,
+      // the narrowing compound assignment warning is gone. This could be 
added to any other
+      // occurrences of this same warning.
+      cv.childCount += data.size();
       // make sure the child is big enough.
+      // TODO - Would ensuring the child is big enough before adding to it 
help to suss out when this overflow happens?

Review comment:
       I see now that it doesn't. This is just ensuring the buffer is large 
enough to write all of the data to it.
   
   I'd push a change to remove these TODOs but I don't want to trigger CI 
unnecessarily during the work day.




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



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

Reply via email to