yuqi1129 commented on issue #1299: [CALCITE-3100] cast(? as DATE) won't work with PreparedStatement URL: https://github.com/apache/calcite/pull/1299#issuecomment-509623558 > return type.isNullable() ? Integer.class : int.class; @danny0405 Do you have any idea about this problem that superior than current method using 'string' as intermediate type. the following is my point, if any is wrong, do not hesitate to point out. As far as i can see, when we use ``` stringStatement.setString(1, "2"); ``` we just take the parameter as a string value, so casting to string, i think, is reasonable. As for other method such as ``` intStatement.setInt(1, 2); ``` as the following code return a value with object type, string is most compatible ``` Expression expression = Expressions.call(root, BuiltInMethod.DATA_CONTEXT_GET.method, Expressions.constant("?" + expr.getIndex())); ```
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
