Skip to content

Commit 70e368d

Browse files
committed
merge from main
Signed-off-by: xinyual <xinyual@amazon.com>
2 parents 4c281cc + 279eb67 commit 70e368d

159 files changed

Lines changed: 6877 additions & 328 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/maven-publish.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ on:
55
push:
66
branches:
77
- main
8-
- 1.*
9-
- 2.*
8+
- '[0-9]+.[0-9]+'
9+
- '[0-9]+.x'
1010

1111
env:
12-
SNAPSHOT_REPO_URL: https://central.sonatype.com/repository/maven-snapshots/
12+
SNAPSHOT_REPO_URL: https://ci.opensearch.org/ci/dbc/snapshots/maven/
1313

1414
jobs:
1515
build-and-publish-snapshots:
@@ -35,9 +35,13 @@ jobs:
3535
export-env: true
3636
env:
3737
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
38-
SONATYPE_USERNAME: op://opensearch-infra-secrets/maven-central-portal-credentials/username
39-
SONATYPE_PASSWORD: op://opensearch-infra-secrets/maven-central-portal-credentials/password
40-
38+
MAVEN_SNAPSHOTS_S3_REPO: op://opensearch-infra-secrets/maven-snapshots-s3/repo
39+
MAVEN_SNAPSHOTS_S3_ROLE: op://opensearch-infra-secrets/maven-snapshots-s3/role
40+
- name: Configure AWS credentials
41+
uses: aws-actions/configure-aws-credentials@v5
42+
with:
43+
role-to-assume: ${{ env.MAVEN_SNAPSHOTS_S3_ROLE }}
44+
aws-region: us-east-1
4145
- name: publish snapshots to maven
4246
run: |
43-
./gradlew publishPluginZipPublicationToSnapshotsRepository
47+
./gradlew publishPluginZipPublicationToSnapshotsRepository

.github/workflows/stalled.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ jobs:
2121
with:
2222
repo-token: ${{ steps.github_app_token.outputs.token }}
2323
stale-pr-label: 'stalled'
24-
stale-pr-message: 'This PR is stalled because it has been open for 30 days with no activity.'
25-
days-before-pr-stale: 30
24+
stale-pr-message: 'This PR is stalled because it has been open for 2 weeks with no activity.'
25+
days-before-pr-stale: 14
2626
days-before-issue-stale: -1
2727
days-before-pr-close: -1
2828
days-before-issue-close: -1
29+
exempt-draft-pr: true

