LuciferYang commented on code in PR #37393:
URL: https://github.com/apache/spark/pull/37393#discussion_r937401762
##########
sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/SupportsDelete.java:
##########
@@ -70,6 +77,34 @@ default boolean canDeleteWhere(Filter[] filters) {
*/
void deleteWhere(Filter[] filters);
+ default boolean canDeleteWhere(Predicate[] predicates) {
+ List<Filter> filterList = new ArrayList();
+ for (int i = 0; i < predicates.length; i++) {
+ Option filter = PredicateUtils.toV1(predicates[i]);
+ if (filter.nonEmpty()) {
+ filterList.add((Filter)filter.get());
+ }
+ }
+
+ Filter[] filters = new Filter[filterList.size()];
+ filterList.toArray(filters);
+ return this.canDeleteWhere(filters);
+ }
+
+ default void deleteWhere(Predicate[] predicates) {
+ List<Filter> filterList = new ArrayList();
Review Comment:
line 95 ~ 104 looks like duplicated in `canDeleteWhere` ?
--
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]