pan3793 commented on code in PR #6828:
URL: https://github.com/apache/kyuubi/pull/6828#discussion_r1862543300


##########
kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiBaseResultSet.java:
##########
@@ -159,23 +200,23 @@ public int getConcurrency() throws SQLException {
 
   @Override
   public Date getDate(int columnIndex) throws SQLException {
-    Object obj = getObject(columnIndex);
+    final Object obj = getObject(columnIndex);
     if (obj == null) {
       return null;
     }
     if (obj instanceof Date) {
       return (Date) obj;
     }
-    try {
-      if (obj instanceof String) {
+    if (obj instanceof String) {
+      try {
         return Date.valueOf((String) obj);
+      } catch (Exception e) {
+        throw new SQLException(
+            "Illegal conversion to Date from column " + columnIndex + " [" + 
obj + "]", e);
       }
-    } catch (Exception e) {
-      throw new KyuubiSQLException("Cannot convert column " + columnIndex + " 
to date: " + e, e);

Review Comment:
   it's horrible that the previously reported error message does not contain 
the illegal data!



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