Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
4188dac
[Feature] implement transpose command as in the roadmap #4786 (#5011)
asifabashar Jan 27, 2026
7630db8
Adopt appendcol, appendpipe, multisearch to spath (#5075)
ykmr1224 Jan 27, 2026
92e73ea
Feature/mvcombine (#5025)
srikanthpadakanti Jan 28, 2026
4b785b0
Move Calcite-only tests from CrossClusterSearchIT to CalciteCrossClus…
yuancu Jan 29, 2026
f83d89d
Add 3.5 Release Notes (#5092)
mengweieric Jan 30, 2026
914de99
Fix issue connecting with prometheus by wrapping with AccessControlle…
cwperks Feb 2, 2026
9886100
Fix the filter of integTestWithSecurity (#5098)
LantaoJin Feb 3, 2026
a1bb9ba
[CVE-2026-24400] Upgrade assertj-core to 3.27.7 (#5100)
RyanL1997 Feb 3, 2026
8073b4e
Another TCPH fix: Wait for all shards (#5106)
Swiddis Feb 3, 2026
d02ff60
fielfformat changes
asifabashar Jan 14, 2026
3c62d86
added field format with concatenation of string , added more examples
asifabashar Jan 24, 2026
553ffa7
added field format with concatenation of string , added more examples
asifabashar Jan 24, 2026
36085f5
ci failure fix test
asifabashar Jan 26, 2026
c08beda
ci failure fix test
asifabashar Jan 26, 2026
faaf0f9
ci failure fix test
asifabashar Jan 26, 2026
b6e8965
ci failure fix test
asifabashar Jan 27, 2026
330cfc0
added missing test files
asifabashar Jan 27, 2026
d853f36
added missing test files
asifabashar Jan 27, 2026
c74151d
doc fix
asifabashar Jan 27, 2026
6c93ebe
doc fix
asifabashar Jan 27, 2026
239df5a
doc fix
asifabashar Jan 27, 2026
be0d82b
added test
asifabashar Jan 27, 2026
090bea7
[Feature] implement transpose command as in the roadmap #4786 (#5011)
asifabashar Jan 27, 2026
fcd0f87
added test
asifabashar Jan 27, 2026
1ff53f6
[Feature] implement transpose command as in the roadmap #4786 (#5011)
asifabashar Jan 27, 2026
4fc4113
fielfformat changes
asifabashar Jan 14, 2026
43ec5c9
added field format with concatenation of string , added more examples
asifabashar Jan 24, 2026
90c88fc
added test
asifabashar Jan 27, 2026
8725e4d
[Feature] implement transpose command as in the roadmap #4786 (#5011)
asifabashar Jan 27, 2026
3e3908f
added test
asifabashar Jan 27, 2026
99673af
merge from main
asifabashar Jan 27, 2026
8ead775
merge conflict issues
asifabashar Jan 27, 2026
538efac
merge conflict issues
asifabashar Jan 27, 2026
8ec8887
doc fix
asifabashar Jan 27, 2026
c57b38f
test fix
asifabashar Jan 27, 2026
2f6cd1a
test fix
asifabashar Jan 27, 2026
7b05103
coderabbit recommendations
asifabashar Jan 28, 2026
ffd33bd
resolve conflicts
asifabashar Jan 28, 2026
494df1d
resolve conflicts
asifabashar Jan 28, 2026
7543224
resolve conflicts
asifabashar Jan 28, 2026
1a5d916
resolve conflicts
asifabashar Jan 28, 2026
54b3a06
resolve conflicts
asifabashar Jan 28, 2026
f5703a4
removed ambigous sentence
asifabashar Jan 30, 2026
72bef4b
added missing test files
asifabashar Jan 27, 2026
b9b2908
spotlessApply
asifabashar Feb 3, 2026
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 common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies {
implementation "com.github.seancfoley:ipaddress:5.4.2"

testImplementation group: 'junit', name: 'junit', version: '4.13.2'
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.9.1'
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.27.7'
testImplementation group: 'com.google.guava', name: 'guava', version: "${guava_version}"
testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: "${hamcrest_version}"
testImplementation('org.junit.jupiter:junit-jupiter:5.9.3')
Expand Down
18 changes: 18 additions & 0 deletions core/src/main/java/org/opensearch/sql/analysis/Analyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
import org.opensearch.sql.ast.tree.Lookup;
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.Paginate;
import org.opensearch.sql.ast.tree.Parse;
import org.opensearch.sql.ast.tree.Patterns;
Expand All @@ -99,6 +100,7 @@
import org.opensearch.sql.ast.tree.StreamWindow;
import org.opensearch.sql.ast.tree.SubqueryAlias;
import org.opensearch.sql.ast.tree.TableFunction;
import org.opensearch.sql.ast.tree.Transpose;
import org.opensearch.sql.ast.tree.Trendline;
import org.opensearch.sql.ast.tree.UnresolvedPlan;
import org.opensearch.sql.ast.tree.Values;
Expand Down Expand Up @@ -524,6 +526,12 @@ public LogicalPlan visitEval(Eval node, AnalysisContext context) {
return new LogicalEval(child, expressionsBuilder.build());
}

/** Build {@link LogicalEval}. */
@Override
public LogicalPlan visitFieldFormat(Eval node, AnalysisContext context) {
throw getOnlyForCalciteException("fieldformat");
}

@Override
public LogicalPlan visitAddTotals(AddTotals node, AnalysisContext context) {
throw getOnlyForCalciteException("addtotals");
Expand All @@ -534,6 +542,11 @@ public LogicalPlan visitAddColTotals(AddColTotals node, AnalysisContext context)
throw getOnlyForCalciteException("addcoltotals");
}

@Override
public LogicalPlan visitMvCombine(MvCombine node, AnalysisContext context) {
throw getOnlyForCalciteException("mvcombine");
}

/** Build {@link ParseExpression} to context and skip to child nodes. */
@Override
public LogicalPlan visitParse(Parse node, AnalysisContext context) {
Expand Down Expand Up @@ -704,6 +717,11 @@ public LogicalPlan visitML(ML node, AnalysisContext context) {
return new LogicalML(child, node.getArguments());
}

@Override
public LogicalPlan visitTranspose(Transpose node, AnalysisContext context) {
throw getOnlyForCalciteException("Transpose");
}

@Override
public LogicalPlan visitBin(Bin node, AnalysisContext context) {
throw getOnlyForCalciteException("Bin");
Expand Down
14 changes: 14 additions & 0 deletions core/src/main/java/org/opensearch/sql/ast/AbstractNodeVisitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
import org.opensearch.sql.ast.tree.Lookup;
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.Paginate;
import org.opensearch.sql.ast.tree.Parse;
import org.opensearch.sql.ast.tree.Patterns;
Expand All @@ -86,6 +87,7 @@
import org.opensearch.sql.ast.tree.StreamWindow;
import org.opensearch.sql.ast.tree.SubqueryAlias;
import org.opensearch.sql.ast.tree.TableFunction;
import org.opensearch.sql.ast.tree.Transpose;
import org.opensearch.sql.ast.tree.Trendline;
import org.opensearch.sql.ast.tree.Values;
import org.opensearch.sql.ast.tree.Window;
Expand Down Expand Up @@ -262,6 +264,10 @@ public T visitEval(Eval node, C context) {
return visitChildren(node, context);
}

public T visitFieldFormat(Eval node, C context) {
return visitChildren(node, context);
}

public T visitParse(Parse node, C context) {
return visitChildren(node, context);
}
Expand All @@ -282,6 +288,10 @@ public T visitReverse(Reverse node, C context) {
return visitChildren(node, context);
}

public T visitTranspose(Transpose node, C context) {
return visitChildren(node, context);
}

public T visitChart(Chart node, C context) {
return visitChildren(node, context);
}
Expand Down Expand Up @@ -461,4 +471,8 @@ public T visitAddTotals(AddTotals node, C context) {
public T visitAddColTotals(AddColTotals node, C context) {
return visitChildren(node, context);
}

public T visitMvCombine(MvCombine node, C context) {
return visitChildren(node, context);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.opensearch.sql.ast.tree.Join;
import org.opensearch.sql.ast.tree.Lookup;
import org.opensearch.sql.ast.tree.Multisearch;
import org.opensearch.sql.ast.tree.MvCombine;
import org.opensearch.sql.ast.tree.Parse;
import org.opensearch.sql.ast.tree.Patterns;
import org.opensearch.sql.ast.tree.Project;
Expand All @@ -59,6 +60,7 @@
import org.opensearch.sql.ast.tree.Sort;
import org.opensearch.sql.ast.tree.StreamWindow;
import org.opensearch.sql.ast.tree.SubqueryAlias;
import org.opensearch.sql.ast.tree.Transpose;
import org.opensearch.sql.ast.tree.Trendline;
import org.opensearch.sql.ast.tree.UnresolvedPlan;
import org.opensearch.sql.ast.tree.Values;
Expand Down Expand Up @@ -349,12 +351,6 @@ public Node visitSearch(Search node, FieldResolutionContext context) {
return node;
}

@Override
public Node visitAppendPipe(AppendPipe node, FieldResolutionContext context) {
visitChildren(node, context);
return node;
}

@Override
public Node visitRegex(Regex node, FieldResolutionContext context) {
Set<String> regexFields = extractFieldsFromExpression(node.getField());
Expand Down Expand Up @@ -507,8 +503,10 @@ public Node visitFillNull(FillNull node, FieldResolutionContext context) {

@Override
public Node visitAppendCol(AppendCol node, FieldResolutionContext context) {
throw new IllegalArgumentException(
"AppendCol command cannot be used together with spath command");
// dispatch requirements to subsearch and main
acceptAndVerifyNodeVisited(node.getSubSearch(), context);
visitChildren(node, context);
return node;
}

@Override
Expand All @@ -520,9 +518,10 @@ public Node visitAppend(Append node, FieldResolutionContext context) {
}

@Override
public Node visitMultisearch(Multisearch node, FieldResolutionContext context) {
throw new IllegalArgumentException(
"Multisearch command cannot be used together with spath command");
public Node visitAppendPipe(AppendPipe node, FieldResolutionContext context) {
acceptAndVerifyNodeVisited(node.getSubQuery(), context);
visitChildren(node, context);
return node;
}

@Override
Expand All @@ -532,7 +531,16 @@ public Node visitLookup(Lookup node, FieldResolutionContext context) {

@Override
public Node visitValues(Values node, FieldResolutionContext context) {
throw new IllegalArgumentException("Values command cannot be used together with spath command");
// do nothing
return node;
}

@Override
public Node visitMultisearch(Multisearch node, FieldResolutionContext context) {
// dispatch requirements to subsearches and main
node.getSubsearches().forEach(subsearch -> acceptAndVerifyNodeVisited(subsearch, context));
visitChildren(node, context);
return node;
}

@Override
Expand Down Expand Up @@ -570,6 +578,12 @@ public Node visitTrendline(Trendline node, FieldResolutionContext context) {
return node;
}

@Override
public Node visitTranspose(Transpose node, FieldResolutionContext context) {
visitChildren(node, context);
return node;
}

@Override
public Node visitChart(Chart node, FieldResolutionContext context) {
Set<String> chartFields = extractFieldsFromAggregation(node.getAggregationFunction());
Expand Down Expand Up @@ -612,6 +626,12 @@ public Node visitAddColTotals(AddColTotals node, FieldResolutionContext context)
return node;
}

@Override
public Node visitFieldFormat(Eval node, FieldResolutionContext context) {
visitChildren(node, context);
return node;
}

@Override
public Node visitExpand(Expand node, FieldResolutionContext context) {
Set<String> expandFields = extractFieldsFromExpression(node.getField());
Expand All @@ -621,6 +641,22 @@ public Node visitExpand(Expand node, FieldResolutionContext context) {
return node;
}

@Override
public Node visitMvCombine(MvCombine node, FieldResolutionContext context) {
Set<String> mvCombineFields = extractFieldsFromExpression(node.getField());

FieldResolutionResult current = context.getCurrentRequirements();

Set<String> regularFields = new HashSet<>(current.getRegularFields());
regularFields.addAll(mvCombineFields);

context.pushRequirements(new FieldResolutionResult(regularFields, Set.of(ALL_FIELDS)));

visitChildren(node, context);
context.popRequirements();
return node;
}

private Set<String> extractFieldsFromAggregation(UnresolvedExpression expr) {
Set<String> fields = new HashSet<>();
if (expr instanceof Alias alias) {
Expand Down
9 changes: 9 additions & 0 deletions core/src/main/java/org/opensearch/sql/ast/dsl/AstDSL.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
import org.opensearch.sql.ast.tree.Head;
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.Parse;
import org.opensearch.sql.ast.tree.Patterns;
import org.opensearch.sql.ast.tree.Project;
Expand Down Expand Up @@ -468,6 +469,14 @@ public static List<Argument> defaultDedupArgs() {
argument("consecutive", booleanLiteral(false)));
}

public static MvCombine mvcombine(Field field) {
return new MvCombine(field, null);
}

public static MvCombine mvcombine(Field field, String delim) {
return new MvCombine(field, delim);
}

public static List<Argument> sortOptions() {
return exprList(argument("desc", booleanLiteral(false)));
}
Expand Down
17 changes: 17 additions & 0 deletions core/src/main/java/org/opensearch/sql/ast/expression/Let.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
public class Let extends UnresolvedExpression {
private final Field var;
private final UnresolvedExpression expression;
private final Literal concatPrefix;
private final Literal concatSuffix;

public Let(Field var, UnresolvedExpression expression) {
String varName = var.getField().toString();
Expand All @@ -29,6 +31,21 @@ public Let(Field var, UnresolvedExpression expression) {
}
this.var = var;
this.expression = expression;
this.concatPrefix = null;
this.concatSuffix = null;
}

public Let(
Field var, UnresolvedExpression expression, Literal concatPrefix, Literal concatSuffix) {
String varName = var.getField().toString();
if (OpenSearchConstants.METADATAFIELD_TYPE_MAP.containsKey(varName)) {
throw new IllegalArgumentException(
String.format("Cannot use metadata field [%s] as the eval field.", varName));
}
this.var = var;
this.expression = expression;
this.concatPrefix = concatPrefix;
this.concatSuffix = concatSuffix;
}

@Override
Expand Down
45 changes: 45 additions & 0 deletions core/src/main/java/org/opensearch/sql/ast/tree/MvCombine.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

package org.opensearch.sql.ast.tree;

import com.google.common.collect.ImmutableList;
import java.util.List;
import javax.annotation.Nullable;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import org.opensearch.sql.ast.AbstractNodeVisitor;
import org.opensearch.sql.ast.expression.Field;

@Getter
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class MvCombine extends UnresolvedPlan {

private final Field field;
private final String delim;
@Nullable private UnresolvedPlan child;

public MvCombine(Field field, @Nullable String delim) {
this.field = field;
this.delim = (delim == null) ? " " : delim;
}

public MvCombine attach(UnresolvedPlan child) {
this.child = child;
return this;
}

@Override
public List<UnresolvedPlan> getChild() {
return child == null ? ImmutableList.of() : ImmutableList.of(child);
}

@Override
public <T, C> T accept(AbstractNodeVisitor<T, C> nodeVisitor, C context) {
return nodeVisitor.visitMvCombine(this, context);
}
}
Loading
Loading