cloud-fan commented on code in PR #36663:
URL: https://github.com/apache/spark/pull/36663#discussion_r911583956
##########
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:
Then I think `DAY_OF_WEEK` is fine. Different dialects must override it
anyway.
--
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]