Skip to content

Commit

Permalink
fix ast_node_converter_test
Browse files Browse the repository at this point in the history
  • Loading branch information
aceforeverd committed Jun 17, 2022
1 parent 6da78e9 commit 61667ba
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions hybridse/src/planv2/ast_node_converter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -317,28 +317,26 @@ TEST_F(ASTNodeConverterTest, ConvertFrameNodeTest) {
zetasql::ASTWindowFrameExpr start;
zetasql::ASTWindowFrameExpr end;
start.set_boundary_type(zetasql::ASTWindowFrameExpr::BoundaryType::UNBOUNDED_PRECEDING);
start.set_boundary_type(zetasql::ASTWindowFrameExpr::BoundaryType::UNBOUNDED_FOLLOWING);
end.set_boundary_type(zetasql::ASTWindowFrameExpr::BoundaryType::CURRENT_ROW);
expression.AddChildren({&start, &end});
expression.set_unit(zetasql::ASTWindowFrame::RANGE);
dynamic_cast<zetasql::ASTNode*>(&expression)->InitFields();
node::FrameNode* output = nullptr;
base::Status status = ConvertFrameNode(&expression, &node_manager, &output);
ASSERT_TRUE(status.isOK());
ASSERT_TRUE(status.isOK()) << status;
}
{
zetasql::ASTWindowFrame expression;
zetasql::ASTWindowFrameExpr start;
zetasql::ASTWindowFrameExpr end;
start.set_boundary_type(zetasql::ASTWindowFrameExpr::BoundaryType::UNBOUNDED_PRECEDING);
start.set_boundary_type(zetasql::ASTWindowFrameExpr::BoundaryType::UNBOUNDED_FOLLOWING);
end.set_boundary_type(zetasql::ASTWindowFrameExpr::BoundaryType::CURRENT_ROW);
start.set_boundary_type(zetasql::ASTWindowFrameExpr::BoundaryType::CURRENT_ROW);
end.set_boundary_type(zetasql::ASTWindowFrameExpr::BoundaryType::UNBOUNDED_FOLLOWING);
expression.AddChildren({&start, &end});
expression.set_unit(zetasql::ASTWindowFrame::ROWS);
dynamic_cast<zetasql::ASTNode*>(&expression)->InitFields();
node::FrameNode* output = nullptr;
base::Status status = ConvertFrameNode(&expression, &node_manager, &output);
ASSERT_TRUE(status.isOK());
ASSERT_TRUE(status.isOK()) << status;
}
}

Expand Down

0 comments on commit 61667ba

Please sign in to comment.