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

Will Du updated CALCITE-6840:
-----------------------------
    Description: 
I register Azure SQL and Druid schema using the jdbc client to join Azure table 
a with Druid table b as follows.
```
with base as (
select
concat(name, entity, pid) as join_key, * from a
)
select
base.*, b.vaue
from base left join b on a.join_key = b.join_key
```
1. When the join_key length > 30, the join is unsuccessful (b.value is empty) 
even if the join key is matched.
2. It always works if I use a hardcoded matched string as join_key.
3. if I add cast before join, such as cast(a.join_key as varchar(500)) = 
b.join_key, it is working
4. When the join_key is <= 30, it is working.
5. The join_key is displayed without issues no matter the length. It only 
impacts the join result.
6. Column type in azure SQL is all varchar(100), while one in Druid are string.

Pls. investigate and try to reproduce the issue, Lex=Java, Fun=standard,mssql



  was:
I register Azure SQL and Druid schema using the jdbc client to join Azure table 
a with Druid table b as follows.
```
with base as (
select
concat(name, entity, pid) as join_key, * from a
)
select
base.*, b.vaue
from base left join b on a.join_key = b.join_key
```
1. When the join_key length > 30, the join is unsuccessful (b.value is empty) 
even if the join key is matched.
2. It always works if I use a hardcoded matched string as join_key.
3. if I add cast before join, such as cast(a.join_key as varchar(500)) = 
b.join_key, it is working
4. When the join_key is <= 30, it is working.
5. The join_key is displayed without issues no matter the length. It only 
impacts the join result.

Pls. investigate and try to reproduce the issue, Lex=Java, Fun=standard,mssql




> Join column seems got truncated during join
> -------------------------------------------
>
>                 Key: CALCITE-6840
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6840
>             Project: Calcite
>          Issue Type: Bug
>          Components: avatica, jdbc-adapter, jdbc-driver
>    Affects Versions: 1.38.0
>            Reporter: Will Du
>            Priority: Major
>
> I register Azure SQL and Druid schema using the jdbc client to join Azure 
> table a with Druid table b as follows.
> ```
> with base as (
> select
> concat(name, entity, pid) as join_key, * from a
> )
> select
> base.*, b.vaue
> from base left join b on a.join_key = b.join_key
> ```
> 1. When the join_key length > 30, the join is unsuccessful (b.value is empty) 
> even if the join key is matched.
> 2. It always works if I use a hardcoded matched string as join_key.
> 3. if I add cast before join, such as cast(a.join_key as varchar(500)) = 
> b.join_key, it is working
> 4. When the join_key is <= 30, it is working.
> 5. The join_key is displayed without issues no matter the length. It only 
> impacts the join result.
> 6. Column type in azure SQL is all varchar(100), while one in Druid are 
> string.
> Pls. investigate and try to reproduce the issue, Lex=Java, Fun=standard,mssql



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

Reply via email to