chenzhx commented on code in PR #36663: URL: https://github.com/apache/spark/pull/36663#discussion_r910881528
########## 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: n different databases, the ISO_DAY_OF_WEEK is different. In postgresql uses `isodow `. In snowflake uses `dow_iso ` . In H2 uses `ISO_DAY_OF_WEEK `. -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org