mspruc commented on code in PR #763:
URL: https://github.com/apache/wayang/pull/763#discussion_r3332030184


##########
wayang-platforms/wayang-java/src/main/java/org/apache/wayang/java/operators/JavaTableSink.java:
##########
@@ -59,6 +59,10 @@ private void setRecordValue(PreparedStatement ps, int index, 
Object value) throw
             ps.setDouble(index, (Double) value);
         } else if (value instanceof Float) {
             ps.setFloat(index, (Float) value);
+        } else if (value instanceof Short) {
+            ps.setShort(index, (Short) value);
+        } else if (value instanceof java.math.BigDecimal) {

Review Comment:
   If you import `BigDecimal`, I don't think you have to specify `java.math.`, 
unless there's some other reason for this?



##########
wayang-platforms/wayang-java/src/main/java/org/apache/wayang/java/operators/JavaTableSink.java:
##########
@@ -59,6 +59,10 @@ private void setRecordValue(PreparedStatement ps, int index, 
Object value) throw
             ps.setDouble(index, (Double) value);
         } else if (value instanceof Float) {
             ps.setFloat(index, (Float) value);
+        } else if (value instanceof Short) {
+            ps.setShort(index, (Short) value);
+        } else if (value instanceof java.math.BigDecimal) {

Review Comment:
   Also, we are on Java 17, you can use pattern matching and do 
   `if (value instanceof BigDecimal decimal) ps.setDecimal(index, decimal);`



-- 
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]

Reply via email to