You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SPARK-52699][SQL] Support aggregating TIME type in interpreted mode
### What changes were proposed in this pull request?
Update `InternalRow#getWriter` to return the correct writer for the TIME type.
### Why are the changes needed?
Without this PR, aggregating the TIME type in interpreted mode fails. Consider the below query:
```
set spark.sql.codegen.factoryMode=NO_CODEGEN;
create or replace temp view v1(col1) as values
(time'22:33:01'),
(time'01:33:01'),
(null);
select max(col1), min(col1) from v1;
```
Without this change, the query fails with the following error:
```
Exception in task 0.0 in stage 0.0 (TID 0)
org.apache.spark.SparkUnsupportedOperationException: [UNSUPPORTED_CALL.WITHOUT_SUGGESTION] Cannot call the method "update" of the class "org.apache.spark.sql.catalyst.expressions.UnsafeRow". SQLSTATE: 0A000
at org.apache.spark.SparkUnsupportedOperationException$.apply(SparkException.scala:266) ~[spark-common-utils_2.13-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT]
```
### Does this PR introduce _any_ user-facing change?
No. The TIME type is not released yet.
### How was this patch tested?
Updated unit test.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closesapache#51395 from bersprockets/time_get_writer.
Authored-by: Bruce Robbins <bersprockets@gmail.com>
Signed-off-by: Max Gekk <max.gekk@gmail.com>
0 commit comments