Skip to content
Snippets Groups Projects
Unverified Commit 09001d6c authored by Tom Robinson's avatar Tom Robinson Committed by GitHub
Browse files

Expressions: filter expressions, case statements, string extracts, and share aggregations (#11868)


* Upgrade Chevrotain to v6.5.0

* Switch from embedded actions to visitor

* rename tokens to lexer, remove no-longer needed Chevrotain hack from webpack.config.js

* get tests passing again

* progress converting syntax parser

* got intermediate Sum(A) test passing

* more progress on parsing expressions

* get complex expression passing

* prettier

* linting

* Add TokenizedExpression snapshot test

* Add support to parser for recovering whitespace tokens

* Add case clause [ci all]

* fix test [ci all]

* Harden test [ci all]

* More tests [ci all]

* Correctly infer case return type [ci all]

* Fix test [ci all]

* Fix tests [ci all]

* Improved syntax parser

* More parser cleanup + start adding filters and functions

* Add CASE and partial filter support, cleanup tests

* Add string extracts [ci all]

* Typo [ci all]

* Make linter happy [ci all]

* Add regex-match-first [ci all]

* Fix arglist [ci all]

* Fix test [ci all]

* Add sum-where count-where and share support. Refactor aggregation tokens

* Fix tests [ci all]

* Add ns prefixes [ci all]

* Add ns qualifiers [ci all]

* Fix trim [ci all]

* Tests: ensure stable ordering of results [ci all]

* Fix trim [ci all]

* Support only 1-arg trim [ci all]

* Fix ns prefixes [ci all]

* Fix psql [ci all]

* Fix redshift [ci redshift]

* Refactor/simplify grammer to consolidate aggregation, expression, and filter functions

* Add isCase to isExpression

* Directly splice regex pattern for psql & redshift [ci all]

* Fix schema [ci all]

* Redshift: splice replace args [ci redshift]

* Add ns prefix [ci redshift]

* Typo [ci redshift]

* Filter expressions

* Add metrics and segments back in to expressions

* Disable tokenized editing

* Update tests to clojure.test [ci all]

* Add concat to sqlite [ci all]

* Add length [ci all]

* Add missing ns [ci all]

* Fix test [ci all]

* Fix messed up multimethods [ci all]

* Fix mssql [ci all]

* Fix sqlite concat [ci all]

* sqlite: correctly qoute literal strings [ci all]

* Misc improvements to syntax highlighting etc

* Cleanup tests [ci all]

* Reoder defs [ci all]

* Make linter happy [ci all]

* Mongo: add case [ci mongo]

* mongo: fix switch [ci mongo]

* typo [ci mongo]

* Improve syntax highlighter and suggestions

* Mongo: always have default fallback in case [ci mongo]

* Rearrange test to split out ones using expressions [ci mongo]

* Remove uneeded merge [ci all]

* misc

* Much improved syntax highlighting using recovery mode and partial CST

* Improved suggestions

* try monospace font for expressions

* Better typing in parser, various other fixes

* Avoid parsing multiple times

* Fix tests

* Fix tests

* More test fixes

* Special case for UnderlyingRecords drill with sum-where/count-where/share

* switch back to square brackets for identifiers

* change extract to regexextract

* Lift expressions to subselect [ci all]

* Commit on enter

* rename extract to substitute, fix tests

* Refactor [ci all]

* Fix normalization [ci all]

* Correctly handle joins [ci all]

Co-authored-by: default avatarDaniel Higginbotham <daniel@flyingmachinestudios.com>
Co-authored-by: default avatarSimon Belak <simon@metabase.com>
Co-authored-by: default avatarMaz Ameli <maz@metabase.com>
parent 9dffec38
No related merge requests found
Showing
with 2773 additions and 784 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment