[ 
https://issues.apache.org/jira/browse/CALCITE-6641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mihai Budiu resolved CALCITE-6641.
----------------------------------
    Fix Version/s: 1.39.0
       Resolution: Fixed

Fixed in 
[https://github.com/apache/calcite/commit/5b4f32aee52c33d40669314b137ace36f13f9e85]

Thank you for the reviews [~nobigo] and [~caican] 

> Compiling programs with ASOF joins can report obscure errors
> ------------------------------------------------------------
>
>                 Key: CALCITE-6641
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6641
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.38.0
>            Reporter: Mihai Budiu
>            Assignee: Mihai Budiu
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.39.0
>
>
> A program like the following:
> {code:sql}
> SELECT * 
> FROM B
> LEFT ASOF JOIN S
> MATCH_CONDITION B.p_time >= S.date_time
> ON B.mod = S.key
> {code}
> can report an error such as:
> {code}
> Error in SQL statement: ASOF JOIN condition must be a conjunction of equality 
> comparisons
> ON B.mod = S.key;
>    ^^^^^^^^^^^^^
> {code}
> This looks like a conjunction of equality comparisons, so the error is very 
> strange; internally the program represents this expression as (CAST B.mod as 
> BIGINT) = S.key.
> This situation should be improved by either 
> - giving an error message that explains why the compiler does not like this 
> expression, or, better, 
> - having the ASOF join actually accept expressions that involve casts.
> This is yet another problem caused by the new TypeCoercion improvements. When 
> the ASOF join was merged there were no casts at this point in the validation. 
> As was discussed briefly in [CALCITE-6639], the ASOF joins look rather 
> brittle.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to