aliyun / aliyun-odps-jdbc

JDBC Driver for ODPS
Other
125 stars 38 forks source link

[BUG] OdpsPreparedStatement.updateSql() method build SQL can't execute. #143

Closed W1433277729 closed 1 year ago

W1433277729 commented 1 year ago

Describe the bug OdpsPreparedStatement.updateSql() method build SQL can't execute.

To Reproduce

  1. jdk 11
  2. odps-jdbc 3.3.6
  3. Full stack of the error.
  4. Minimized code to reproduce the error.

Expected behavior when i debug on Idea,OdpsPreparedStatement.updateSql() method return sql as follow: INSERT INTO max_test_wl.all_type_test(int_col, bigint_col, float_col, double_col, decimal_col, str_col, boolean_col, date_col, timestamp_col, n_int, n_string) VALUES (4, 1234567890L, 1.0, 2.0, 4BD, '测试', TRUE, DATETIME"2022-10-24 00:00:00", TIMESTAMP"2022-10-25 18:44:19.0", 100, 'replace');

this sql can't execute,the parameters value can see the screenshot 3

Screenshots the convertJavaTypeToSqlString(Object x) method in updateSql()

  1. for float type , here will return '1.0' instead of cast(1.0 as float) image
  2. for Date\Time Type,will return DATETIME"2022-10-24 00:00:00", can't write this value to table of Date type image
  3. the parameter value of convertJavaTypeToSqlString() image

Additional context Add any other context about the problem here.

yefanjiang commented 1 year ago

Thanks for your issue. After verification, this problem does exist. We will fix this problem and release a related version in the near future, thank you for your use.

W1433277729 commented 1 year ago

Thanks for your issue. After verification, this problem does exist. We will fix this problem and release a related version in the near future, thank you for your use.

Thanks,I see the maxcompute has support 2.0 datatypes with jdbc, hope can support this datatypes after fix image

yefanjiang commented 1 year ago

hi, we have fixed this bug in version 3.4.2. If you have any questions, please leave a message. We will reply as soon as possible.