-
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.
Signed-off-by: Kacper Trochimiak <[email protected]>
- Loading branch information
1 parent
9fad78e
commit 49b964d
Showing
7 changed files
with
145 additions
and
0 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
70 changes: 70 additions & 0 deletions
70
ppl-spark-integration/src/main/java/org/opensearch/sql/ast/tree/Lookup.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,70 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.ast.tree; | ||
|
||
import com.google.common.collect.ImmutableList; | ||
import org.opensearch.sql.ast.AbstractNodeVisitor; | ||
import org.opensearch.sql.ast.expression.Argument; | ||
import org.opensearch.sql.ast.expression.Map; | ||
|
||
import java.util.List; | ||
|
||
/** AST node represent Lookup operation. */ | ||
|
||
public class Lookup extends UnresolvedPlan { | ||
private UnresolvedPlan child; | ||
private final String indexName; | ||
private final List<Map> matchFieldList; | ||
private final List<Argument> options; | ||
private final List<Map> copyFieldList; | ||
|
||
public Lookup(UnresolvedPlan child, String indexName, List<Map> matchFieldList, List<Argument> options, List<Map> copyFieldList) { | ||
this.child = child; | ||
this.indexName = indexName; | ||
this.matchFieldList = matchFieldList; | ||
this.options = options; | ||
this.copyFieldList = copyFieldList; | ||
} | ||
|
||
public Lookup(String indexName, List<Map> matchFieldList, List<Argument> options, List<Map> copyFieldList) { | ||
this.indexName = indexName; | ||
this.matchFieldList = matchFieldList; | ||
this.options = options; | ||
this.copyFieldList = copyFieldList; | ||
} | ||
|
||
@Override | ||
public Lookup attach(UnresolvedPlan child) { | ||
this.child = child; | ||
return this; | ||
} | ||
|
||
public String getIndexName() { | ||
return indexName; | ||
} | ||
|
||
public List<Map> getMatchFieldList() { | ||
return matchFieldList; | ||
} | ||
|
||
public List<Argument> getOptions() { | ||
return options; | ||
} | ||
|
||
public List<Map> getCopyFieldList() { | ||
return copyFieldList; | ||
} | ||
|
||
@Override | ||
public List<UnresolvedPlan> getChild() { | ||
return ImmutableList.of(this.child); | ||
} | ||
|
||
@Override | ||
public <T, C> T accept(AbstractNodeVisitor<T, C> nodeVisitor, C context) { | ||
return nodeVisitor.visitLookup(this, context); | ||
} | ||
} |
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