Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion async-query-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ configurations {
}

dependencies {
antlr "org.antlr:antlr4:4.13.2"
antlr "org.antlr:antlr4:4.7.1"

implementation project(':core')
implementation 'org.json:json:20231013'
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

buildscript {
ext {
opensearch_version = System.getProperty("opensearch.version", "3.6.0-SNAPSHOT")
opensearch_version = System.getProperty("opensearch.version", "3.5.0-SNAPSHOT")
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
version_tokens = opensearch_version.tokenize('-')
Expand Down
2 changes: 1 addition & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ repositories {
}

dependencies {
api "org.antlr:antlr4-runtime:4.13.2"
api "org.antlr:antlr4-runtime:4.7.1"
api group: 'com.google.guava', name: 'guava', version: "${guava_version}"
api group: 'org.apache.logging.log4j', name: 'log4j-core', version:"${versions.log4j}"
api group: 'org.apache.commons', name: 'commons-lang3', version: "${commons_lang3_version}"
Expand Down
12 changes: 0 additions & 12 deletions core/src/main/java/org/opensearch/sql/analysis/Analyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@
import org.opensearch.sql.ast.tree.ML;
import org.opensearch.sql.ast.tree.Multisearch;
import org.opensearch.sql.ast.tree.MvCombine;
import org.opensearch.sql.ast.tree.MvExpand;
import org.opensearch.sql.ast.tree.NoMv;
import org.opensearch.sql.ast.tree.Paginate;
import org.opensearch.sql.ast.tree.Parse;
import org.opensearch.sql.ast.tree.Patterns;
Expand Down Expand Up @@ -549,16 +547,6 @@ public LogicalPlan visitMvCombine(MvCombine node, AnalysisContext context) {
throw getOnlyForCalciteException("mvcombine");
}

@Override
public LogicalPlan visitNoMv(NoMv node, AnalysisContext context) {
throw getOnlyForCalciteException("nomv");
}

@Override
public LogicalPlan visitMvExpand(MvExpand node, AnalysisContext context) {
throw getOnlyForCalciteException("mvexpand");
}

@Override
public LogicalPlan visitGraphLookup(GraphLookup node, AnalysisContext context) {
throw getOnlyForCalciteException("graphlookup");
Expand Down
10 changes: 0 additions & 10 deletions core/src/main/java/org/opensearch/sql/ast/AbstractNodeVisitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@
import org.opensearch.sql.ast.tree.ML;
import org.opensearch.sql.ast.tree.Multisearch;
import org.opensearch.sql.ast.tree.MvCombine;
import org.opensearch.sql.ast.tree.MvExpand;
import org.opensearch.sql.ast.tree.NoMv;
import org.opensearch.sql.ast.tree.Paginate;
import org.opensearch.sql.ast.tree.Parse;
import org.opensearch.sql.ast.tree.Patterns;
Expand Down Expand Up @@ -479,14 +477,6 @@ public T visitMvCombine(MvCombine node, C context) {
return visitChildren(node, context);
}

public T visitNoMv(NoMv node, C context) {
return visitChildren(node, context);
}

public T visitMvExpand(MvExpand node, C context) {
return visitChildren(node, context);
}

public T visitGraphLookup(GraphLookup node, C context) {
return visitChildren(node, context);
}
Expand Down
11 changes: 0 additions & 11 deletions core/src/main/java/org/opensearch/sql/ast/dsl/AstDSL.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
import org.opensearch.sql.ast.tree.Limit;
import org.opensearch.sql.ast.tree.MinSpanBin;
import org.opensearch.sql.ast.tree.MvCombine;
import org.opensearch.sql.ast.tree.MvExpand;
import org.opensearch.sql.ast.tree.Parse;
import org.opensearch.sql.ast.tree.Patterns;
import org.opensearch.sql.ast.tree.Project;
Expand Down Expand Up @@ -478,16 +477,6 @@ public static MvCombine mvcombine(Field field, String delim) {
return new MvCombine(field, delim);
}

/**
* Build an MVEXPAND plan node and attach it to the input plan.
*
* <p>`@param` input input plan `@param` field field to expand `@param` limit optional
* per-document limit `@return` MvExpand plan attached to the input
*/
public static UnresolvedPlan mvexpand(UnresolvedPlan input, Field field, Integer limit) {
return new MvExpand(field, limit).attach(input);
}

public static List<Argument> sortOptions() {
return exprList(argument("desc", booleanLiteral(false)));
}
Expand Down
46 changes: 0 additions & 46 deletions core/src/main/java/org/opensearch/sql/ast/tree/MvExpand.java

This file was deleted.

79 changes: 0 additions & 79 deletions core/src/main/java/org/opensearch/sql/ast/tree/NoMv.java

This file was deleted.

23 changes: 1 addition & 22 deletions core/src/main/java/org/opensearch/sql/ast/tree/SPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class SPath extends UnresolvedPlan {

@Nullable private final String outField;

@Nullable private final String path;
private final String path;

@Override
public UnresolvedPlan attach(UnresolvedPlan child) {
Expand All @@ -48,20 +48,7 @@ public <T, C> T accept(AbstractNodeVisitor<T, C> nodeVisitor, C context) {
return nodeVisitor.visitSpath(this, context);
}

/**
* Rewrites this spath node to an equivalent {@link Eval} node.
*
* <p>In path mode, rewrites to {@code eval output = json_extract(input, path)}. In auto-extract
* mode (path is null), rewrites to {@code eval output = json_extract_all(input)}.
*/
public Eval rewriteAsEval() {
if (path != null) {
return rewritePathMode();
}
return rewriteAutoExtractMode();
}

private Eval rewritePathMode() {
String outField = this.outField;
String unquotedPath = unquoteText(this.path);
if (outField == null) {
Expand All @@ -75,12 +62,4 @@ private Eval rewritePathMode() {
AstDSL.function(
"json_extract", AstDSL.field(inField), AstDSL.stringLiteral(unquotedPath))));
}

private Eval rewriteAutoExtractMode() {
String output = (outField != null) ? outField : inField;
return AstDSL.eval(
child,
AstDSL.let(
AstDSL.field(output), AstDSL.function("json_extract_all", AstDSL.field(inField))));
}
}
Loading
Loading