None of the three worked 

apache drill (hive.default)> use hive.`default`;
+------+------------------------------------------+
|  ok  |                 summary                  |
+------+------------------------------------------+
| true | Default schema changed to [hive.default] |
+------+------------------------------------------+
1 row selected (0.086 seconds)
apache drill (hive.default)> select * from test;
Error: VALIDATION ERROR: From line 1, column 15 to line 1, column 18: Object 
'test' not found


[Error Id: f4154d1a-59c3-4204-8186-67dcfaddf401 ] (state=,code=0)
apache drill (hive.default)>
apache drill (hive.default)>
apache drill (hive.default)> !q
Closing: org.apache.drill.jdbc.impl.DrillConnectionImpl
[root@hadoop1 bin]# sqlline -u jdbc:drill:zk=hadoop1:2181
Apache Drill 1.16.0
"Think different, think Drill."
apache drill> select * from hive.`test`;
Error: VALIDATION ERROR: From line 1, column 15 to line 1, column 18: Object 
'test' not found within 'hive'


[Error Id: 65a8acce-19b4-47f3-babb-ca1dc8c80ce9 ] (state=,code=0)
apache drill>
apache drill> use hive;
+------+----------------------------------+
|  ok  |             summary              |
+------+----------------------------------+
| true | Default schema changed to [hive] |
+------+----------------------------------+
1 row selected (0.088 seconds)
apache drill (hive)> select * from test;
Error: VALIDATION ERROR: From line 1, column 15 to line 1, column 18: Object 
'test' not found


[Error Id: ebf13f9c-16c9-4990-b72a-ba74e8348753 ] (state=,code=0)

-----Original Message-----
From: Igor Guzenko [mailto:ihor.huzenko....@gmail.com] 
Sent: Monday, May 27, 2019 11:02 AM
To: user@drill.apache.org
Cc: Khurram Faraaz <kfar...@mapr.com>
Subject: Re: cant select from hive table

Hello Khurram,

If Hive storage based authorization is enabled for your deployment it's may be 
the reason why you're getting such messages.
In the test it's visible that when at storage level user don't have rights to 
query table files Drill shows the confusing error. Here is the test
 
https://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fdrill%2Fblob%2Fmaster%2Fcontrib%2Fstorage-hive%2Fcore%2Fsrc%2Ftest%2Fjava%2Forg%2Fapache%2Fdrill%2Fexec%2Fimpersonation%2Fhive%2FTestStorageBasedHiveAuthorization.java&amp;data=02%7C01%7CSami.Ahmad%40dot.state.fl.us%7C913283ea621c44fa549508d6e2b46364%7Cdb21de5dbc9c420c8f3f8f08f85b5ada%7C0%7C1%7C636945661720971215&amp;sdata=41utoQOJI01U0Dvc6bDZDLBL6UpoQHCr6sXK3AtWzCc%3D&amp;reserved=0
.

If I didn't guess and security isn't enabled, then you could just try:

1) Two separate queries:
    use hive.`default`;
    select * from test;

OR

2)  From root schema
select * from hive.`test`;

OR

3) Two separate queries:
    use hive;
    select * from test;

If previous queries don't work for not secured deployment it's a bug.

Thanks, Igor

