Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Hive tutorial tables don't appear in DAS

Highlighted

Hive tutorial tables don't appear in DAS

New Contributor

Following the tutorial above, logged in as 'maria_dev', I create tables with no error, but they are not visible in the default database in the DAS UI. Do I need to grant permissions to 'maria_dev'?. I can see them if I connect to Hive using dbeaver and logging in as 'hive'.

4 REPLIES 4

Re: Hive tutorial tables don't appear in DAS

Expert Contributor

Hi @Michael Williams,
Data Analytics Studio (DAS) uses 'hive' ownership/credentials and cannot be changed in sandbox environment. This explains why you cannot access 'maria_dev' owned tables.

You should be able to view your tables using BEELINE, logging in as 'maria_dev':

beeline -u jdbc:hive2://sandbox-hdp.hortonworks.com:10000 -n maria_dev

Re: Hive tutorial tables don't appear in DAS

Explorer

I'm not sure why this has been marked solved. Is there really no way to view the contents of the "default" database through the DAS UI in Sandbox? If there is, can you please let me know how.

Re: Hive tutorial tables don't appear in DAS

Mentor

@jhc 

I think I answered to one of your other posts about DAS too, it's usually good to know what happens under the hood here is the simple answer to this thread with proof, the DEFAULT database delivered with the sandbox is empty    There are 4 databases  baked into this sandbox image  [default, food mart,information_schema, and sys ]

[root@sandbox-hdp ~]# su - hive
Last login: Sat Sep 21 08:07:40 UTC 2019
[hive@sandbox-hdp ~]$ hive
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/hdp/3.0.1.0-187/hive/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hdp/3.0.1.0-187/hadoop/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Connecting to jdbc:hive2://sandbox-hdp.hortonworks.com:2181/default;password=hive;serviceDiscoveryMode=zooKeeper;user=hive;zooKeeperNamespace=hiveserver2
19/09/21 08:38:06 [main]: INFO jdbc.HiveConnection: Connected to sandbox-hdp.hortonworks.com:10000
Connected to: Apache Hive (version 3.1.0.3.0.1.0-187)
Driver: Hive JDBC (version 3.1.0.3.0.1.0-187)
Transaction isolation: TRANSACTION_REPEATABLE_READ
Beeline version 3.1.0.3.0.1.0-187 by Apache Hive
0: jdbc:hive2://sandbox-hdp.hortonworks.com:2> show databases;
INFO : Compiling command(queryId=hive_20190921083816_c231488f-8a6f-4fb1-bdfb-48493a3cb98e): show databases
INFO : Semantic Analysis Completed (retrial = false)
INFO : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:database_name, type:string, comment:from deserializer)], properties:null)
INFO : Completed compiling command(queryId=hive_20190921083816_c231488f-8a6f-4fb1-bdfb-48493a3cb98e); Time taken: 0.091 seconds
INFO : Executing command(queryId=hive_20190921083816_c231488f-8a6f-4fb1-bdfb-48493a3cb98e): show databases
INFO : Starting task [Stage-0:DDL] in serial mode
INFO : Completed executing command(queryId=hive_20190921083816_c231488f-8a6f-4fb1-bdfb-48493a3cb98e); Time taken: 0.064 seconds
INFO : OK
+---------------------+
| database_name |
+---------------------+
| default |
| foodmart |
| information_schema |
| sys |
+---------------------+
4 rows selected (0.443 seconds)
.
0: jdbc:hive2://sandbox-hdp.hortonworks.com:2> use default;
INFO : Compiling command(queryId=hive_20190921095423_27354cf8-050c-424a-b14f-49ddc027fe17): use default
INFO : Semantic Analysis Completed (retrial = false)
INFO : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO : Completed compiling command(queryId=hive_20190921095423_27354cf8-050c-424a-b14f-49ddc027fe17); Time taken: 0.033 seconds
INFO : Executing command(queryId=hive_20190921095423_27354cf8-050c-424a-b14f-49ddc027fe17): use default
INFO : Starting task [Stage-0:DDL] in serial mode
INFO : Completed executing command(queryId=hive_20190921095423_27354cf8-050c-424a-b14f-49ddc027fe17); Time taken: 0.016 seconds
INFO : OK
No rows affected (0.07 seconds)
0: jdbc:hive2://sandbox-hdp.hortonworks.com:2> show tables;
INFO : Compiling command(queryId=hive_20190921095432_fe48a5e3-122b-4284-a46c-75dad0c1aaa8): show tables
INFO : Semantic Analysis Completed (retrial = false)

INFO : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:tab_name, type:string, comment:from deserializer)], properties:null)
INFO : Completed compiling command(queryId=hive_20190921095432_fe48a5e3-122b-4284-a46c-75dad0c1aaa8); Time taken: 0.045 seconds
INFO : Executing command(queryId=hive_20190921095432_fe48a5e3-122b-4284-a46c-75dad0c1aaa8): show tables
INFO : Starting task [Stage-0:DDL] in serial mode
INFO : Completed executing command(queryId=hive_20190921095432_fe48a5e3-122b-4284-a46c-75dad0c1aaa8); Time taken: 0.021 seconds
INFO : OK
+-----------+
| tab_name |
+-----------+
+-----------+
No rows selected (0.09 seconds)

So there you go !  the default owner of DEFAULT database is hive so you can go ahead  after switching user to hive and creat tables in this database , this is a complimentary explanation to my response to your other thread of  not being able to see tables in DAS

Happy hadooping !!!! 

 

 

Re: Hive tutorial tables don't appear in DAS

Mentor

@jhc 

Any update on this issue, do you still need help? As reiterated the DEFAULT database is empty to ensure you are connected to the correct database run

0: jdbc:hive2://sandbox-hdp.hortonworks.com:2> use default;

Then run your create table that should now appear after refreshing default database

 

Happy hadooping