-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
airframe-sql: Support EXTRACT function #2818
Conversation
Need to reformat the code with |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2818 +/- ##
==========================================
+ Coverage 82.43% 82.45% +0.02%
==========================================
Files 337 337
Lines 14249 14273 +24
Branches 2293 2312 +19
==========================================
+ Hits 11746 11769 +23
- Misses 2503 2504 +1
Continue to review full report in Codecov by Sentry.
|
airframe-sql/src/main/scala/wvlet/airframe/sql/parser/SQLGenerator.scala
Outdated
Show resolved
Hide resolved
LGTM now! Thanks for your first contribution! I'll merge it after CI passes |
Currently, queries containing
EXTRACT
cannot properly be parsed asSQLInterpreter
does not override thevisitExtract
method. The default one ends up producing anull
value when a function call is made inside theEXTRACT
statement. An exception is later thrown by the parser when it encounters thatnull
value.This PR adds support for the
EXTRACT
functions. It also adds support for additional intervals that need to be supported and it fixes an issue when generating grouping keys; function call would not be printed correctly.