ConeyLiu commented on code in PR #7898:
URL: https://github.com/apache/iceberg/pull/7898#discussion_r1252177250
##########
spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/SparkV2Filters.java:
##########
@@ -289,11 +311,23 @@ private static Object convertLiteral(Literal<?> literal) {
return literal.value();
}
- private static Expression handleEqual(String attribute, Object value) {
- if (NaNUtil.isNaN(value)) {
- return isNaN(attribute);
+ private static UnboundPredicate<Object> handleEqual(UnboundTerm<Object>
term, Object value) {
+ if (value == null) {
+ return isNull(term);
+ } else if (NaNUtil.isNaN(value)) {
+ return isNaN(term);
+ } else {
+ return equal(term, value);
+ }
+ }
+
+ private static UnboundPredicate<Object> handleNotEqual(UnboundTerm<Object>
term, Object value) {
+ if (value == null) {
+ return notNull(term);
Review Comment:
Sorry for missed that.
##########
spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/SparkV2Filters.java:
##########
@@ -289,11 +311,23 @@ private static Object convertLiteral(Literal<?> literal) {
return literal.value();
}
- private static Expression handleEqual(String attribute, Object value) {
- if (NaNUtil.isNaN(value)) {
- return isNaN(attribute);
+ private static UnboundPredicate<Object> handleEqual(UnboundTerm<Object>
term, Object value) {
+ if (value == null) {
+ return isNull(term);
+ } else if (NaNUtil.isNaN(value)) {
+ return isNaN(term);
+ } else {
+ return equal(term, value);
+ }
+ }
+
+ private static UnboundPredicate<Object> handleNotEqual(UnboundTerm<Object>
term, Object value) {
+ if (value == null) {
+ return notNull(term);
Review Comment:
Sorry for missing that. Updated.
--
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]