huaxingao commented on a change in pull request #33803:
URL: https://github.com/apache/spark/pull/33803#discussion_r695073099



##########
File path: 
sql/catalyst/src/main/java/org/apache/spark/sql/connector/expressions/filter/EqualNullSafe.java
##########
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.connector.expressions.filter;
+
+import org.apache.spark.annotation.Evolving;
+import org.apache.spark.sql.connector.expressions.Expression;
+import org.apache.spark.sql.connector.expressions.FieldReference;
+import org.apache.spark.sql.connector.expressions.NamedReference;
+
+/**
+ * Performs equality comparison, similar to [[EqualTo]]. However, this differs 
from [[EqualTo]]
+ * in that it returns `true` (rather than NULL) if both inputs are NULL, and 
`false`
+ * (rather than NULL) if one of the input is NULL and the other is not NULL.
+ *
+ * @since 3.3.0
+ */
+@Evolving
+public final class EqualNullSafe extends Filter {
+  private final FieldReference column;
+  private final Expression value;
+
+  public EqualNullSafe(FieldReference column, Expression value) {
+    this.column = column;
+    this.value = value;
+  }
+
+  public FieldReference column() { return column; }
+  public Expression value() { return value; }
+
+  @Override
+  public String toString() {
+    return column.describe() + " EqualNullSafe: (" + value.describe() + ")";

Review comment:
       Fixed

##########
File path: 
sql/catalyst/src/main/java/org/apache/spark/sql/connector/expressions/filter/EqualTo.java
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.connector.expressions.filter;
+
+import org.apache.spark.annotation.Evolving;
+import org.apache.spark.sql.connector.expressions.Expression;
+import org.apache.spark.sql.connector.expressions.FieldReference;
+import org.apache.spark.sql.connector.expressions.NamedReference;
+
+/**
+ * A filter that evaluates to `true` iff the field evaluates to a value
+ * equal to `value`.
+ *
+ * @since 3.3.0
+ */
+@Evolving
+public final class EqualTo extends Filter {
+  private final FieldReference column;
+  private final Expression value;
+
+  public EqualTo(FieldReference column, Expression value) {
+    this.column = column;
+    this.value = value;
+  }
+
+  public FieldReference column() { return column; }
+  public Expression value() { return value; }
+
+  @Override
+  public String toString() {
+    return column.describe() + " EqualTo: (" + value.describe() + ")";

Review comment:
       Fixed

##########
File path: 
sql/catalyst/src/main/java/org/apache/spark/sql/connector/expressions/filter/GreaterThan.java
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.connector.expressions.filter;
+
+import org.apache.spark.annotation.Evolving;
+import org.apache.spark.sql.connector.expressions.Expression;
+import org.apache.spark.sql.connector.expressions.FieldReference;
+import org.apache.spark.sql.connector.expressions.NamedReference;
+
+/**
+ * A filter that evaluates to `true` iff the field evaluates to a value
+ * greater than `value`.
+ *
+ * @since 3.3.0
+ */
+@Evolving
+public final class GreaterThan extends Filter {
+  private final FieldReference column;
+  private final Expression value;

Review comment:
       You are right, shouldn't have a nested filter this way. Changed the type 
to `Literal`.




-- 
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]

Reply via email to