[ 
https://issues.apache.org/jira/browse/BEAM-9379?focusedWorklogId=579515&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-579515
 ]

ASF GitHub Bot logged work on BEAM-9379:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/Apr/21 19:55
            Start Date: 08/Apr/21 19:55
    Worklog Time Spent: 10m 
      Work Description: apilloud commented on a change in pull request #13930:
URL: https://github.com/apache/beam/pull/13930#discussion_r610051846



##########
File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/BeamCalcRel.java
##########
@@ -375,7 +374,7 @@ private static Expression castOutputTime(Expression value, 
FieldType toType) {
       // Convert TIME to LocalTime
       if (value.getType() == java.sql.Time.class) {
         valueDateTime = Expressions.call(BuiltInMethod.TIME_TO_INT.method, 
valueDateTime);
-      } else if (value.getType() == Long.class) {
+      } else if (value.getType() == Integer.class || value.getType() == 
Long.class) {

Review comment:
       The internal type is actually suppose to be int. We've been passing 
Calcite a Long instead and the compiler just happily upconverts when doing math 
between the two types. We are still doing math somewhere (window functions?) 
that turns this into a Long sometimes. I think even before this change we were 
at risk of receiving a Integer here. (In the next CL I'm switching this to the 
java Number interface so we are permissive on outputs.)
   
https://github.com/apache/calcite-avatica/blob/89e0deb510311b85b8c8bacde6d2ff70c309930e/core/src/main/java/org/apache/calcite/avatica/SqlType.java#L306




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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 579515)
    Time Spent: 11h 40m  (was: 11.5h)

> Upgrade to Calcite 1.26.0
> -------------------------
>
>                 Key: BEAM-9379
>                 URL: https://issues.apache.org/jira/browse/BEAM-9379
>             Project: Beam
>          Issue Type: Task
>          Components: dsl-sql
>            Reporter: Rui Wang
>            Assignee: Andrew Pilloud
>            Priority: P2
>          Time Spent: 11h 40m
>  Remaining Estimate: 0h
>
> Upgrade to Calcite 1.22.0 after it gets released (expected by end of Feb 
> 2020).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to