-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement SQL validation based on grammar element (#3039)
* Implement SQL validation based on grammar element Signed-off-by: Tomoyuki Morita <[email protected]> * Add function types Signed-off-by: Tomoyuki Morita <[email protected]> * fix style Signed-off-by: Tomoyuki Morita <[email protected]> * Add security lake Signed-off-by: Tomoyuki Morita <[email protected]> * Add File support Signed-off-by: Tomoyuki Morita <[email protected]> * Integrate into SparkQueryDispatcher Signed-off-by: Tomoyuki Morita <[email protected]> * Fix style Signed-off-by: Tomoyuki Morita <[email protected]> * Add tests Signed-off-by: Tomoyuki Morita <[email protected]> * Integration Signed-off-by: Tomoyuki Morita <[email protected]> * Add comments Signed-off-by: Tomoyuki Morita <[email protected]> * Address comments Signed-off-by: Tomoyuki Morita <[email protected]> * Allow join types for now Signed-off-by: Tomoyuki Morita <[email protected]> * Fix style Signed-off-by: Tomoyuki Morita <[email protected]> * Fix coverage check Signed-off-by: Tomoyuki Morita <[email protected]> --------- Signed-off-by: Tomoyuki Morita <[email protected]> (cherry picked from commit a87893a) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
a20f655
commit b9d7041
Showing
22 changed files
with
2,195 additions
and
192 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
13 changes: 13 additions & 0 deletions
13
...core/src/main/java/org/opensearch/sql/spark/validator/DefaultGrammarElementValidator.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,13 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.spark.validator; | ||
|
||
public class DefaultGrammarElementValidator implements GrammarElementValidator { | ||
@Override | ||
public boolean isValid(GrammarElement element) { | ||
return true; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...ore/src/main/java/org/opensearch/sql/spark/validator/DenyListGrammarElementValidator.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,19 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.spark.validator; | ||
|
||
import java.util.Set; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@RequiredArgsConstructor | ||
public class DenyListGrammarElementValidator implements GrammarElementValidator { | ||
private final Set<GrammarElement> denyList; | ||
|
||
@Override | ||
public boolean isValid(GrammarElement element) { | ||
return !denyList.contains(element); | ||
} | ||
} |
Oops, something went wrong.