15/03/24 23:06:45 INFO ParseDriver: Parse Completed
Exception in thread "main" java.lang.RuntimeException: java.lang.NumberFormatException: For input string: "1s"
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:346)
at org.apache.spark.sql.hive.HiveContext$$anonfun$4.apply(HiveContext.scala:235)
at org.apache.spark.sql.hive.HiveContext$$anonfun$4.apply(HiveContext.scala:231)
at scala.Option.orElse(Option.scala:257)
at org.apache.spark.sql.hive.HiveContext.x$3$lzycompute(HiveContext.scala:231)
at org.apache.spark.sql.hive.HiveContext.x$3(HiveContext.scala:229)
at org.apache.spark.sql.hive.HiveContext.hiveconf$lzycompute(HiveContext.scala:229)
at org.apache.spark.sql.hive.HiveContext.hiveconf(HiveContext.scala:229)
at org.apache.spark.sql.hive.HiveMetastoreCatalog.<init>(HiveMetastoreCatalog.scala:55)
at org.apache.spark.sql.hive.HiveContext$$anon$1.<init>(HiveContext.scala:253)
at org.apache.spark.sql.hive.HiveContext.catalog$lzycompute(HiveContext.scala:253)
at org.apache.spark.sql.hive.HiveContext.catalog(HiveContext.scala:253)
at org.apache.spark.sql.hive.HiveContext$$anon$3.<init>(HiveContext.scala:263)
at org.apache.spark.sql.hive.HiveContext.analyzer$lzycompute(HiveContext.scala:263)
我已经将 hive-site.xml 从 hive conf 复制到 spark conf,我能够在 Hive 提示符下运行和执行 sql。
请删除hive-site.xml文件中的字符's'。
例如实际财产
<property>
<name>hive.metastore.client.connect.retry.delay</name>
<value>1s</value>
<description>
1s Expects a time value with unit (d/day, h/hour, m/min, s/sec, ms/msec, us/usec, ns/nsec), which is sec if not specified.
Number of seconds for the client to wait between consecutive connection attempts
</description>
</property>
更改的属性
<property>
<name>hive.metastore.client.connect.retry.delay</name>
<value>1</value>
<description>
1s Expects a time value with unit (d/day, h/hour, m/min, s/sec, ms/msec, us/usec, ns/nsec), which is sec if not specified.
Number of seconds for the client to wait between consecutive connection attempts
</description>
</property>
这应该适用于所有值 s/秒和毫秒/毫秒等。此更改应仅适用于 Spark。