Skip to content

Add support for week in extract operator #436

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

Merged
merged 1 commit into from
Mar 12, 2022
Merged

Conversation

Ted-Jiang
Copy link
Member

close #435

Copy link

@liukun4515 liukun4515 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Ted-Jiang
Copy link
Member Author

Test with datafusion!

un  --bin datafusion-cli
   Compiling sqlparser v0.15.0 (/Users/yangjiang/CLionProjects/sqlparser-rs)
   Compiling datafusion-common v7.0.0 (/Users/yangjiang/CLionProjects/arrow-datafusion/datafusion-common)
   Compiling datafusion-expr v7.0.0 (/Users/yangjiang/CLionProjects/arrow-datafusion/datafusion-expr)
   Compiling datafusion-physical-expr v7.0.0 (/Users/yangjiang/CLionProjects/arrow-datafusion/datafusion-physical-expr)
   Compiling datafusion v7.0.0 (/Users/yangjiang/CLionProjects/arrow-datafusion/datafusion)
   Compiling datafusion-cli v7.0.0 (/Users/yangjiang/CLionProjects/arrow-datafusion/datafusion-cli)
    Finished dev [unoptimized + debuginfo] target(s) in 42.48s
     Running `target/debug/datafusion-cli`

DataFusion CLI v7.0.0
❯ select EXTRACT(WEEK FROM to_timestamp('2020-09-08T12:00:00+00:00'));
+-----------------------------------------------------------------------+
| datepart(Utf8("WEEK"),totimestamp(Utf8("2020-09-08T12:00:00+00:00"))) |
+-----------------------------------------------------------------------+
| 37                                                                    |
+-----------------------------------------------------------------------+
1 row in set. Query took 0.005 seconds.
❯



@Ted-Jiang
Copy link
Member Author

@alamb PTAL

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1966663023

  • 2 of 3 (66.67%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.009%) to 90.44%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/parser.rs 1 2 50.0%
Totals Coverage Status
Change from base Build 1953203878: -0.009%
Covered Lines: 7275
Relevant Lines: 8044

💛 - Coveralls

@alamb alamb merged commit c688bbb into apache:main Mar 12, 2022
@alamb alamb changed the title extract operator: add support for week keywords Add support for week in extract operator Mar 12, 2022
@alamb
Copy link
Contributor

alamb commented Mar 12, 2022

Thanks @Ted-Jiang @liukun4515 and @houqp

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.

extract operator: add support for week keywords
5 participants