Skip to content

Commit 25bfe09

Browse files
committed
Adding google code changes for core/src/main/java/org/opensearch/sql/analysis core/src/main/java/org/opensearch/sql/ast core/src/main/java/org/opensearch/sql/data
core/src/main/java/org/opensearch/sql/datasource Signed-off-by: Mitchell Gale <[email protected]>
1 parent af12c02 commit 25bfe09

File tree

111 files changed

+757
-1245
lines changed

Some content is hidden

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

111 files changed

+757
-1245
lines changed

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

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
76
package org.opensearch.sql.analysis;
87

98
import java.util.ArrayList;
@@ -13,26 +12,22 @@
1312
import org.opensearch.sql.expression.NamedExpression;
1413
import org.opensearch.sql.expression.function.FunctionProperties;
1514

16-
/**
17-
* The context used for Analyzer.
18-
*/
15+
/** The context used for Analyzer. */
1916
public class AnalysisContext {
20-
/**
21-
* Environment stack for symbol scope management.
22-
*/
17+
/** Environment stack for symbol scope management. */
2318
private TypeEnvironment environment;
24-
@Getter
25-
private final List<NamedExpression> namedParseExpressions;
2619

27-
@Getter
28-
private final FunctionProperties functionProperties;
20+
@Getter private final List<NamedExpression> namedParseExpressions;
21+
22+
@Getter private final FunctionProperties functionProperties;
2923

3024
public AnalysisContext() {
3125
this(new TypeEnvironment(null));
3226
}
3327

3428
/**
3529
* Class CTOR.
30+
*
3631
* @param environment Env to set to a new instance.
3732
*/
3833
public AnalysisContext(TypeEnvironment environment) {
@@ -41,9 +36,7 @@ public AnalysisContext(TypeEnvironment environment) {
4136
this.functionProperties = new FunctionProperties();
4237
}
4338

44-
/**
45-
* Push a new environment.
46-
*/
39+
/** Push a new environment. */
4740
public void push() {
4841
environment = new TypeEnvironment(environment);
4942
}

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

Lines changed: 120 additions & 122 deletions
Large diffs are not rendered by default.

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

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@
77

88
package org.opensearch.sql.analysis;
99

10-
import com.google.common.collect.ImmutableSet;
1110
import java.util.List;
12-
import java.util.Set;
13-
import java.util.stream.Collectors;
14-
import org.opensearch.sql.ast.expression.QualifiedName;
1511
import org.opensearch.sql.datasource.DataSourceService;
16-
import org.opensearch.sql.datasource.model.DataSourceMetadata;
1712

1813
public class DataSourceSchemaIdentifierNameResolver {
1914

@@ -29,19 +24,17 @@ public class DataSourceSchemaIdentifierNameResolver {
2924
private static final String DOT = ".";
3025

3126
/**
32-
* Data model for capturing dataSourceName, schema and identifier from
33-
* fully qualifiedName. In the current state, it is used to capture
34-
* DataSourceSchemaTable name and DataSourceSchemaFunction in case of table
35-
* functions.
27+
* Data model for capturing dataSourceName, schema and identifier from fully qualifiedName. In the
28+
* current state, it is used to capture DataSourceSchemaTable name and DataSourceSchemaFunction in
29+
* case of table functions.
3630
*
3731
* @param dataSourceService {@link DataSourceService}.
38-
* @param parts parts of qualifiedName.
32+
* @param parts parts of qualifiedName.
3933
*/
40-
public DataSourceSchemaIdentifierNameResolver(DataSourceService dataSourceService,
41-
List<String> parts) {
34+
public DataSourceSchemaIdentifierNameResolver(
35+
DataSourceService dataSourceService, List<String> parts) {
4236
this.dataSourceService = dataSourceService;
43-
List<String> remainingParts
44-
= captureSchemaName(captureDataSourceName(parts));
37+
List<String> remainingParts = captureSchemaName(captureDataSourceName(parts));
4538
identifierName = String.join(DOT, remainingParts);
4639
}
4740

@@ -57,7 +50,6 @@ public String getSchemaName() {
5750
return schemaName;
5851
}
5952

60-
6153
// Capture datasource name and return remaining parts(schema name and table name)
6254
// from the fully qualified name.
6355
private List<String> captureDataSourceName(List<String> parts) {
@@ -74,12 +66,11 @@ private List<String> captureDataSourceName(List<String> parts) {
7466
private List<String> captureSchemaName(List<String> parts) {
7567
if (parts.size() > 1
7668
&& (DEFAULT_SCHEMA_NAME.equals(parts.get(0))
77-
|| INFORMATION_SCHEMA_NAME.contains(parts.get(0)))) {
69+
|| INFORMATION_SCHEMA_NAME.contains(parts.get(0)))) {
7870
schemaName = parts.get(0);
7971
return parts.subList(1, parts.size());
8072
} else {
8173
return parts;
8274
}
8375
}
84-
8576
}

0 commit comments

Comments
 (0)