[
https://issues.apache.org/jira/browse/DRILL-5001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15937329#comment-15937329
]
Rahul Challapalli commented on DRILL-5001:
------------------------------------------
A slightly modified example where drill thinks the left side is a varchar
instead of a date
{code}
select
a.int_col, b.date_col
from
dfs.`/drill/testdata/parquet_date/metadata_cache/mixed/fewtypes_null_large` a
inner join (
select dir0, int_col, date_col from
dfs.`/drill/testdata/parquet_date/metadata_cache/mixed/fewtypes_null_large`
where dir0 = '1.2'
) b
on a.date_col = b.date_col
where a.int_col = 7 and a.dir0='1.9' group by a.int_col, b.date_col;
Error: SYSTEM ERROR: DrillRuntimeException: Join only supports implicit casts
between 1. Numeric data
2. Varchar, Varbinary data 3. Date, Timestamp data Left type: DATE, Right
type: VARCHAR. Add explicit casts to avoid this error
Fragment 2:1
[Error Id: 1245be35-04ed-4bcd-a5af-6242b033dc40 on qa-node182.qa.lab:31010]
(state=,code=0)
{code}
> Join only supports implicit casts error even when I have explicit cast
> ----------------------------------------------------------------------
>
> Key: DRILL-5001
> URL: https://issues.apache.org/jira/browse/DRILL-5001
> Project: Apache Drill
> Issue Type: Bug
> Components: Query Planning & Optimization
> Reporter: Rahul Challapalli
> Attachments: error.log, fewtypes_null_large.tgz
>
>
> git.commit.id.abbrev=190d5d4
> The below query fails even when I had an explicit cast on the right hand side
> of the join condition. The data also contains a metadata cache
> {code}
> select
> a.int_col,
> b.date_col
> from
> dfs. `/ drill / testdata / parquet_date / metadata_cache / mixed /
> fewtypes_null_large ` a
> inner join
> (
> select
> *
> from
> dfs. `/ drill / testdata / parquet_date / metadata_cache / mixed /
> fewtypes_null_large `
> where
> dir0 = '1.2'
> and date_col > '1996-03-07'
> )
> b
> on a.date_col = cast(date_add(b.date_col, 5) as date)
> where
> a.int_col = 7
> and a.dir0 = '1.9'
> group by
> a.int_col,
> b.date_col;
> Error: SYSTEM ERROR: DrillRuntimeException: Join only supports implicit casts
> between 1. Numeric data
> 2. Varchar, Varbinary data 3. Date, Timestamp data Left type: DATE, Right
> type: VARCHAR. Add explicit casts to avoid this error
> Fragment 2:0
> [Error Id: a1b26420-af35-4892-9a87-d9b04e4423dc on qa-node190.qa.lab:31010]
> (state=,code=0)
> {code}
> I attached the data and the log file.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)