fewe4661389
大话东南
采纳率33.3%
2019-07-23 16:06 阅读 1.4k

hive能查到数据,但是presto查询时报错

在hive中查询时可以查到数据,没有问题,但是用presto查询时会报错:

``` java.lang.IllegalArgumentException: Unsupported encoding timestamp

具体的错误信息如下:


```SQL 错误 [16777217]: Query failed (#20190723_075844_00196_8ifu8): Failed to read ORC file: hdfs://hexindai-bj-dfgc-233:8020/warehouse/tablespace/managed/hive/ti_car.db/ti_car_evt_rea_da_contractinfo/bdw_statis_year=2019/bdw_statis_month=07/bdw_statis_day=21/ContractInfo__a6b98c8c_253b_4bf2_9ffc_c425e9a7389f
  Query failed (#20190723_075844_00196_8ifu8): Failed to read ORC file: hdfs://hexindai-bj-dfgc-233:8020/warehouse/tablespace/managed/hive/ti_car.db/ti_car_evt_rea_da_contractinfo/bdw_statis_year=2019/bdw_statis_month=07/bdw_statis_day=21/ContractInfo__a6b98c8c_253b_4bf2_9ffc_c425e9a7389f
  Query failed (#20190723_075844_00196_8ifu8): Failed to read ORC file: hdfs://hexindai-bj-dfgc-233:8020/warehouse/tablespace/managed/hive/ti_car.db/ti_car_evt_rea_da_contractinfo/bdw_statis_year=2019/bdw_statis_month=07/bdw_statis_day=21/ContractInfo__a6b98c8c_253b_4bf2_9ffc_c425e9a7389f
    com.facebook.presto.spi.PrestoException: Failed to read ORC file: hdfs://hexindai-bj-dfgc-233:8020/warehouse/tablespace/managed/hive/ti_car.db/ti_car_evt_rea_da_contractinfo/bdw_statis_year=2019/bdw_statis_month=07/bdw_statis_day=21/ContractInfo__a6b98c8c_253b_4bf2_9ffc_c425e9a7389f
    Failed to read ORC file: hdfs://hexindai-bj-dfgc-233:8020/warehouse/tablespace/managed/hive/ti_car.db/ti_car_evt_rea_da_contractinfo/bdw_statis_year=2019/bdw_statis_month=07/bdw_statis_day=21/ContractInfo__a6b98c8c_253b_4bf2_9ffc_c425e9a7389f
      java.lang.IllegalArgumentException: Unsupported encoding timestamp
      Unsupported encoding timestamp


还有这个错误:

SQL 错误 [65536]: Query failed (#20190723_075845_00197_8ifu8): outputFormat should not be accessed from a null StorageFormat

具体如下:

org.jkiss.dbeaver.DBException: SQL 错误 [65536]: Query failed (#20190723_075845_00197_8ifu8): outputFormat should not be accessed from a null StorageFormat
    at org.jkiss.dbeaver.model.impl.jdbc.cache.JDBCStructCache.loadChildren(JDBCStructCache.java:176)
    at org.jkiss.dbeaver.model.impl.jdbc.cache.JDBCStructCache.getChild(JDBCStructCache.java:230)
    at org.jkiss.dbeaver.ext.generic.model.GenericTable.getAttribute(GenericTable.java:164)
    at org.jkiss.dbeaver.ext.generic.model.GenericTable.getAttribute(GenericTable.java:1)
    at org.jkiss.dbeaver.ui.controls.resultset.ResultSetUtils.bindAttributes(ResultSetUtils.java:161)
    at org.jkiss.dbeaver.ui.controls.resultset.ResultSetDataReceiver.fetchEnd(ResultSetDataReceiver.java:159)
    at org.jkiss.dbeaver.model.impl.jdbc.struct.JDBCTable.readData(JDBCTable.java:222)
    at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.lambda$0(ResultSetJobDataRead.java:93)
    at org.jkiss.dbeaver.model.DBUtils.tryExecuteRecover(DBUtils.java:1553)
    at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.run(ResultSetJobDataRead.java:91)
    at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:95)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)
Caused by: java.sql.SQLException: Query failed (#20190723_075845_00197_8ifu8): outputFormat should not be accessed from a null StorageFormat
    at com.facebook.presto.jdbc.PrestoResultSet.resultsException(PrestoResultSet.java:1840)
    at com.facebook.presto.jdbc.PrestoResultSet$ResultsPageIterator.computeNext(PrestoResultSet.java:1820)
    at com.facebook.presto.jdbc.PrestoResultSet$ResultsPageIterator.computeNext(PrestoResultSet.java:1759)
    at com.facebook.presto.jdbc.internal.guava.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141)
    at com.facebook.presto.jdbc.internal.guava.collect.AbstractIterator.hasNext(AbstractIterator.java:136)
    at com.facebook.presto.jdbc.internal.guava.collect.TransformedIterator.hasNext(TransformedIterator.java:42)
    at com.facebook.presto.jdbc.internal.guava.collect.Iterators$ConcatenatedIterator.getTopMetaIterator(Iterators.java:1319)
    at com.facebook.presto.jdbc.internal.guava.collect.Iterators$ConcatenatedIterator.hasNext(Iterators.java:1335)
    at com.facebook.presto.jdbc.PrestoResultSet.next(PrestoResultSet.java:144)
    at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCResultSetImpl.next(JDBCResultSetImpl.java:284)
    at org.jkiss.dbeaver.model.impl.jdbc.cache.JDBCStructCache.loadChildren(JDBCStructCache.java:102)
    ... 11 more
Caused by: java.lang.IllegalStateException: outputFormat should not be accessed from a null StorageFormat
    at com.facebook.presto.hive.metastore.StorageFormat.getOutputFormat(StorageFormat.java:62)
    at com.facebook.presto.hive.HiveMetadata.extractHiveStorageFormat(HiveMetadata.java:2214)
    at com.facebook.presto.hive.HiveMetadata.getTableMetadata(HiveMetadata.java:459)
    at com.facebook.presto.hive.HiveMetadata.listTableColumns(HiveMetadata.java:564)
    at com.facebook.presto.spi.connector.classloader.ClassLoaderSafeConnectorMetadata.listTableColumns(ClassLoaderSafeConnectorMetadata.java:262)
    at com.facebook.presto.metadata.MetadataManager.listTableColumns(MetadataManager.java:556)
    at com.facebook.presto.metadata.MetadataListing.listTableColumns(MetadataListing.java:93)
    at com.facebook.presto.connector.system.jdbc.ColumnJdbcTable.cursor(ColumnJdbcTable.java:126)
    at com.facebook.presto.connector.system.SystemPageSourceProvider$1.cursor(SystemPageSourceProvider.java:124)
    at com.facebook.presto.split.MappedRecordSet.cursor(MappedRecordSet.java:53)
    at com.facebook.presto.spi.RecordPageSource.<init>(RecordPageSource.java:37)
    at com.facebook.presto.connector.system.SystemPageSourceProvider.createPageSource(SystemPageSourceProvider.java:103)
    at com.facebook.presto.split.PageSourceManager.createPageSource(PageSourceManager.java:56)
    at com.facebook.presto.operator.ScanFilterAndProjectOperator.getOutput(ScanFilterAndProjectOperator.java:221)
    at com.facebook.presto.operator.Driver.processInternal(Driver.java:379)
    at com.facebook.presto.operator.Driver.lambda$processFor$8(Driver.java:283)
    at com.facebook.presto.operator.Driver.tryWithLock(Driver.java:675)
    at com.facebook.presto.operator.Driver.processFor(Driver.java:276)
    at com.facebook.presto.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:1077)
    at com.facebook.presto.execution.executor.PrioritizedSplitRunner.process(PrioritizedSplitRunner.java:162)
    at com.facebook.presto.execution.executor.TaskExecutor$TaskRunner.run(TaskExecutor.java:483)
    at com.facebook.presto.$gen.Presto_0_221____20190620_074001_1.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

找了好久没找到原因,在这里求助大家!

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • fewe4661389 大话东南 2019-07-26 11:05

    已经找到解决方法,没有深入了解到错误,错误原因应该是因为版本切换导致一些字段类型不匹配造成的,最后对脚本中的数据类型和表中的数据类型
    进行一一对照进行修改,解决问题

    点赞 评论 复制链接分享

相关推荐