-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
I'm attempting to walk the AST returned by SQL.Parser, and I'm finding the structure of a sequence of boolean expressions in a where clause to be counter-intuitive.
SQL to demonstrate: select id from events where timestamp > 1 and timestamp < 4;
Here's the current structure of the 'where' after Lexing and Parsing (metadata omitted for clarity)
{:where, _,
[ {:<, _, [ {:and, _, [ {:>, _, [ {:timestamp, _, []}, {:numeric. _, [[], 49]} ]}, {:timestamp, _, []} ]}, {:numeric, _, [[], 52]} ]} ]
},The AST above reads as:
((timestamp > 1) and timestamp) < 4
My expectation:
{:where, _,
[ {:and, _ [ {:>, _, [ {:timestamp, _, []}, {:numeric, _, [[], 49]} ]}, {:<, _, [ {:timestamp, _, []}, {:numeric, _, [[], 52]} ]} ] } ]
}This AST reads as:
(timestamp > 1) and (timestamp < 4)
Am I looking at the AST wrong?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working