stoty commented on code in PR #1571:
URL: https://github.com/apache/phoenix/pull/1571#discussion_r1143778537
##########
phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixPreparedStatement.java:
##########
@@ -528,16 +519,20 @@ public void setTimestamp(int parameterIndex, Timestamp x)
throws SQLException {
@Override
public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal)
throws SQLException {
+ setParameter(parameterIndex, processTimestamp(x, cal));
+ }
+
+ private java.sql.Timestamp processTimestamp(Timestamp x, Calendar cal) {
if (x != null) {
if (connection.isApplyTimeZoneDisplacement()) {
- x = DateUtil.applyInputDisplacement(x, cal.getTimeZone());
+ return DateUtil.applyInputDisplacement(x, cal.getTimeZone());
} else {
int nanos = x.getNanos();
x = new Timestamp(x.getTime());
x.setNanos(nanos);
Review Comment:
Yes, handling nanos is awkward with java.sql.Timestamp.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]