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

zaqlnxep  于 2021-06-24  发布在  Hive
关注(0)|答案(1)|浏览(355)

我正在尝试使用下面的查询在现有的druid表的基础上创建一个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。

sg24os4d

sg24os4d1#

我不熟悉这种方法或语法,但从错误判断它适用于其他情况?如果是这样的话,也许你必须把时间转换成一种表示时区的格式?我不知道是怎么通过的。

相关问题