beliefer commented on code in PR #36330:
URL: https://github.com/apache/spark/pull/36330#discussion_r857208110


##########
sql/catalyst/src/main/java/org/apache/spark/sql/connector/util/V2ExpressionSQLBuilder.java:
##########
@@ -228,4 +238,21 @@ protected String visitSQLFunction(String funcName, 
String[] inputs) {
   protected String visitUnexpectedExpr(Expression expr) throws 
IllegalArgumentException {
     throw new IllegalArgumentException("Unexpected V2 expression: " + expr);
   }
+
+  protected String visitOverlayExpr(String funcName, String[] inputs) {
+    if (inputs.length <= 3) {
+      return funcName + "(" + inputs[0] + " PLACING " + inputs[1] + " FROM " + 
inputs[2] +")";
+    } else {
+      return funcName + "(" + inputs[0] + " PLACING " + inputs[1] + " FROM " + 
inputs[2] +
+              " FOR " + inputs[3] +")";
+    }
+  }
+
+  protected String visitTrimExpr(String funcName, String[] inputs) {
+    if (inputs.length <= 1) {
+      return funcName + "(" + inputs[0] + ")";
+    } else {
+      return funcName + "(" + inputs[1] + " FROM " + inputs[0] +")";

Review Comment:
   Could you investigate the implement of Trim from syntax?



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