Skip to content
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

Adds lowering of DATE, TIME, and TIMESTAMP literals to logical plan #345

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alancai98
Copy link
Member

@alancai98 alancai98 commented Apr 20, 2023

Adds lowering of DATE, TIME, and TIMESTAMP literals to logical plan. Also

  • adjusts how datatime values are parsed into the AST
  • adds optional precision field to time and timestamp enums
  • adjusts sort order for date, time, and timestamp in AST to follow section 12.2 of spec "Timestamp values follow and are compared by the absolute point of time irrespective of precision or local UTC offset."

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@alancai98 alancai98 self-assigned this Apr 20, 2023
@github-actions
Copy link

github-actions bot commented Apr 20, 2023

Conformance comparison report

Base (380f526) 1faa440 +/-
% Passing 82.88% 83.60% 0.72%
✅ Passing 2760 2784 24
❌ Failing 376 352 -24
🔶 Ignored 194 194 0
Total Tests 3330 3330 0

Number passing in both: 2760

Number failing in both: 352

Number passing in Base (380f526) but now fail: 0

Number failing in Base (380f526) but now pass: 24

The following test(s) were previously failing but now pass. Before merging, confirm they are intended to pass:

Click here to see
  • partiql_tests::eval::primitives::functions::functions::extract::extract_invalid::invalid_extract_month_from_time_with_time_zone
  • partiql_tests::eval::primitives::functions::functions::extract::extract::extract_date::extract_month_from_date_2000_01_02
  • partiql_tests::eval::primitives::functions::functions::extract::extract_invalid::invalid_extract_month_from_time
  • partiql_tests::eval::primitives::functions::functions::extract::extract::extract_time::extract_hour_from_time_01_23_45_678
  • partiql_tests::eval::primitives::functions::functions::extract::extract_invalid::invalid_extract_day_from_time_with_time_zone
  • partiql_tests::eval::primitives::functions::functions::extract::extract::extract_time_precision::extract_minute_from_time_2_01_23_45_678
  • partiql_tests::eval::primitives::functions::functions::extract::extract::extract_time_precision_with_time_zone::extract_minute_from_time_2_with_time_zone_01_23_45_678_06_30
  • partiql_tests::eval::primitives::functions::functions::extract::extract_invalid::invalid_extract_year_from_time
  • partiql_tests::eval::primitives::functions::functions::extract::extract::extract_time::extract_minute_from_time_01_23_45_678
  • partiql_tests::eval::primitives::functions::functions::extract::extract::extract_date::extract_year_from_date_2000_01_02
  • partiql_tests::eval::primitives::functions::functions::extract::extract_invalid::invalid_extract_day_from_time
  • partiql_tests::eval::primitives::functions::functions::extract::extract::extract_date::extract_day_from_date_2000_01_02
  • partiql_tests::eval::primitives::functions::functions::extract::extract::extract_time_precision_with_time_zone::extract_timezone_minute_from_time_2_with_time_zone_01_23_45_678_06_30
  • partiql_tests::eval::primitives::functions::functions::extract::extract::extract_time_with_time_zone::extract_timezone_hour_from_time_with_time_zone_01_23_45_678_06_30
  • partiql_tests::eval::primitives::functions::functions::extract::extract::extract_time_precision_with_time_zone::extract_timezone_hour_from_time_2_with_time_zone_01_23_45_678_06_30
  • partiql_tests::eval::primitives::functions::functions::extract::extract::extract_time_precision_with_time_zone::extract_second_from_time_2_with_time_zone_01_23_45_678_06_30
  • partiql_tests::eval::primitives::functions::functions::extract::extract::extract_time_precision::extract_second_from_time_2_01_23_45_678
  • partiql_tests::eval::primitives::functions::functions::extract::extract::extract_time::extract_second_from_time_01_23_45_678
  • partiql_tests::eval::primitives::functions::functions::extract::extract::extract_time_with_time_zone::extract_hour_from_time_with_time_zone_01_23_45_678_06_30
  • partiql_tests::eval::primitives::functions::functions::extract::extract::extract_time_with_time_zone::extract_second_from_time_with_time_zone_01_23_45_678_06_30
  • partiql_tests::eval::primitives::functions::functions::extract::extract_invalid::invalid_extract_year_from_time_
  • partiql_tests::eval::primitives::functions::functions::extract::extract::extract_time_with_time_zone::extract_minute_from_time_with_time_zone_01_23_45_678_06_30
  • partiql_tests::eval::primitives::functions::functions::extract::extract::extract_time_with_time_zone::extract_timezone_minute_from_time_with_time_zone_01_23_45_678_06_30
  • partiql_tests::eval::primitives::functions::functions::extract::extract::extract_time_precision::extract_hour_from_time_2_01_23_45_678

@alancai98 alancai98 force-pushed the feat-lower-datetime-literals branch from 6624e0e to 11ab169 Compare April 20, 2023 22:36
@codecov
Copy link

codecov bot commented Apr 20, 2023

Codecov Report

Patch coverage: 55.83% and project coverage change: -0.05 ⚠️

Comparison is base (380f526) 81.26% compared to head (aae326e) 81.21%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #345      +/-   ##
==========================================
- Coverage   81.26%   81.21%   -0.05%     
==========================================
  Files          44       44              
  Lines       10556    10608      +52     
==========================================
+ Hits         8578     8615      +37     
- Misses       1978     1993      +15     
Impacted Files Coverage Δ
partiql-logical-planner/src/lower.rs 87.20% <46.15%> (-0.61%) ⬇️
partiql-value/src/datetime.rs 60.34% <48.43%> (-1.56%) ⬇️
partiql-ast/src/ast.rs 42.78% <50.00%> (-2.01%) ⬇️
partiql-eval/src/eval/expr/mod.rs 83.97% <71.79%> (+2.68%) ⬆️

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

- fixes timestamp lowering
- fixes optional subsecond handling
- update CHANGELOG with breaking AST changes
@alancai98 alancai98 force-pushed the feat-lower-datetime-literals branch from 8c8cd92 to aae326e Compare April 21, 2023 01:09
@alancai98 alancai98 changed the title [WIP] Adds lowering of DATE, TIME, and TIMESTAMP literals to logical plan Adds lowering of DATE, TIME, and TIMESTAMP literals to logical plan Apr 21, 2023
@alancai98 alancai98 marked this pull request as ready for review April 21, 2023 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant