Druid:查询结果中没有带有带有本地时区类型的时间戳的列;一列应该是带有本地时区类型的时间戳

时间:2020-09-25 05:38:22

标签: hive druid

我正在尝试使用以下我面临错误的查询,在现有的德鲁伊表的基础上创建一个德鲁伊表。

查询:

CREATE TABLE IF NOT EXISTS database.druid_table2 STORED BY 
     'org.apache.hadoop.hive.druid.DruidStorageHandler' AS SELECT '__time' as `__time`,column1, column2, column3 FROM database.druid_table1; 

错误:

org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: 
    SemanticException No column with timestamp with local time-zone type on query result; one column 
    should be of timestamp with local time-zone type
    at org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:300)
    at org.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:286)
    at org.apache.hive.jdbc.HiveStatement.runAsyncOnServer(HiveStatement.java:324)
    at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:26`enter code here`5)
    at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:291)
    at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:291)
    at org.apache.zeppelin.jdbc.JDBCInterpreter.executeSql(JDBCInterpreter.java:718)
    at org.apache.zeppelin.jdbc.JDBCInterpreter.interpret(JDBCInterpreter.java:801)
    at org.apache.zeppelin.interpreter.LazyOpenInterpreter.interpret(LazyOpenInterpreter.java:103)
    at 
org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:633)
    at org.apache.zeppelin.scheduler.Job.run(Job.java:188)
    at org.apache.zeppelin.scheduler.ParallelScheduler$JobRunner.run(ParallelScheduler.java:162)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

注意:我正在使用Hive交互模式,因为这是一个与Druid相关的查询,并且Hadoop版本是3.2.x。

1 个答案:

答案 0 :(得分:0)

我对这种方法或语法不熟悉,但是从错误的角度判断它是否适用于其他情况?如果是这样,也许您必须将__time转换为指示时区的格式?我不确定它的传递方式。

相关问题