async-query-core/src/main/java/org/opensearch/sql/spark/data/constants/SparkConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public class SparkConstants {
7272
public static final String PPL_STANDALONE_PACKAGE =
7373
"org.opensearch:opensearch-spark-ppl_2.12:0.3.0-SNAPSHOT";
7474
public static final String AWS_SNAPSHOT_REPOSITORY =
75-
"https://central.sonatype.com/repository/maven-snapshots/";
75+
"https://ci.opensearch.org/ci/dbc/snapshots/maven/";
7676
public static final String GLUE_HIVE_CATALOG_FACTORY_CLASS =
7777
"com.amazonaws.glue.catalog.metastore.AWSGlueDataCatalogHiveClientFactory";
7878
public static final String FLINT_DELEGATE_CATALOG =

async-query-core/src/test/java/org/opensearch/sql/spark/dispatcher/SparkQueryDispatcherTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ private String constructExpectedSparkSubmitParameterString(
981981
"spark.hadoop.fs.s3.customAWSCredentialsProvider=com.amazonaws.emr.AssumeRoleAWSCredentialsProvider",
982982
"spark.hadoop.aws.catalog.credentials.provider.factory.class=com.amazonaws.glue.catalog.metastore.STSAssumeRoleSessionCredentialsProviderFactory",
983983
"spark.jars.packages=org.opensearch:opensearch-spark-standalone_2.12:0.3.0-SNAPSHOT,org.opensearch:opensearch-spark-sql-application_2.12:0.3.0-SNAPSHOT,org.opensearch:opensearch-spark-ppl_2.12:0.3.0-SNAPSHOT",
984-
"spark.jars.repositories=https://central.sonatype.com/repository/maven-snapshots/",
984+
"spark.jars.repositories=https://ci.opensearch.org/ci/dbc/snapshots/maven/",
985985
"spark.emr-serverless.driverEnv.JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto.x86_64/",
986986
"spark.executorEnv.JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto.x86_64/",
987987
"spark.emr-serverless.driverEnv.FLINT_CLUSTER_NAME=TEST_CLUSTER",

build.gradle

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
buildscript {
88
ext {
9-
opensearch_version = System.getProperty("opensearch.version", "3.3.0-SNAPSHOT")
9+
opensearch_version = System.getProperty("opensearch.version", "3.4.0-SNAPSHOT")
1010
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
1111
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
1212
version_tokens = opensearch_version.tokenize('-')
@@ -67,8 +67,7 @@ buildscript {
6767
repositories {
6868
mavenLocal()
6969
mavenCentral()
70-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
71-
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/" }
70+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
7271
}
7372

7473
dependencies {
@@ -93,9 +92,8 @@ apply plugin: 'opensearch.java-agent'
9392
repositories {
9493
mavenLocal()
9594
mavenCentral() // For Elastic Libs that you can use to get started coding until open OpenSearch libs are available
96-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
95+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
9796
maven { url 'https://jitpack.io' }
98-
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/" }
9997
}
10098

10199
spotless {
@@ -158,9 +156,9 @@ subprojects {
158156
repositories {
159157
mavenLocal()
160158
mavenCentral()
161-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
159+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
160+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/lucene/" }
162161
maven { url 'https://jitpack.io' }
163-
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/" }
164162
}
165163
}
166164

common/src/main/java/org/opensearch/sql/common/setting/Settings.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public enum Key {
3333
PPL_REX_MAX_MATCH_LIMIT("plugins.ppl.rex.max_match.limit"),
3434
PPL_VALUES_MAX_LIMIT("plugins.ppl.values.max.limit"),
3535
PPL_SYNTAX_LEGACY_PREFERRED("plugins.ppl.syntax.legacy.preferred"),
36+
PPL_SUBSEARCH_MAXOUT("plugins.ppl.subsearch.maxout"),
37+
PPL_JOIN_SUBSEARCH_MAXOUT("plugins.ppl.join.subsearch_maxout"),
3638

3739
/** Enable Calcite as execution engine */
3840
CALCITE_ENGINE_ENABLED("plugins.calcite.enabled"),
@@ -48,6 +50,8 @@ public enum Key {
4850
/** Common Settings for SQL and PPL. */
4951
QUERY_MEMORY_LIMIT("plugins.query.memory_limit"),
5052
QUERY_SIZE_LIMIT("plugins.query.size_limit"),
53+
QUERY_BUCKET_SIZE("plugins.query.buckets"),
54+
SEARCH_MAX_BUCKETS("search.max_buckets"),
5155
ENCYRPTION_MASTER_KEY("plugins.query.datasources.encryption.masterkey"),
5256
DATASOURCES_URI_HOSTS_DENY_LIST("plugins.query.datasources.uri.hosts.denylist"),
5357
DATASOURCES_LIMIT("plugins.query.datasources.limit"),

core/src/main/java/org/opensearch/sql/analysis/Analyzer.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
import org.opensearch.sql.ast.tree.Relation;
8787
import org.opensearch.sql.ast.tree.RelationSubquery;
8888
import org.opensearch.sql.ast.tree.Rename;
89+
import org.opensearch.sql.ast.tree.Replace;
8990
import org.opensearch.sql.ast.tree.Reverse;
9091
import org.opensearch.sql.ast.tree.Rex;
9192
import org.opensearch.sql.ast.tree.SPath;
@@ -802,6 +803,11 @@ public LogicalPlan visitCloseCursor(CloseCursor closeCursor, AnalysisContext con
802803
return new LogicalCloseCursor(closeCursor.getChild().get(0).accept(this, context));
803804
}
804805

806+
@Override
807+
public LogicalPlan visitReplace(Replace node, AnalysisContext context) {
808+
throw getOnlyForCalciteException("Replace");
809+
}
810+
805811
@Override
806812
public LogicalPlan visitJoin(Join node, AnalysisContext context) {
807813
throw getOnlyForCalciteException("Join");

core/src/main/java/org/opensearch/sql/ast/AbstractNodeVisitor.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
import org.opensearch.sql.ast.tree.Relation;
7575
import org.opensearch.sql.ast.tree.RelationSubquery;
7676
import org.opensearch.sql.ast.tree.Rename;
77+
import org.opensearch.sql.ast.tree.Replace;
7778
import org.opensearch.sql.ast.tree.Reverse;
7879
import org.opensearch.sql.ast.tree.Rex;
7980
import org.opensearch.sql.ast.tree.SPath;
@@ -250,6 +251,10 @@ public T visitRename(Rename node, C context) {
250251
return visitChildren(node, context);
251252
}
252253

254+
public T visitReplace(Replace node, C context) {
255+
return visitChildren(node, context);
256+
}
257+
253258
public T visitEval(Eval node, C context) {
254259
return visitChildren(node, context);
255260
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
* Copyright OpenSearch Contributors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package org.opensearch.sql.ast.tree;
7+
8+
import com.google.common.collect.ImmutableList;
9+
import java.util.List;
10+
import java.util.Set;
11+
import lombok.EqualsAndHashCode;
12+
import lombok.Getter;
13+
import lombok.Setter;
14+
import lombok.ToString;
15+
import org.jetbrains.annotations.Nullable;
16+
import org.opensearch.sql.ast.AbstractNodeVisitor;
17+
import org.opensearch.sql.ast.expression.Field;
18+
19+
@Getter
20+
@Setter
21+
@ToString
22+
@EqualsAndHashCode(callSuper = false)
23+
public class Replace extends UnresolvedPlan {
24+
private final List<ReplacePair> replacePairs;
25+
private final Set<Field> fieldList;
26+
@Nullable private UnresolvedPlan child;
27+
28+
/**
29+
* Constructor with multiple pattern/replacement pairs.
30+
*
31+
* @param replacePairs List of pattern/replacement pairs
32+
* @param fieldList Set of fields to apply replacements to
33+
*/
34+
public Replace(List<ReplacePair> replacePairs, Set<Field> fieldList) {
35+
this.replacePairs = replacePairs;
36+
this.fieldList = fieldList;
37+
}
38+
39+
@Override
40+
public Replace attach(UnresolvedPlan child) {
41+
if (null == this.child) {
42+
this.child = child;
43+
} else {
44+
this.child.attach(child);
45+
}
46+
return this;
47+
}
48+
49+
@Override
50+
public List<UnresolvedPlan> getChild() {
51+
return this.child == null ? ImmutableList.of() : ImmutableList.of(this.child);
52+
}
53+
54+
@Override
55+
public <T, C> T accept(AbstractNodeVisitor<T, C> nodeVisitor, C context) {
56+
return nodeVisitor.visitReplace(this, context);
57+
}
58+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright OpenSearch Contributors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package org.opensearch.sql.ast.tree;
7+
8+
import lombok.AllArgsConstructor;
9+
import lombok.EqualsAndHashCode;
10+
import lombok.Getter;
11+
import lombok.ToString;
12+
import org.opensearch.sql.ast.expression.Literal;
13+
14+
/** A pair of pattern and replacement literals for the Replace command. */
15+
@Getter
16+
@AllArgsConstructor
17+
@EqualsAndHashCode
18+
@ToString
19+
public class ReplacePair {
20+
private final Literal pattern;
21+
private final Literal replacement;
22+
}

0 commit comments

Comments
 (0)