Skip to content

Commit

Permalink
Simplify Analyzer implementation
Browse files Browse the repository at this point in the history
Signed-off-by: currantw <[email protected]>
  • Loading branch information
currantw committed Feb 3, 2025
1 parent bf49974 commit 5bb0617
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions core/src/main/java/org/opensearch/sql/analysis/Analyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,6 @@ public LogicalPlan visitFlatten(Flatten node, AnalysisContext context) {
ReferenceExpression fieldExpr =
(ReferenceExpression) expressionAnalyzer.analyze(node.getField(), context);
String fieldName = fieldExpr.getAttr();
ExprType fieldType = fieldExpr.type();

// [A] Determine fields to add
// ---------------------------
Expand Down Expand Up @@ -545,7 +544,7 @@ public LogicalPlan visitFlatten(Flatten node, AnalysisContext context) {
env.define(DSL.ref(name, type));
}

return new LogicalFlatten(child, DSL.ref(fieldName, STRUCT));
return new LogicalFlatten(child, fieldExpr);
}

/** Build {@link ParseExpression} to context and skip to child nodes. */
Expand Down

0 comments on commit 5bb0617

Please sign in to comment.