You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Kundan Kumar Jha (Jira)" <ji...@apache.org> on 2024/01/29 07:10:00 UTC

[jira] [Created] (HIVE-28039) Select query is not working for partition tables for table {owners}

Kundan Kumar Jha created HIVE-28039:
---------------------------------------

             Summary: Select query is not working for partition tables for table {owners}
                 Key: HIVE-28039
                 URL: https://issues.apache.org/jira/browse/HIVE-28039
             Project: Hive
          Issue Type: Bug
          Components: Hive
            Reporter: Kundan Kumar Jha


When giving access to a user through owner policy and tried to access the partition table through spark and through beeline its giving error.

*Steps to reproduce:*

1. clear all the policies in ranger hive.

2. create 2 policies: 

    a. give hrt_21 user access to create any database.

    b. create a owner policy for all access on db1.

3. Then create a database named db1 using hrt_21 as query user.

4. Then create a table inside the db1 named table1 with partition with query like:

     "create table db1.table1(id int, name string) partitioned by (city String);"

5. Then try to query the table using spark shell as well as beeline that will result into following errors:

On Spark shell:

Its giving the following error
{code:java}
org.apache.hadoop.hive.ql.metadata.HiveException: NoSuchObjectException(message:Table table1 does not exist) {code}
when tried:
{code:java}
spark.sql("select * from  db1.table1").show() {code}
and
{code:java}
spark.sql("select * from  db1.table1 where city='partition_value'").show()  {code}
But on beeline its giving error for this
{code:java}
select * from  db1.table1; {code}
But showing result following result
{code:java}
select * from  db1.table1 where city='partition_value' {code}
result:
{code:java}
+----------------+------------------+------------------+
| some_table.id  | some_table.name  | some_table.city  |
+----------------+------------------+------------------+
+----------------+------------------+------------------+ {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)