Skip to content

Commit

Permalink
feat:add single party func ceil (#133)
Browse files Browse the repository at this point in the history
在SCQL中实现单方算子ceil 
Fixed #114
  • Loading branch information
cs1317 authored Aug 9, 2023
1 parent 6e61878 commit dd76c6f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/expression/expression_to_stmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (c ExprConverter) convertScalarFunction(dialect format.Dialect, expr *Scala
return &ast.FuncCallExpr{FnName: model.NewCIStr(dialect.GetSpecialFuncName(ast.Ifnull)), Args: children}, nil
case ast.If:
return &ast.FuncCallExpr{FnName: model.NewCIStr(ast.If), Args: children}, nil
case ast.Cos, ast.Abs, ast.Round, ast.Log10:
case ast.Cos, ast.Abs, ast.Round, ast.Log10, ast.Ceil:
return &ast.FuncCallExpr{FnName: model.NewCIStr(expr.FuncName.L), Args: children}, nil
}
switch expr.Function.(type) {
Expand Down
4 changes: 4 additions & 0 deletions pkg/planner/core/testdata/runsql_in.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@
{ "sql": "select log10(aggregate_float_0) as a from alice.tbl_1",
"skip_projection": false,
"rewritten_sql": "select log10(tbl_1.aggregate_float_0) as a from alice.tbl_1"
},
{ "sql": "select ceil(aggregate_float_0) as a from alice.tbl_1",
"skip_projection": false,
"rewritten_sql": "select ceil(tbl_1.aggregate_float_0) as a from alice.tbl_1"
}
]
}
Expand Down

0 comments on commit dd76c6f

Please sign in to comment.