Skip to content

Commit

Permalink
Update override option
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Kwok <[email protected]>
  • Loading branch information
andy-k-improving committed Dec 13, 2024
1 parent 25857f2 commit cba664d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ trendlineType
;

appendcolCommand
: APPENDCOL (OVERRIDE EQUAL booleanLiteral)? LT_SQR_PRTHS commands (PIPE commands)* RT_SQR_PRTHS
: APPENDCOL (OVERRIDE EQUAL override = booleanLiteral)? LT_SQR_PRTHS commands (PIPE commands)* RT_SQR_PRTHS
;

kmeansCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
@AllArgsConstructor
public class AppendCol extends UnresolvedPlan {

public boolean override = true;
public boolean override;

private UnresolvedPlan subSearch;

private UnresolvedPlan child;

public AppendCol(UnresolvedPlan subSearch) {
public AppendCol(UnresolvedPlan subSearch, boolean override) {
this.override = override;
this.subSearch = subSearch;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,10 @@ public UnresolvedPlan visitAppendcolCommand(OpenSearchPPLParser.AppendcolCommand
final Optional<UnresolvedPlan> pplCmd = ctx.commands().stream()
.map(this::visit)
.reduce((r, e) -> e.attach(r));
final boolean override = (ctx.override != null &&
Boolean.parseBoolean(ctx.override.getText()));
// ANTLR parser check guarantee pplCmd won't be null.
return new AppendCol(pplCmd.get());
return new AppendCol(pplCmd.get(), override);
}

private Trendline.TrendlineComputation toTrendlineComputation(OpenSearchPPLParser.TrendlineClauseContext ctx) {
Expand Down

0 comments on commit cba664d

Please sign in to comment.