soumyakanti3578 commented on code in PR #6197:
URL: https://github.com/apache/hive/pull/6197#discussion_r2663147440


##########
jdbc-handler/src/main/java/org/apache/hive/storage/jdbc/DBRecordWritable.java:
##########
@@ -64,8 +64,13 @@ public void write(PreparedStatement statement) throws 
SQLException {
     ParameterMetaData parameterMetaData = statement.getParameterMetaData();
     for (int i = 0; i < columnValues.length; i++) {
       Object value = columnValues[i];
-      if ((parameterMetaData.getParameterType(i + 1) == Types.CHAR) && value 
!= null && value instanceof Boolean) {
-        value = ((Boolean) value).booleanValue() ? "1" : "0";
+      try {
+        if (value instanceof Boolean b && 
(parameterMetaData.getParameterType(i + 1) == Types.CHAR)) {
+          value = b ? "1" : "0";
+        }
+      } catch (SQLException e) {

Review Comment:
   Yes. I can probably add a `WARN` that `getParameterType` returned an 
exception. But I think I had to add this because I was getting an exception for 
Oracle, but it's not fatal and we can just suppress the driver error and move 
forward.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to