xianyinxin commented on a change in pull request #25115: [SPARK-28351][SQL]
Support DELETE in DataSource V2
URL: https://github.com/apache/spark/pull/25115#discussion_r303302094
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/sources/filters.scala
##########
@@ -163,6 +187,7 @@ case class IsNotNull(attribute: String) extends Filter {
*/
@Stable
case class And(left: Filter, right: Filter) extends Filter {
+ override def sql: String = s"${left.sql} AND ${right.sql}"
Review comment:
Thanks @HyukjinKwon .
1. Why this function is introduced:
sources.Filter is used for datasource to filter data, but before that,
datasource needs to understand the filters. Add 'sql' function here helps
datasources like JDBC can rebuild the sql string to filter data.
2. For case like `a OR b AND c`, the final expected filter should be `OR(a,
AND(b,c))`. The logic here indeed not well considered, including constants and
parentheses. Will submit a fix soon.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]