sanskritimbora commented on code in PR #852:
URL: https://github.com/apache/arrow-java/pull/852#discussion_r2360717921


##########
flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/converter/impl/TimestampAvaticaParameterConverter.java:
##########
@@ -37,7 +38,34 @@ public 
TimestampAvaticaParameterConverter(ArrowType.Timestamp type) {}
 
   @Override
   public boolean bindParameter(FieldVector vector, TypedValue typedValue, int 
index) {
-    long value = (long) typedValue.toLocal();
+    Object valueObj = typedValue.toLocal();
+    if (valueObj instanceof String) {
+      return bindTimestampAsString(vector, (String) valueObj, index);
+    } else if (valueObj instanceof Long) {
+      return bindTimestampAsLong(vector, (Long) valueObj, index);
+    } else {
+      return false;
+    }

Review Comment:
   Good point, I have updated the other converters to include explicit type 
checks before casting, just like in the timestamp converter. This ensures safe 
handling and avoids failed casts.



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