cloud-fan commented on code in PR #36663:
URL: https://github.com/apache/spark/pull/36663#discussion_r910686772


##########
sql/catalyst/src/main/java/org/apache/spark/sql/connector/util/V2ExpressionSQLBuilder.java:
##########
@@ -290,4 +297,15 @@ protected String visitTrim(String direction, String[] 
inputs) {
       return "TRIM(" + direction + " " + inputs[1] + " FROM " + inputs[0] + 
")";
     }
   }
+
+  protected String visitExtract(String field, String source) {
+    switch (field) {
+      case "DAY_OF_WEEK":
+        return "(EXTRACT(ISO_DAY_OF_WEEK FROM " + source + ") % 7)+ 1";

Review Comment:
   the field names are already user-facing (DS v2 API). We should do the 
translation earlier, when converting catalyst expressions to v2 expressions.



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