Apache Zeppelin and Hive - temporary table not found after creation

737 views Asked by At

I am trying to create a temporary table in Hive with as follows:

%hive
create temporary table tmp3 as select field1, field2 from mytable

When I want to see the content of my table

%hive
select * from tmp3

I get

Error while compiling statement: FAILED: SemanticException [Error 10001]: 

Line 1:14 Table not found 'tmp3'
class org.apache.hive.service.cli.HiveSQLException
org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:258)
org.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:244)
org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:247)
org.apache.zeppelin.jdbc.JDBCInterpreter.executeSql(JDBCInterpreter.java:356)
org.apache.zeppelin.jdbc.JDBCInterpreter.interpret(JDBCInterpreter.java:442)
org.apache.zeppelin.interpreter.LazyOpenInterpreter.interpret(LazyOpenInterpreter.java:94)
org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:341)
org.apache.zeppelin.scheduler.Job.run(Job.java:176)
org.apache.zeppelin.scheduler.ParallelScheduler$JobRunner.run(ParallelScheduler.java:162)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)

However if I try again to create the temporary table, I will get

Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:Temporary table default.tmp3 already exists)
class java.sql.SQLException
org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:283)
org.apache.zeppelin.jdbc.JDBCInterpreter.executeSql(JDBCInterpreter.java:356)
org.apache.zeppelin.jdbc.JDBCInterpreter.interpret(JDBCInterpreter.java:442)
org.apache.zeppelin.interpreter.LazyOpenInterpreter.interpret(LazyOpenInterpreter.java:94)
org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:341)
org.apache.zeppelin.scheduler.Job.run(Job.java:176)
org.apache.zeppelin.scheduler.ParallelScheduler$JobRunner.run(ParallelScheduler.java:162)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745) 

So it seems the table creation gets done somehow, but I cannot figure out where. And the table does not appear if I try show tables in default.

For info:

  • hive.exec.temporary.table.storage=default

  • hive.scratch.dir.permission=700

  • hive.exec.local.scratchdir=/tmp/hive

  • hive.exec.scratchdir=/tmp/hive

  • and I am using hdp 2.5.0.0-1245

Thanks in advance.

0

There are 0 answers