GregorianCalendar-java.lang.IllegalArgumentException:MONTH

时间:2018-06-20 10:09:01

标签: datetime apache-spark jdbc

虽然我尝试用spark数据框加载mysql表。 我收到错误消息。

Caused by: java.lang.IllegalArgumentException: MONTH
  at java.util.GregorianCalendar.computeTime(GregorianCalendar.java:2648)
  at java.util.Calendar.updateTime(Calendar.java:3393)
  at java.util.Calendar.getTimeInMillis(Calendar.java:1782)
  at com.mysql.cj.jdbc.io.JdbcDateValueFactory.createFromDate(JdbcDateValueFactory.java:67)
  at com.mysql.cj.jdbc.io.JdbcDateValueFactory.createFromDate(JdbcDateValueFactory.java:39)
  at com.mysql.cj.core.io.ZeroDateTimeToNullValueFactory.createFromDate(ZeroDateTimeToNullValueFactory.java:41)
  at com.mysql.cj.core.io.BaseDecoratingValueFactory.createFromDate(BaseDecoratingValueFactory.java:46)
  at com.mysql.cj.core.io.BaseDecoratingValueFactory.createFromDate(BaseDecoratingValueFactory.java:46)
  at com.mysql.cj.core.io.MysqlTextValueDecoder.decodeDate(MysqlTextValueDecoder.java:66)
  at com.mysql.cj.mysqla.result.AbstractResultsetRow.decodeAndCreateReturnValue(AbstractResultsetRow.java:70)
  at com.mysql.cj.mysqla.result.AbstractResultsetRow.getValueFromBytes(AbstractResultsetRow.java:225)
  at com.mysql.cj.mysqla.result.TextBufferRow.getValue(TextBufferRow.java:122)
  at com.mysql.cj.jdbc.result.ResultSetImpl.getNonStringValueFromRow(ResultSetImpl.java:630)
  at com.mysql.cj.jdbc.result.ResultSetImpl.getDateOrTimestampValueFromRow(ResultSetImpl.java:643)
  at com.mysql.cj.jdbc.result.ResultSetImpl.getDate(ResultSetImpl.java:788)
  at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$org$apache$spark$sql$execution$datasources$jdbc$JdbcUtils$$makeGetter$$.apply(JdbcUtils.scala:380)

1 个答案:

答案 0 :(得分:-1)

尝试使用最新的mysql 5.x.x JDBC驱动程序。