drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Lee (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-4885) WHERE clause causing a ClassCastException on HBase tables
Date Fri, 16 Jun 2017 00:19:00 GMT

    [ https://issues.apache.org/jira/browse/DRILL-4885?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16051229#comment-16051229
] 

David Lee commented on DRILL-4885:
----------------------------------

I think there's a problem with casting table columns when the table is generated using functions..

ClassCastException: org.apache.drill.common.expression.FunctionCall cannot be cast to org.apache.drill.common.expression.SchemaPath

is happening for me in Drill 1.10 when executing the following:

select iv.Invoice.Invoice_Id, iv.Invoice
from
(select flatten(a.TodaysInvoices.Invoice) as Invoice
from dfs.`/tmp/Invoices_20170605` a
) iv
where iv.Invoice.Invoice_Id = 'ABC123'

However, the following runs fine if I add a limit on the inner subquery which probably forces
the inner query to materialize a table first.

select iv.Invoice.Invoice_Id, iv.Invoice
from
(select flatten(a.Invoices.Invoice) as Invoice
from dfs.`/tmp/Invoices_20170605` a limit 10
) iv
where iv.Invoice.Invoice_Id = 'ABC123'


> WHERE clause causing a ClassCastException on HBase tables
> ---------------------------------------------------------
>
>                 Key: DRILL-4885
>                 URL: https://issues.apache.org/jira/browse/DRILL-4885
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.5.0
>            Reporter: Ki Kang
>
> I am trying to figure out why I am getting a ClassCastException when I do the following
query.  If I change the “FROM” clause to just “FROM (VALUES(0))” it works just fine,
but whenever I have “FROM” to an HBase table, I get the error.  I know that the HBase
table is valid because if I remove the WHERE clause, the query does not throw an error.
> SELECT b.`date` FROM (
>   SELECT TO_DATE(CONCAT(a.`jArray`[0], '-', a.`jArray`[1], '-', a.`jArray`[2]), 'yyyy-MM-dd')
`date` FROM (
>     SELECT CONVERT_FROM(REGEXP_REPLACE('["2016":"08":"03"]', ':', ','), 'JSON') `jArray`
>     --FROM (VALUES(0))
>     FROM `hbase`.`SomeValidTable`
>   ) a
> ) b
> WHERE b.`date` = '2016-08-03'
> LIMIT 1
> SYSTEM ERROR: ClassCastException: org.apache.drill.common.expression.FunctionCall cannot
be cast to org.apache.drill.common.expression.SchemaPath
> <<copy/paste from a email response from Rahul>>
> From: rahul challapalli <challapallirahul@gmail.com>
> Date: Thu, Sep 1, 2016 at 11:09 AM
> Subject: Re: WHERE clause causing a ClassCastException on HBase tables
> To: dev <dev@drill.apache.org>
> This is a bug. The query is failing at the planning state itself. Can you raise a jira
for the same with the details you posted here?
> - Rahul



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message