cloud-fan commented on code in PR #36663:
URL: https://github.com/apache/spark/pull/36663#discussion_r911803758
##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala:
##########
@@ -270,6 +270,17 @@ abstract class JdbcDialect extends Serializable with
Logging{
s"${this.getClass.getSimpleName} does not support function: TRIM")
}
}
+
+ override def visitExtract(field: String, source: String): String = {
+ if (isSupportedFunction(field)) {
+ super.visitExtract(field, source)
+ } else {
+ // The framework will catch the error and give up the push-down.
+ // Please see `JdbcDialect.compileExpression(expr: Expression)` for
more details.
+ throw new UnsupportedOperationException(
Review Comment:
I think it makes sense to fail by default in `JDBCSQLBuilder`, because the
extract field names are so different in different databases.
--
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]