Skip to content

Commit

Permalink
Fix name from uncategorized to other
Browse files Browse the repository at this point in the history
Signed-off-by: Tomoyuki Morita <[email protected]>
  • Loading branch information
ykmr1224 committed Feb 7, 2025
1 parent 33a4ded commit e6d794e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public enum FunctionType {
CSV("CSV"),
MISC("Misc"),
GENERATOR("Generator"),
UNCATEGORIZED("Uncategorized"),
OTHER("Other"),
UDF("User Defined Function");

private final String name;
Expand Down Expand Up @@ -424,7 +424,7 @@ public enum FunctionType {
"posexplode_outer",
"stack"))
.put(
UNCATEGORIZED,
OTHER,
Set.of(
"aggregate",
"array_size",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public enum SQLGrammarElement implements GrammarElement {
CSV_FUNCTIONS("CSV functions"),
GENERATOR_FUNCTIONS("Generator functions"),
MISC_FUNCTIONS("Misc functions"),
UNCATEGORIZED_FUNCTIONS("Uncategorized functions"),
OTHER_FUNCTIONS("Other functions"),

// UDF
UDF("User Defined functions");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,8 @@ private void validateFunctionAllowed(String functionName) {
case GENERATOR:
validateAllowed(SQLGrammarElement.GENERATOR_FUNCTIONS, lowerCaseFunctionName);
break;
case UNCATEGORIZED:
validateAllowed(SQLGrammarElement.UNCATEGORIZED_FUNCTIONS, lowerCaseFunctionName);
case OTHER:
validateAllowed(SQLGrammarElement.OTHER_FUNCTIONS, lowerCaseFunctionName);
break;
case UDF:
validateAllowed(SQLGrammarElement.UDF, lowerCaseFunctionName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public void test() {
assertEquals(FunctionType.MISC, FunctionType.fromFunctionName("version"));
assertEquals(FunctionType.GENERATOR, FunctionType.fromFunctionName("explode"));
assertEquals(FunctionType.GENERATOR, FunctionType.fromFunctionName("stack"));
assertEquals(FunctionType.UNCATEGORIZED, FunctionType.fromFunctionName("aggregate"));
assertEquals(FunctionType.UNCATEGORIZED, FunctionType.fromFunctionName("forall"));
assertEquals(FunctionType.OTHER, FunctionType.fromFunctionName("aggregate"));
assertEquals(FunctionType.OTHER, FunctionType.fromFunctionName("forall"));
assertEquals(FunctionType.UDF, FunctionType.fromFunctionName("unknown"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private enum TestElement {
// Generator Functions
GENERATOR_FUNCTIONS("SELECT explode(array(1, 2, 3));"),

// Ucategorized functions
// Other functions
NAMED_STRUCT("SELECT named_struct('a', 1);"),
PARSE_URL("SELECT parse_url(url) FROM my_table;"),

Expand Down Expand Up @@ -328,7 +328,7 @@ void testDenyAllValidator() {
// Generator Functions
v.ng(TestElement.GENERATOR_FUNCTIONS);

// Uncategorized Functions
// Other Functions
v.ng(TestElement.NAMED_STRUCT);
v.ng(TestElement.PARSE_URL);

Expand Down Expand Up @@ -449,7 +449,7 @@ void testS3glueQueries() {
// Generator Functions
v.ok(TestElement.GENERATOR_FUNCTIONS);

// Uncategorized Functions
// Other Functions
v.ok(TestElement.NAMED_STRUCT);
v.ok(TestElement.PARSE_URL);

Expand Down Expand Up @@ -639,7 +639,7 @@ void testException() {
when(mockedProvider.getValidatorForDatasource(any())).thenReturn(element -> false);
VerifyValidator v = new VerifyValidator(sqlQueryValidator, DataSourceType.S3GLUE);

v.ng("SELECT named_struct('a', 1);", "Uncategorized functions (named_struct) is not allowed.");
v.ng("SELECT named_struct('a', 1);", "Other functions (named_struct) is not allowed.");
}

@AllArgsConstructor
Expand Down

0 comments on commit e6d794e

Please sign in to comment.