gpt4 book ai didi

java - JDBC 和 Hive 查询错误 10 或 9

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:58:09 24 4
gpt4 key购买 nike

5 月,我创建了一个 Java servlet,它允许我在 Cosmos 上查询我的配置单元表。

在迁移到 cygnus 0.8.2 之前,我的数据被推送到一个名为“hostabee”的表中,我仍然可以从我的 Java 应用程序中查询该表。但是现在会为每个推送到 cosmos 的实体自动创建一个表。起初,我没有发现任何问题,这甚至让我的项目变得更简单。但我无法从我的应用程序中查询新表。相反,我收到此错误

java.sql.SQLException: Query returned non-zero code: 10, cause: FAILED: Error in semantic analysis: Line 1:15 Table not found 'guillaume_jourdain_hostabee_hives_a_hive_column'
at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:194)
at HiveBasicClientServlet.doQuery(HiveBasicClientServlet.java:100)
at HiveBasicClientServlet.demo(HiveBasicClientServlet.java:189)
at HiveBasicClientServlet.doGet(HiveBasicClientServlet.java:44)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:701)

或者这个

java.sql.SQLException: Query returned non-zero code: 9, cause: FAILED: Execution Error, return code -101 from shark.execution.SparkTask
at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:194)
at HiveBasicClientServlet.doQuery(HiveBasicClientServlet.java:100)
at HiveBasicClientServlet.demo(HiveBasicClientServlet.java:189)
at HiveBasicClientServlet.doGet(HiveBasicClientServlet.java:44)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:701)

表“guillaume_jourdain_hostabee_hives_a_hive_column”存在,我可以使用 ssh 连接从 hive 查询它。你知道我的问题是从哪里来的吗?如有必要,我可以向您展示我的部分代码。

最佳答案

以下错误:

Error in semantic analysis: Line 1:15 Table not found 'guillaume_jourdain_hostabee_hives_a_hive_column'

这不是因为 Cygnus 0.8.2,而是因为我们在 FIWARE 实验室的 Cosmos 全局实例中遇到的罕见行为。幸运的是,通过在表名前加上默认数据库名称(default :))可以很容易地解决这个问题。 IE。如果你有类似的东西:

select * from mytable;

现在你必须写:

select * from default.mytable;

关于java - JDBC 和 Hive 查询错误 10 或 9,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31834034/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com