-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add EXTRACT builtin function; update partiql-tests
#340
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #340 +/- ##
==========================================
- Coverage 81.30% 81.20% -0.10%
==========================================
Files 44 44
Lines 10261 10521 +260
==========================================
+ Hits 8343 8544 +201
- Misses 1918 1977 +59
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Conformance comparison report
Number passing in both: 2650 Number failing in both: 314 Number passing in Base (2cb413a) but now fail: 0 Number failing in Base (2cb413a) but now pass: 10 The following test(s) were previously failing but now pass. Before merging, confirm they are intended to pass: Click here to see
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM; left couple of minor comments and one question?
year: i32, | ||
month: NonZeroU8, | ||
day: u8, | ||
hour: u8, | ||
minute: u8, | ||
second: f64, | ||
second: u8, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-iterating clippy
's warning regarding too many arguments; it's a warning so not a blocker but maybe we can move the args to a struct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be fine to leave it as a warning for now. We might need to adjust some of these datetime functions when we sort out the date/time modeling in the conformance tests partiql/partiql-tests#82 and also support the date time literals.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only comment was the extraneous % 60
in EvalFnExtractTimezoneMinute
which was removed in the latest commit.
Implements
EXTRACT
builtin function and updates to the latestpartiql-tests
. Also fixes some parsing of the datetime part forYEAR
,TIMEZONE_HOUR
, andTIMEZONE_MINUTE
. Makes the following assumptions:EXTRACT
with a date component (year, month, day) on a time -> returns missingEXTRACT
with a time component (hour, minute, second) -> returns missingAll of the above assumptions aren't specified in any SQL spec to my knowledge. The second assumption differs from what
partiql-lang-kotlin
currently does (which defines a default of0
). Created a spec issue to track: partiql/partiql-lang#14 along with a conformance test issue: partiql/partiql-tests#83.Another point that may differ from
partiql-lang-kotlin
is the data type returned by theEXTRACT
function.partiql-lang-kotlin
always returns a decimal, while this PR returns a decimal for seconds and integer otherwise. The SQL spec says that this is implementation-defined. Add a followup comment in the above spec issue: partiql/partiql-lang#14By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.