You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "rdblue (via GitHub)" <gi...@apache.org> on 2023/06/27 16:24:34 UTC

[GitHub] [iceberg] rdblue commented on a diff in pull request #7898: Spark 3.4: Support NOT_EQ for V2 filters

rdblue commented on code in PR #7898:
URL: https://github.com/apache/iceberg/pull/7898#discussion_r1244025696


##########
spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/SparkV2Filters.java:
##########
@@ -152,31 +159,30 @@ public static Expression convert(Predicate predicate) {
           }
 
         case EQ: // used for both eq and null-safe-eq
-          Object value;
-          String columnName;
-          if (isRef(leftChild(predicate)) && isLiteral(rightChild(predicate))) {
-            columnName = SparkUtil.toColumnName(leftChild(predicate));
-            value = convertLiteral(rightChild(predicate));
-          } else if (isRef(rightChild(predicate)) && isLiteral(leftChild(predicate))) {
-            columnName = SparkUtil.toColumnName(rightChild(predicate));
-            value = convertLiteral(leftChild(predicate));
-          } else {
+          PredicateChildren<Object> eqChildren = predicateChildren(predicate);
+          if (eqChildren == null) {
             return null;
           }
 
-          if (predicate.name().equals(EQ)) {
-            // comparison with null in normal equality is always null. this is probably a mistake.
+          if (EQ.equals(predicate.name())) {
+            // comparison with null in normal equality is always null. this is probably a
+            // mistake.

Review Comment:
   Why did the formatting of this line change? It looks like it doesn't need to.



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org