Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Kernel][Expressions] Adds the IS_NULL expressions #2651

Merged
merged 5 commits into from
Feb 19, 2024

Conversation

tlm365
Copy link
Contributor

@tlm365 tlm365 commented Feb 17, 2024

Which Delta project/connector is this regarding?

  • Spark
  • Standalone
  • Flink
  • Kernel
  • Other (fill in here)

Description

Resolve #2632. Adds the IS NULL expressions.

How was this patch tested?

Adds unit test.

Signed-off-by: Tai Le Manh <manhtai.lmt@gmail.com>
Signed-off-by: Tai Le Manh <manhtai.lmt@gmail.com>
# Conflicts:
#	kernel/kernel-defaults/src/test/scala/io/delta/kernel/defaults/internal/expressions/DefaultExpressionEvaluatorSuite.scala
Copy link
Collaborator

@vkorukanti vkorukanti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great.

Minor comment. Ready to merge once resolved.

* <li>Name: <code>IS_NULL</code>
* <ul>
* <li>SQL semantic: <code>expr IS NULL</code></li>
* <li>Since version: 3.1.0</li>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* <li>Since version: 3.1.0</li>
* <li>Since version: 3.2.0</li>

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will go in next release version 3.2.0

@@ -232,6 +232,15 @@ ExpressionTransformResult visitIsNotNull(Predicate predicate) {
);
}

@Override
ExpressionTransformResult visitIsNull(Predicate predicate) {
Expression child = visit(predicate.getChildren().get(0)).expression;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Expression child = visit(predicate.getChildren().get(0)).expression;
Expression child = visit(getUnaryChild(predicate)).expression;

@@ -513,6 +522,16 @@ ColumnVector visitIsNotNull(Predicate predicate) {
);
}

@Override
ColumnVector visitIsNull(Predicate predicate) {
ColumnVector childResult = visit(childAt(predicate, 0));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ColumnVector childResult = visit(childAt(predicate, 0));
ColumnVector childResult = visit(getUnaryChild(predicate));

@tlm365
Copy link
Contributor Author

tlm365 commented Feb 19, 2024

Looks great.

Minor comment. Ready to merge once resolved.

@vkorukanti TYSM, I have resolved it.

@vkorukanti vkorukanti merged commit efc0e34 into delta-io:master Feb 19, 2024
6 checks passed
@tlm365 tlm365 deleted the is_null_expr branch February 23, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request][Kernel] Add support for IS_NULL expression
2 participants