influxdb/influxdb_influxql_parser/src
Stuart Carnie 57f55e14c8
feat: IOx InfluxQL planner learns how to process time range expressions (#6772)
* feat: IOx learns InfluxQL time-range expression → DF logical Expr

IOx now understand the how to evaluate an InfluxQL time-range filter
expression and transform that to a DataFusion logical expression.

* chore: move time range expression to independent functions

There is no need for these to be part of the `InfluxQLToLogicalPlan`
struct and makes them easier to test.

* chore: support scalar now on either side of binary expression

* chore: improve error messages

* chore: address clippy concerns

* chore: add tests for time ranges

* chore: add a test where time appears on the right-hand side

Ensure time is correctly identified on the right-hand side of a
conditional expression.

* chore: add tests that specify a timezone

* chore: Run cargo hakari tasks

* chore: fix linting issues

* chore: Remove unnecessary line

* chore: Feedback: Add API to parse a conditional expression

Based on feedback from @alamb, we don't want to hide the error from
parsing a `ConditionalExpression`. To do this, we use the
public API, `parse_statements` as a model and provide a new API,
`parse_conditional_expression`, which returns a `Result` with the error
being a `ParseError`. Additionally, `ConditionalExpression` implements
the `FromStr` API using the `parse_conditional_expression` API.

* chore: PR feedback reverting this change

I believe my intention was to update all instances in the match, but
never completed the change. Will leave for another day.

* chore: PR feedback add additional comments

* chore: rustfmt

---------

Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
2023-02-01 00:27:17 +00:00
..
expression feat: IOx InfluxQL planner learns how to process time range expressions (#6772) 2023-02-01 00:27:17 +00:00
snapshots refactor: Drop Expr::UnaryOp to simplify tree traversal (#6600) 2023-01-18 02:27:38 +00:00
common.rs feat: IOx InfluxQL planner learns how to process time range expressions (#6772) 2023-02-01 00:27:17 +00:00
create.rs refactor: Drop Expr::UnaryOp to simplify tree traversal (#6600) 2023-01-18 02:27:38 +00:00
delete.rs refactor: Drop Expr::UnaryOp to simplify tree traversal (#6600) 2023-01-18 02:27:38 +00:00
drop.rs refactor: Drop Expr::UnaryOp to simplify tree traversal (#6600) 2023-01-18 02:27:38 +00:00
explain.rs refactor: Drop Expr::UnaryOp to simplify tree traversal (#6600) 2023-01-18 02:27:38 +00:00
expression.rs chore: move walk and the mutable variant to the parser crate (#6575) 2023-01-12 21:06:06 +00:00
identifier.rs refactor: Drop Expr::UnaryOp to simplify tree traversal (#6600) 2023-01-18 02:27:38 +00:00
internal.rs refactor: Drop Expr::UnaryOp to simplify tree traversal (#6600) 2023-01-18 02:27:38 +00:00
keywords.rs feat: Teach InfluxQL rewriter how to name columns (#6481) 2023-01-04 00:55:18 +00:00
lib.rs feat: IOx InfluxQL planner learns how to process time range expressions (#6772) 2023-02-01 00:27:17 +00:00
literal.rs feat: IOx InfluxQL planner learns how to process time range expressions (#6772) 2023-02-01 00:27:17 +00:00
parameter.rs refactor: Drop Expr::UnaryOp to simplify tree traversal (#6600) 2023-01-18 02:27:38 +00:00
select.rs refactor: Drop Expr::UnaryOp to simplify tree traversal (#6600) 2023-01-18 02:27:38 +00:00
show.rs refactor: Drop Expr::UnaryOp to simplify tree traversal (#6600) 2023-01-18 02:27:38 +00:00
show_field_keys.rs refactor: Drop Expr::UnaryOp to simplify tree traversal (#6600) 2023-01-18 02:27:38 +00:00
show_measurements.rs feat: Parse InfluxQL line and inline comments (#6076) 2022-11-08 22:53:19 +00:00
show_retention_policies.rs feat: Parse InfluxQL line and inline comments (#6076) 2022-11-08 22:53:19 +00:00
show_tag_keys.rs refactor: Drop Expr::UnaryOp to simplify tree traversal (#6600) 2023-01-18 02:27:38 +00:00
show_tag_values.rs refactor: Drop Expr::UnaryOp to simplify tree traversal (#6600) 2023-01-18 02:27:38 +00:00
simple_from_clause.rs chore: Implemented ZeroOrMore item container (#6373) 2022-12-12 22:01:30 +00:00
statement.rs feat: Add parser for `CREATE DATABASE` statement (#6062) 2022-11-08 00:43:29 +00:00
string.rs fix: InfluxQL parser incompatibilities (#6034) 2022-11-03 05:43:16 +00:00
test_util.rs refactor: Drop Expr::UnaryOp to simplify tree traversal (#6600) 2023-01-18 02:27:38 +00:00
visit.rs refactor: Drop Expr::UnaryOp to simplify tree traversal (#6600) 2023-01-18 02:27:38 +00:00
visit_mut.rs refactor: Drop Expr::UnaryOp to simplify tree traversal (#6600) 2023-01-18 02:27:38 +00:00