kiszk commented on a change in pull request #28406:
URL: https://github.com/apache/spark/pull/28406#discussion_r417437507
##########
File path:
sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedPlainValuesReader.java
##########
@@ -81,6 +82,33 @@ public final void readIntegers(int total,
WritableColumnVector c, int rowId) {
}
}
+ // A fork of `readIntegers` to rebase the date 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 readIntegersWithRebase(int total, WritableColumnVector c,
int rowId) {
+ int requiredBytes = total * 4;
+ ByteBuffer buffer = getBuffer(requiredBytes);
+ boolean rebase = false;
+ for (int i = 0; i < total; i += 1) {
+ rebase = buffer.getInt(buffer.position() + i * 4) <
RebaseDateTime.lastSwitchJulianDay();
Review comment:
same as at line 136.
----------------------------------------------------------------
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]