maropu commented on a change in pull request #26680: [SPARK-30047][SQL]
HashAggregate support for interval value aggs
URL: https://github.com/apache/spark/pull/26680#discussion_r351030061
##########
File path:
sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/codegen/UnsafeWriter.java
##########
@@ -134,15 +135,20 @@ public final void write(int ordinal, CalendarInterval
input) {
// grow the global buffer before writing data.
grow(16);
- // Write the months, days and microseconds fields of Interval to the
variable length portion.
- Platform.putInt(getBuffer(), cursor(), input.months);
- Platform.putInt(getBuffer(), cursor() + 4, input.days);
- Platform.putLong(getBuffer(), cursor() + 8, input.microseconds);
-
- setOffsetAndSize(ordinal, 16);
+ if (input == null) {
+ BitSetMethods.set(getBuffer(), startingOffset, ordinal);
+ setOffsetAndSize(ordinal, 0);
+ } else {
+ // Write the months, days and microseconds fields of Interval to the
variable length portion.
+ Platform.putInt(getBuffer(), cursor(), input.months);
+ Platform.putInt(getBuffer(), cursor() + 4, input.days);
+ Platform.putLong(getBuffer(), cursor() + 8, input.microseconds);
+ setOffsetAndSize(ordinal, 16);
+ }
// move the cursor forward.
increaseCursor(16);
+
Review comment:
nit: remove this blank
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]