Date/Timestamp 字段的 HIVE 和 myBatis 问题

HIVE and myBatis issue with Date/Timestamp fields

我编写了一个简单的 hadoop/hive table 代码,定义为

CREATE TABLE mike
timeOne TIMESTAMP,
timeTwo TIMESTAMP,
name    STRING

然后是一个 myBatis 映射器文件,用于在此处插入一条记录,如下所示

<insert id="insertMikeFormDataForHadoop" parameterType="hashmap">
    INSERT INTO ${tableName} (timeOne, timeTwo, name)
    VALUES (#{timeOne, jdbcType=DATE}, #{timeTwo, jdbcType=DATE}, #{name})
  </insert>

当我 运行 通过这个 SQL 插入数据的测试时,我得到这样的错误。

org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 2:16 mismatched input '-' expecting ) near '2017' in value row constructor
### The error may involve com.vertexinc.ve.returns.mapper.FormMapper.insertMikeFormDataForHadoop-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO mike (timeOne, timeTwo, name)     VALUES (?, ?, ?)
### Cause: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 2:16 mismatched input '-' expecting ) near '2017' in value row constructor

我也尝试过使用 jdbcType=TIMESTAMP 而不是 date,但出现同样的错误。

我想知道我是否做错了什么,或者对 hive/hadoop 和 mybatis 做出了一些我不应该做的假设。

(这是我用来说明这一点的一个超级简单的例子)。

原来这是配置单元 jdbc 驱动程序版本 1.2.1 的问题。
HivePreparedStatement 中的 setTimestamp 有一个小缺陷。升级驱动程序解决了问题..

https://issues.apache.org/jira/browse/HIVE-11748