Skip to content

Commit 1d4de5a

Browse files
committed
Merge remote-tracking branch 'origin/main' into issues/4136
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
2 parents 7d7108e + 2ab5002 commit 1d4de5a

161 files changed

Lines changed: 2109 additions & 1067 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/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# This should match the owning team set up in https://github.com/orgs/opensearch-project/teams
2-
* @ps48 @kavithacm @derek-ho @joshuali925 @dai-chen @YANG-DB @mengweieric @vamsimanohar @swiddis @penghuo @seankao-az @MaxKsyunz @Yury-Fridlyand @anirudha @forestmvey @acarbonetto @GumpacG @ykmr1224 @LantaoJin @noCharger @qianheng-aws @yuancu
2+
* @ps48 @kavithacm @derek-ho @joshuali925 @dai-chen @YANG-DB @mengweieric @vamsimanohar @swiddis @penghuo @seankao-az @MaxKsyunz @Yury-Fridlyand @anirudha @forestmvey @acarbonetto @GumpacG @ykmr1224 @LantaoJin @noCharger @qianheng-aws @yuancu @RyanL1997

.github/workflows/integ-tests-with-security.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
paths:
1010
- 'integ-test/**'
1111
- '.github/workflows/integ-tests-with-security.yml'
12+
merge_group:
1213

1314
jobs:
1415
Get-CI-Image-Tag:

.github/workflows/sql-test-and-build-workflow.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
- '**/*.jar'
1717
- '**/*.pom'
1818
- '.github/workflows/sql-test-and-build-workflow.yml'
19+
merge_group:
1920

2021
jobs:
2122
Get-CI-Image-Tag:

.pre-commit-config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
- id: spotless-format
5+
name: Spotless Format
6+
entry: bash -c './gradlew spotlessApply && git add -u'
7+
language: system
8+
pass_filenames: false
9+
- id: spotless-check
10+
name: Spotless Post-format Check
11+
entry: bash -c './gradlew spotlessCheck'
12+
language: system
13+
pass_filenames: false

DEVELOPER_GUIDE.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ Here are other files and sub-folders that you are likely to touch:
173173
- ``build.gradle``: Gradle build script.
174174
- ``docs``: documentation for developers and reference manual for users.
175175
- ``doc-test``: code that run .rst docs in ``docs`` folder by Python doctest library.
176+
- ``language-grammar``: centralized package for ANTLR grammar files. See `Language Grammar Package`_ for details.
176177

177178
Note that other related project code has already merged into this single repository together:
178179

@@ -441,3 +442,29 @@ with an appropriate label `backport <backport-branch-name>` is merged to main wi
441442
PR. For example, if a PR on main needs to be backported to `1.x` branch, add a label `backport 1.x` to the PR and make sure the
442443
backport workflow runs on the PR along with other checks. Once this PR is merged to main, the workflow will create a backport PR
443444
to the `1.x` branch.
445+
446+
Language Grammar Package
447+
========================
448+
449+
The ``language-grammar`` package serves as a centralized repository for all ANTLR grammar files used throughout the OpenSearch SQL project. This package contains the definitive versions of grammar files for:
450+
451+
- SQL parsing (``OpenSearchSQLParser.g4``, ``OpenSearchSQLLexer.g4``)
452+
- PPL parsing (``OpenSearchPPLParser.g4``, ``OpenSearchPPLLexer.g4``)
453+
- Legacy SQL parsing (``OpenSearchLegacySqlParser.g4``, ``OpenSearchLegacySqlLexer.g4``)
454+
- Spark SQL extensions (``SparkSqlBase.g4``, ``FlintSparkSqlExtensions.g4``, ``SqlBaseParser.g4``, ``SqlBaseLexer.g4``)
455+
456+
Purpose
457+
-------
458+
459+
The language-grammar package enables sharing of grammar files between the main SQL repository and the Spark repository, ensuring consistency and reducing duplication. Once updated, the package automatically triggers CI to upload the new version to Maven Central for consumption by other projects.
460+
461+
Updating Grammar Files
462+
----------------------
463+
464+
When grammar files are modified in their respective modules (``sql/``, ``ppl/``, ``legacy/``, ``async-query-core/``), they must be manually copied to the ``language-grammar/src/main/antlr4/`` directory.
465+
466+
**Workflow:**
467+
468+
1. Modify grammar files in their source locations (e.g., ``sql/src/main/antlr/``)
469+
2. Copy updated files to ``language-grammar/src/main/antlr4/``
470+
3. Commit changes to trigger automatic Maven publication via CI

