bersprockets opened a new pull request, #36312:
URL: https://github.com/apache/spark/pull/36312

   ### What changes were proposed in this pull request?
   
   Change `TruncInstant.evalHelper` to pass the input row to `format.eval` when 
`format` is a not a literal (and therefore might be a bound reference).
   
   ### Why are the changes needed?
   
   This query fails with a `java.lang.NullPointerException`:
   ```
   select date_trunc(col1, col2)
   from values
   ('week', timestamp'2012-01-01')
   as data(col1, col2);
   ```
   This only happens if the data comes from an inline table. When the source is 
an inline table, `ConvertToLocalRelation` attempts to evaluate the function 
against the data in interpreted mode.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Update to unit tests.
   


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

To unsubscribe, e-mail: [email protected]

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