kasakrisz commented on code in PR #4965:
URL: https://github.com/apache/hive/pull/4965#discussion_r1449052107


##########
hplsql/src/main/java/org/apache/hive/hplsql/Var.java:
##########
@@ -601,7 +601,11 @@ else if (type == Type.STRING) {
       return (String)value;
     }
     else if (type == Type.DATE) {
-      return ((Date)value).toString();
+      String date = ((Date)value).toString();
+      StringBuilder dateSB = new StringBuilder("DATE '");
+      dateSB.append(date);
+      dateSB.append("'");
+      return dateSB.toString();

Review Comment:
   This also works:
   ```
   return String str = String.format("DATE '%s'", value);
   ```



##########
hplsql/src/main/java/org/apache/hive/hplsql/Var.java:
##########
@@ -612,7 +616,10 @@ else if (type == Type.TIMESTAMP) {
       if (t.length() > len) {
         t = t.substring(0, len);
       }
-      return t;
+      StringBuilder tsSB = new StringBuilder("TIMESTAMP '");
+      tsSB.append(t);
+      tsSB.append("'");
+      return tsSB.toString();

Review Comment:
   nit:
   ```
   return String str = String.format("TIMESTAMP '%s'", value);
   ```



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