Canner / wren-engine

🤖 The semantic engine for LLMs, bringing semantic context to AI agents. 🔥
https://getwren.ai/oss
Apache License 2.0
129 stars 34 forks source link

Wren core incorrectly convert `ABS(-1)` #873

Closed grieve54706 closed 2 weeks ago

grieve54706 commented 2 weeks ago

Describe the bug Send statement SELECT ABS(-1) to wren core will get SELECT 1 AS "abs(Int64(-1))". It's not an executable SQL.

To Reproduce

from wren_core import SessionContext

session_context = SessionContext(manifest_str, function_path)
sql = session_context.transform_sql("SELECT ABS(-1)")

# sql = SELECT 1 AS "abs(Int64(-1))"

Wren engine Information

goldmedal commented 2 weeks ago

It's also simplified by SimplifyExpressionRule. Fixed by #874