我正在尝试使用Drill从位于蜂巢中的表abc中读取数据。为此,我创建了具有以下配置的配置单元存储插件
{
"type": "hive",
"enabled": true,
"configProps": {
"hive.metastore.uris": "thrift://<ip>:<port>",
"fs.default.name": "hdfs://<ip>:<port>/",
"hive.metastore.sasl.enabled": "false",
"hive.server2.enable.doAs": "true",
"hive.metastore.execute.setugi": "true"
}
}
有了这个,我就能看到蜂巢中的数据库,但是当我尝试访问特定数据库中的任何表时
select * from hive.db.abc;
它会引发以下错误
org.apache.drill.common.exceptions.UserRemoteException:验证错误:从第1行第15列到第1行第18列:在'hive.db'中找不到对象'abc'SQL查询为空[错误ID:在centos2.example.com上为b6c56276-6255-4b5b-a600-746dbc2f3d67:31010](org.apache.calcite.runtime.CalciteContextException)从第1行第15列到第1行第18列:在“ hive.db的sun.reflect.NativeConstructorAccessorImpl.newInstance0():-2 sun.reflect.NativeConstructorAccessorImpl.newInstance():62 sun.reflect.DelegatingConstructorAccessorImpl.newInstance():45 java.lang.reflect.Constructor.newInstance(): 423 org.apache.calcite.runtime.Resources $ ExInstWithCause.ex():463 org.apache.calcite.sql.SqlUtil.newContextException():800 org.apache.calcite.sql.SqlUtil.newContextException():788 org。 apache.calcite.sql.validate.SqlValidatorImpl.newValidationError():4703 org.apache.calcite.sql.validate.IdentifierNamespace.resolveImpl():127 org.apache.calcite.sql.validate.IdentifierNamespace.vali dateImpl():177 org.apache.calcite.sql.validate.AbstractNamespace.validate():84 org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace():947 org.apache.calcite.sql.validate.SqlValidatorImpl .validateQuery():928 org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom():2972 org.apache.drill.exec.planner.sql.SqlConverter $ DrillValidator.validateFrom():267 org.apache.calcite。 sql.validate.SqlValidatorImpl.validateFrom():2957 org.apache.drill.exec.planner.sql.SqlConverter $ DrillValidator.validateFrom():267 org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect():3216 org .apache.calcite.sql.validate.SelectNamespace.validateImpl():60 org.apache.calcite.sql.validate.AbstractNamespace.validate():84 org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace():947 org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery():928 org.apache.calcite.sql.SqlSelect.validate():226 org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression():903 org .apac he.calcite.sql.validate.SqlValidatorImpl.validate():613 org.apache.drill.exec.planner.sql.SqlConverter.validate():190 org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler。 validateNode():630 org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateAndConvert():202 org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan():174 org.apache .drill.exec.planner.sql.DrillSqlWorker.getQueryPlan():146 org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan():84 org.apache.drill.exec.work.foreman.Foreman.runSQL ():567 org.apache.drill.exec.work.foreman.Foreman.run():264 java.util.concurrent.ThreadPoolExecutor.runWorker():1149 java.util.concurrent.ThreadPoolExecutor $ Worker.run(): 624 java.lang.Thread.run():748由(org.apache.calcite.sql.validate.SqlValidatorException)引起的在'hive.db'中找不到对象'abc'sun.reflect.NativeConstructorAccessorImpl.newInstance0():- 2 sun.reflect.NativeConstructorAccessorImpl.newInstance():62 sun.reflect.DelegatingConstructorAcc essorImpl.newInstance():45 java.lang.reflect.Constructor.newInstance():423 org.apache.calcite.runtime.Resources $ ExInstWithCause.ex():463 org.apache.calcite.runtime.Resources $ ExInst.ex ():572 org.apache.calcite.sql.SqlUtil.newContextException():800 org.apache.calcite.sql.SqlUtil.newContextException():788 org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError(): 4703 org.apache.calcite.sql.validate.IdentifierNamespace.resolveImpl():127 org.apache.calcite.sql.validate.IdentifierNamespace.validateImpl():177 org.apache.calcite.sql.validate.AbstractNamespace.validate() :84 org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace():947 org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery():928 org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom( ):2972 org.apache.drill.exec.planner.sql.SqlConverter $ DrillValidator.validateFrom():267 org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom():2957 org.apache.drill.exec.planner .sql.SqlConverter $ DrillVal idator.validateFrom():267 org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect():3216 org.apache.calcite.sql.validate.SelectNamespace.validateImpl():60 org.apache.calcite.sql.validate .AbstractNamespace.validate():84 org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace():947 org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery():928 org.apache.calcite.sql。 SqlSelect.validate():226 org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression():903 org.apache.calcite.sql.validate.SqlValidatorImpl.validate():613 org.apache.drill.exec.planner .sql.SqlConverter.validate():190 org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateNode():630 org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateAndConvert() :202 org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan():174 org.apache.drill.exec.planner.sql.DrillSqlWorker.getQueryPlan():146 org.apache.drill.exec。 planner.sql.DrillSqlWorker.getPlan():84 org.ap ache.drill.exec.work.foreman.Foreman.runSQL():567 org.apache.drill.exec.work.foreman.Foreman.run():264 java.util.concurrent.ThreadPoolExecutor.runWorker():1149 java .util.concurrent.ThreadPoolExecutor $ Worker.run():624 java.lang.Thread.run():748
答案 0 :(得分:0)
您应该升级到较新的Hive版本。对于Drill 1.13,它是Hive 2.3.2版本?从Drill-1.13开始,Drill利用了Hive客户端的2.3.2版本[1]。
即将支持Hive 3.0版本[2]。
也请按照以下指南为您的环境[3]进行必要的Hive插件配置。您可以省略“ hive.metastore.sasl.enabled”,“ hive.server2.enable.doAs”和“ hive.metastore.execute.setugi”属性,因为您已经指定了默认值[4]。关于“ hive.metastore.uris”和“ fs.default.name”,您应该为它们指定与hive-site.xml中相同的值。
[1] https://drill.apache.org/docs/hive-storage-plugin
[2] https://issues.apache.org/jira/browse/DRILL-6604
[3] https://drill.apache.org/docs/hive-storage-plugin/#hive-remote-metastore-configuration
[4] https://github.com/apache/hive/blob/rel/release-2.3.2/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java#L824