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://github.com/apache/drill/blob/master/contrib/storage-hive/core/src/test/java/org/apache/drill/exec/impersonation/hive/TestStorageBasedHiveAuthorization.java
.

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 <[email protected]> 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:[email protected]]
> Sent: Friday, May 24, 2019 4:34 PM
> To: [email protected]
> Cc: Khurram Faraaz <[email protected]>
> 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 <[email protected]> 
> > 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 <[email protected]>; [email protected]
> > 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