-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* isempty implementation Signed-off-by: Kacper Trochimiak <[email protected]> * isempty implementation v2 Signed-off-by: Kacper Trochimiak <[email protected]> * Is empty function returns correct column list. Signed-off-by: Lukasz Soszynski <[email protected]> * Tests for is empty function Signed-off-by: Lukasz Soszynski <[email protected]> * Test and documentation related to the isempty function Signed-off-by: Lukasz Soszynski <[email protected]> --------- Signed-off-by: Kacper Trochimiak <[email protected]> Signed-off-by: Lukasz Soszynski <[email protected]> Co-authored-by: Kacper Trochimiak <[email protected]>
- Loading branch information
1 parent
7ff1512
commit a7fe6e6
Showing
12 changed files
with
242 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
ppl-spark-integration/src/main/java/org/opensearch/sql/ast/expression/IsEmpty.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package org.opensearch.sql.ast.expression; | ||
|
||
import com.google.common.collect.ImmutableList; | ||
import org.opensearch.sql.ast.AbstractNodeVisitor; | ||
|
||
import java.util.List; | ||
|
||
public class IsEmpty extends UnresolvedExpression { | ||
private Case caseValue; | ||
|
||
public IsEmpty(Case caseValue) { | ||
this.caseValue = caseValue; | ||
} | ||
|
||
@Override | ||
public List<UnresolvedExpression> getChild() { | ||
return ImmutableList.of(this.caseValue); | ||
} | ||
|
||
@Override | ||
public <R, C> R accept(AbstractNodeVisitor<R, C> nodeVisitor, C context) { | ||
return nodeVisitor.visitIsEmpty(this, context); | ||
} | ||
|
||
public Case getCaseValue() { | ||
return caseValue; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return String.format( | ||
"isempty(%s)", | ||
caseValue.toString()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.