yaooqinn commented on code in PR #50101: URL: https://github.com/apache/spark/pull/50101#discussion_r1974707704
########## sql/core/src/main/scala/org/apache/spark/sql/jdbc/PostgresDialect.scala: ########## @@ -303,12 +303,27 @@ private case class PostgresDialect() class PostgresSQLBuilder extends JDBCSQLBuilder { override def visitExtract(field: String, source: String): String = { - field match { - case "DAY_OF_YEAR" => s"EXTRACT(DOY FROM $source)" - case "YEAR_OF_WEEK" => s"EXTRACT(YEAR FROM $source)" - case "DAY_OF_WEEK" => s"EXTRACT(DOW FROM $source)" - case _ => super.visitExtract(field, source) + // SECOND, MINUTE, HOUR, QUARTER, YEAR, DAY are identical on postgres and spark + // MONTH is different, postgres returns 0-11, spark returns 1-12. Review Comment: Yeah, I believe they shall be identical as they all came from the work within the Postgres feature parity umbrella ticket. I appreciate the confirmation. -- 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