vlsi commented on PR #971:
URL: https://github.com/apache/calcite/pull/971#issuecomment-6341213057

   Thank you for the fix and for working through the review, @ijokarumawak, and 
sorry it never got merged.
   
   The `ClassCastException` was fixed on `main` by 33157f42f9 
([CALCITE-3512](https://issues.apache.org/jira/browse/CALCITE-3512), released 
in 1.22.0). `PhysTypeImpl.fieldReference` now keeps the field type for 
`java.sql.Time` and `java.sql.Timestamp` as well as `java.sql.Date`, and 
`EnumUtils.toInternal` converts them with `TIME_TO_INT` and 
`TIMESTAMP_TO_LONG`. I ran the queries from `ObjectArrayTableTest` against an 
`Object[]` table with `java.sql.Date`, `Time`, and `Timestamp` columns on 
current `main`: `extract`, the `=`, `>`, and `BETWEEN` filters, and `cast("ts" 
as TIMESTAMP(n))` for n from 0 to 3 all return the values the test expects. The 
JIRA's string comparison and `MIN`/`MAX` work too.
   
   The code this PR changes has since been moved and rewritten, so I'm closing 
it. I'll resolve CALCITE-1703 as fixed by CALCITE-3512. Two things I found 
while checking are filed separately: 
[CALCITE-7877](https://issues.apache.org/jira/browse/CALCITE-7877) 
(`EnumerableDefaults.asOrderedQueryable` throws `NullPointerException`, which 
the table in this PR's test uses) and 
[CALCITE-7878](https://issues.apache.org/jira/browse/CALCITE-7878) (a 
`java.sql.Timestamp` column is typed `TIMESTAMP(0)`, so `CAST` to `VARCHAR` 
drops the milliseconds that comparisons see; the `JavaType.getPrecision` change 
in this PR addressed that).
   


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

Reply via email to