On Mon, May 27, 2019 at 3:27 PM Ahmad, Sami <sami.ah...@dot.state.fl.us> wrote:
>
> Still not working :
>
> apache drill> use hive.`default`;
> +------+------------------------------------------+
> |  ok  |                 summary                  |
> +------+------------------------------------------+
> | true | Default schema changed to [hive.default] |
> +------+------------------------------------------+
> 1 row selected (0.089 seconds)
> apache drill (hive.default)> show tables;
> +--------------+------------+
> | TABLE_SCHEMA | TABLE_NAME |
> +--------------+------------+
> | hive.default | test       |
> +--------------+------------+
> 1 row selected (0.188 seconds)
> apache drill (hive.default)> select * from hive.`default`.test;
> Error: VALIDATION ERROR: From line 1, column 15 to line 1, column 18: Object 
> 'test' not found within 'hive.default'
>
>
> [Error Id: 6b24df4c-3678-4bf4-94eb-8dd5d9910213 ] (state=,code=0) 
> apache drill (hive.default)>
>
> -----Original Message-----
> From: Arina Yelchiyeva [mailto:arina.yelchiy...@gmail.com]
> Sent: Friday, May 24, 2019 4:34 PM
> To: user@drill.apache.org
> Cc: Khurram Faraaz <kfar...@mapr.com>
> Subject: Re: cant select from hive table
>
> EXTERNAL SENDER: Use caution with links and attachments.
>
>
> Default is keyword, use it back-ticks (select * from hive.`default`.test).
>
> > On May 24, 2019, at 10:59 PM, Ahmad, Sami <sami.ah...@dot.state.fl.us> 
> > wrote:
> >
> > As you can see , the show table command sees the table but select command 
> > cant find it .
> >
> > pache drill (hive.default)> show tables;
> > +--------------+------------+
> > | TABLE_SCHEMA | TABLE_NAME |
> > +--------------+------------+
> > | hive.default | test       |
> > +--------------+------------+
> > 1 row selected (0.113 seconds)
> > apache drill (hive.default)> select id from test;
> > Error: VALIDATION ERROR: From line 1, column 16 to line 1, column 19:
> > Object 'test' not found
> >
> >
> > [Error Id: 7d0eb107-38c6-4d37-90b2-baa953a3e701 ] (state=,code=0) 
> > apache drill (hive.default)>
> >
> > From: Ahmad, Sami
> > Sent: Friday, May 24, 2019 11:35 AM
> > To: Khurram Faraaz <kfar...@mapr.com>; user@drill.apache.org
> > Subject: cant select from hive table
> >
> > Hi
> > My hive storage plugin is working and I can see the hive tables  but 
> > I can’t select from them ,please advise
> >
> > apache drill (hive.default)> show tables;
> > +--------------+------------+
> > | TABLE_SCHEMA | TABLE_NAME |
> > +--------------+------------+
> > | hive.default | test       |
> > +--------------+------------+
> > 1 row selected (0.126 seconds)
> > apache drill (hive.default)> select id from hive.default.`test`;
> > Error: PARSE ERROR: Encountered ". default" at line 1, column 20.
> > Was expecting one of:
> >    <EOF>
> >    "ORDER" ...
> >    "LIMIT" ...
> >    "OFFSET" ...
> >    "FETCH" ...
> >    "NATURAL" ...
> >    "JOIN" ...
> >    "INNER" ...
> >    "LEFT" ...
> >    "RIGHT" ...
> >    "FULL" ...
> >    "CROSS" ...
> >    "," ...
> >    "OUTER" ...
> >    "(" ...
> >    "MATCH_RECOGNIZE" ...
> >    "." ...
> >    <IDENTIFIER> ...
> >    <QUOTED_IDENTIFIER> ...
> >    <BACK_QUOTED_IDENTIFIER> ...
> >    <BRACKET_QUOTED_IDENTIFIER> ...
> >    <UNICODE_QUOTED_IDENTIFIER> ...
> >    "TABLESAMPLE" ...
> >    "WHERE" ...
> >    "GROUP" ...
> >    "HAVING" ...
> >    "WINDOW" ...
> >    "UNION" ...
> >    "INTERSECT" ...
> >    "EXCEPT" ...
> >    "MINUS" ...
> >    "." <IDENTIFIER> ...
> >    "." <QUOTED_IDENTIFIER> ...
> >    "." <BACK_QUOTED_IDENTIFIER> ...
> >    "." <BRACKET_QUOTED_IDENTIFIER> ...
> >    "." <UNICODE_QUOTED_IDENTIFIER> ...
> >    "." "*" ...
> >    "[" ...
> >
> >
> > SQL Query select id from hive.default.`test`
> >                   ^
> >
> >
> > [Error Id: 96ad1704-8b95-42b7-913c-b62d3d2c5782 ] (state=,code=0) 
> > apache drill (hive.default)>

Reply via email to