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

[MINOR] enable EXTRACT week and add test (after sqlparser update to 0.16) #2157

Merged
merged 1 commit into from
Apr 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions datafusion/core/tests/sql/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -727,15 +727,10 @@ async fn test_extract_date_part() -> Result<()> {
"9"
);
test_expression!("date_part('WEEK', CAST('2003-01-01' AS DATE))", "1");

// TODO Creating logical plan for 'SELECT EXTRACT(WEEK FROM to_timestamp('2020-09-08T12:00:00+00:00'))'
// SQL(ParserError("Expected date/time field, found: WEEK"))'
// will fix in sqlparser

// test_expression!(
// "EXTRACT(WEEK FROM to_timestamp('2020-09-08T12:00:00+00:00'))",
// "23"
// );
test_expression!(
"EXTRACT(WEEK FROM to_timestamp('2020-09-08T12:00:00+00:00'))",
"37"
);
test_expression!("date_part('DAY', CAST('2000-01-01' AS DATE))", "1");
test_expression!(
"EXTRACT(day FROM to_timestamp('2020-09-08T12:00:00+00:00'))",
Expand Down