cloud-fan commented on a change in pull request #26763: [SPARK-30125][SQL] Remove PostgreSQL dialect URL: https://github.com/apache/spark/pull/26763#discussion_r355485349
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala ########## @@ -287,7 +286,7 @@ class Analyzer( case (_, CalendarIntervalType) => Cast(TimeSub(l, r), l.dataType) case (TimestampType, _) => SubtractTimestamps(l, r) case (_, TimestampType) => SubtractTimestamps(l, r) - case (_, DateType) => if (conf.usePostgreSQLDialect) { + case (_, DateType) => if (conf.ansiEnabled) { Review comment: Actually `SubtractDates` is the ansi behavior. Since `date - date` is newly added in 3.0 (see https://issues.apache.org/jira/browse/SPARK-27898), we can just change this to `case (_, DateType) => SubtractDates(l, r)` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org