You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by Ki Kang <Ki...@ds-iq.com> on 2016/08/31 23:35:43 UTC

WHERE clause causing a ClassCastException on HBase tables

Can someone help or point me to where I can maybe get some help?

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



Re: WHERE clause causing a ClassCastException on HBase tables

Posted by rahul challapalli <ch...@gmail.com>.
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

On Thu, Sep 1, 2016 at 2:03 AM, Khurram Faraaz <kf...@maprtech.com> wrote:

> What is your Drill version and HBase version ?
>
> On Thu, Sep 1, 2016 at 5:05 AM, Ki Kang <Ki...@ds-iq.com> wrote:
>
> > Can someone help or point me to where I can maybe get some help?
> >
> > 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
> >
> >
> >
>

Re: WHERE clause causing a ClassCastException on HBase tables

Posted by Khurram Faraaz <kf...@maprtech.com>.
What is your Drill version and HBase version ?

On Thu, Sep 1, 2016 at 5:05 AM, Ki Kang <Ki...@ds-iq.com> wrote:

> Can someone help or point me to where I can maybe get some help?
>
> 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
>
>
>