Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,11 @@ public TypeEnvironment pop() {
environment = curEnv.getParent();
return curEnv;
}

/**
* Push a new isolated environment without parent access.
*/
public void pushIsolated() {
environment = new TypeEnvironment(null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ public LogicalPlan visitProject(Project node, AnalysisContext context) {

child = processNestedAnalysis(node.getProjectList(), namedExpressions, child, context);

context.push();
context.pushIsolated();
TypeEnvironment newEnv = context.peek();
namedExpressions.forEach(
expr ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -898,9 +898,6 @@ public void remove_source() {
AstDSL.field("double_value")));
}

@Disabled(
"the project/remove command should shrink the type env. Should be enabled once "
+ "https://github.com/opensearch-project/sql/issues/917 is resolved")
@Test
public void project_source_change_type_env() {
SemanticCheckException exception =
Expand Down
Loading