kiszk commented on a change in pull request #28406:
URL: https://github.com/apache/spark/pull/28406#discussion_r417434223
##########
File path:
sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedPlainValuesReader.java
##########
@@ -96,6 +124,33 @@ public final void readLongs(int total, WritableColumnVector
c, int rowId) {
}
}
+ // A fork of `readLongs` to rebase the timestamp values. For performance
reasons, this method
+ // iterates the values twice: check if we need to rebase first, then go to
the optimized branch
+ // if rebase is not needed.
+ @Override
+ public final void readLongsWithRebase(int total, WritableColumnVector c, int
rowId) {
+ int requiredBytes = total * 8;
+ ByteBuffer buffer = getBuffer(requiredBytes);
+ boolean rebase = false;
+ for (int i = 0; i < total; i += 1) {
+ rebase = buffer.getLong(buffer.position() + i * 8) <
RebaseDateTime.lastSwitchJulianTs();
Review comment:
While I have not understood this logic yet, this code sees the result
only at the last iteration.
May it be `rebase |= ...` or something?
----------------------------------------------------------------
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]