[ https://issues.apache.org/jira/browse/SPARK-30830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17044205#comment-17044205 ]
Hyukjin Kwon commented on SPARK-30830: -------------------------------------- That should be fixed in the JDBC driver. Spark will also support Hive 2.3 as of HIVE-10726 > method setQueryTimeout not support > ---------------------------------- > > Key: SPARK-30830 > URL: https://issues.apache.org/jira/browse/SPARK-30830 > Project: Spark > Issue Type: Bug > Components: SQL > Affects Versions: 2.4.0 > Reporter: humengyu > Priority: Minor > > I found > {code:java} > statement.setQueryTimeout(options.queryTimeout) > {code} > in org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD.$resolveTable > but the default version for hive-jdbc in spark2.x is 1.2.1.spark2: > {code:java} > @Override > public void setQueryTimeout(int seconds) throws SQLException { > throw new SQLException("Method not supported"); > } > {code} > thus when I use hive-jdbc in spark, it will not work: > {code:java} > diagnostics: User class threw exception: java.sql.SQLException: Method not > supporteddiagnostics: User class threw exception: java.sql.SQLException: > Method not supported at > org.apache.hive.jdbc.HiveStatement.setQueryTimeout(HiveStatement.java:739) at > org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD$.resolveTable(JDBCRDD.scala:60) > at > org.apache.spark.sql.execution.datasources.jdbc.JDBCRelation$.getSchema(JDBCRelation.scala:210) > at > org.apache.spark.sql.execution.datasources.jdbc.JdbcRelationProvider.createRelation(JdbcRelationProvider.scala:35) > at > org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:318) > at > org.apache.spark.sql.DataFrameReader.loadV1Source(DataFrameReader.scala:223) > at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:211) at > org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:167) > {code} > I fixed this problem by repackaging hive-jdbc-1.2.1.spark2 : > {code:java} > @Override > public void setQueryTimeout(int seconds) throws SQLException { > // throw new SQLException("Method not supported"); > } > {code} > Do we have a better way? -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org