You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Jimmy Cooksey (Jira)" <ji...@apache.org> on 2020/09/30 15:28:00 UTC

[jira] [Comment Edited] (DRILL-4885) WHERE clause causing a ClassCastException on HBase tables

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

Jimmy Cooksey edited comment on DRILL-4885 at 9/30/20, 3:27 PM:
----------------------------------------------------------------

Other than using LIMIT, did anyone find a workaround for this?

I am using CONVERT_FROM to parse some JSON that's inside a parquet file.

Drill version is 1.17.0.
{quote}{color:#172b4d}{{SELECT }}{{t1.j.user_name AS user_name, }}{{t1.j.country_name AS country_name, }}{{t1.j.city_name AS city_name}}{{ }}{{FROM }}{{(SELECT CONVERT_FROM(`json_data`, 'json') AS j }}{{FROM az.`users/`) AS t1}}{color}
{{{color:#172b4d}WHERE t1.j.city_name = 'Houston';{color} }}

{color:#FF0000}{{Error: SYSTEM ERROR: ClassCastException: org.apache.drill.common.expression.FunctionCall cannot be cast to org.apache.drill.common.expression.SchemaPath}}{color}
{color:#FF0000}{{Please, refer to logs for more information.}}{{[Error Id: 26ef6472-3d71-4d47-8ba9-b07bdb8e70c7 on jump-server.internal.cloudapp.net:31010] (state=,code=0)}}{color}
{quote}
Adding a LIMIT expression makes the error go away.
{quote}{color:#172b4d}{{SELECT t1.j.user_name AS user_name, }}{{t1.j.country_name AS country_name, }}{{t1.j.city_name AS city_name }}{{FROM }}{{(SELECT CONVERT_FROM(`json_data`, 'json') AS j }}{{FROM az.`users/` {color:#57d9a3}*LIMIT 1*{color}) AS t1}}{color}
{{{color:#172b4d}WHERE t1.j.city_name = 'Houston';{color} }}

{color:#FF0000}{{+-----------+---------------+-----------+}}
{{| user_name | country_name  | city_name |}}
{{+-----------+---------------+-----------+}}
{{| Dorothy   | United States | Houston   |}}
{{+-----------+---------------+-----------+}}
{color}
{quote}
 

 


was (Author: jcooksey):
Other than using LIMIT, did anyone find a workaround for this?

I am using CONVERT_FROM to parse some JSON that's inside a parquet file.

Drill version is 1.17.0.
{quote}{color:#172b4d}{{SELECT }}{{t1.j.user_name AS user_name, }}{{t1.j.country_name AS country_name, }}{{t1.j.city_name AS city_name}}{{ }}{{FROM }}{{(SELECT CONVERT_FROM(`json_data`, 'json') AS j }}{{FROM az.`users/`) AS t1}}{color}
{{{color:#172b4d}WHERE t1.j.city_name = 'Houston';{color} }}

{color:#FF0000}{{Error: SYSTEM ERROR: ClassCastException: org.apache.drill.common.expression.FunctionCall cannot be cast to org.apache.drill.common.expression.SchemaPath}}{color}
{color:#FF0000}{{Please, refer to logs for more information.}}{{[Error Id: 26ef6472-3d71-4d47-8ba9-b07bdb8e70c7 on jump-server.internal.cloudapp.net:31010] (state=,code=0)}}{color}
{quote}
Adding a LIMIT expression makes the error go away.
{quote}{color:#172b4d}{{SELECT t1.j.user_name AS user_name, }}{{t1.j.country_name AS country_name, }}{{t1.j.city_name AS city_name }}{{FROM }}{{(SELECT CONVERT_FROM(`json_data`, 'json') AS j }}{{FROM az.`users/` {color:#57d9a3}*LIMIT 1*{color}) AS t1}}{color}
{{{color:#172b4d}WHERE t1.j.city_name = 'Houston';{color} }}

{{}}{color:#FF0000}{{+-----------+---------------+-----------+}}
{{| user_name | country_name  | city_name |}}
{{+-----------+---------------+-----------+}}
{{| Dorothy   | United States | Houston   |}}
{{+-----------+---------------+-----------+}}
{color}
{quote}
 

 

> 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
>            Priority: Major
>
> 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 <ch...@gmail.com>
> Date: Thu, Sep 1, 2016 at 11:09 AM
> Subject: Re: WHERE clause causing a ClassCastException on HBase tables
> To: dev <de...@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
(v8.3.4#803005)