MAINTAINERS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This document contains a list of maintainers in this repo. See [opensearch-proje
55
## Current Maintainers
66

77
| Maintainer | GitHub ID | Affiliation |
8-
|-------------------|-----------------------------------------------------| ----------- |
8+
|-------------------|-----------------------------------------------------|-------------|
99
| Eric Wei | [mengweieric](https://github.com/mengweieric) | Amazon |
1010
| Joshua Li | [joshuali925](https://github.com/joshuali925) | Amazon |
1111
| Shenoy Pratik | [ps48](https://github.com/ps48) | Amazon |
@@ -23,6 +23,7 @@ This document contains a list of maintainers in this repo. See [opensearch-proje
2323
| Louis Chu | [noCharger](https://github.com/noCharger) | Amazon |
2424
| Heng Qian | [qianheng-aws](https://github.com/qianheng-aws) | Amazon |
2525
| Yuanchun Shen | [yuancu](https://github.com/yuancu) | Amazon |
26+
| Ryan Liang | [RyanL1997](https://github.com/RyanL1997) | Amazon |
2627
| Max Ksyunz | [MaxKsyunz](https://github.com/MaxKsyunz) | Improving |
2728
| Yury Fridlyand | [Yury-Fridlyand](https://github.com/Yury-Fridlyand) | Improving |
2829
| Andrew Carbonetto | [acarbonetto](https://github.com/acarbonetto) | Improving |

async-query-core/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
id "io.freefair.lombok"
99
id 'jacoco'
1010
id 'antlr'
11-
id 'com.diffplug.spotless' version '6.22.0'
11+
id 'com.diffplug.spotless'
1212
id 'com.gradleup.shadow'
1313
}
1414

build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ plugins {
8181
id 'java-library'
8282
id "io.freefair.lombok" version "8.14"
8383
id 'jacoco'
84-
id 'com.diffplug.spotless' version '6.22.0'
84+
id 'com.diffplug.spotless' version '7.2.1'
8585
}
8686

8787
// import versions defined in https://github.com/opensearch-project/OpenSearch/blob/main/buildSrc/src/main/java/org/opensearch/gradle/OpenSearchJavaPlugin.java#L94
@@ -105,10 +105,10 @@ spotless {
105105
exclude '**/build/**', '**/build-*/**', '**/gen/**'
106106
}
107107
importOrder()
108-
// licenseHeader("/*\n" +
109-
// " * Copyright OpenSearch Contributors\n" +
110-
// " * SPDX-License-Identifier: Apache-2.0\n" +
111-
// " */\n\n")
108+
licenseHeader("/*\n" +
109+
" * Copyright OpenSearch Contributors\n" +
110+
" * SPDX-License-Identifier: Apache-2.0\n" +
111+
" */\n\n")
112112
removeUnusedImports()
113113
trimTrailingWhitespace()
114114
endWithNewline()

common/build.gradle

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
plugins {
2626
id 'java-library'
2727
id "io.freefair.lombok"
28-
id 'com.diffplug.spotless' version '6.22.0'
28+
id 'com.diffplug.spotless'
2929
}
3030

3131
repositories {
@@ -73,11 +73,10 @@ spotless {
7373
exclude '**/build/**', '**/build-*/**'
7474
}
7575
importOrder()
76-
// Needs https://github.com/opensearch-project/sql/issues/1893 to be addressed first
77-
// licenseHeader("/*\n" +
78-
// " * Copyright OpenSearch Contributors\n" +
79-
// " * SPDX-License-Identifier: Apache-2.0\n" +
80-
// " */\n\n")
76+
licenseHeader("/*\n" +
77+
" * Copyright OpenSearch Contributors\n" +
78+
" * SPDX-License-Identifier: Apache-2.0\n" +
79+
" */\n\n")
8180
removeUnusedImports()
8281
trimTrailingWhitespace()
8382
endWithNewline()

common/src/main/java/org/opensearch/sql/common/antlr/Parser.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright OpenSearch Contributors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
package org.opensearch.sql.common.antlr;
27

38
import org.antlr.v4.runtime.tree.ParseTree;

0 commit comments

Comments
 (0)