From f81b554a21b9dea5112876c7a6af2483429f4b09 Mon Sep 17 00:00:00 2001 From: yangjiang Date: Mon, 4 Apr 2022 22:17:12 +0800 Subject: [PATCH] [MINOR] after sqlparser update to 0.16, enable EXTRACT week. --- datafusion/core/tests/sql/expr.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/datafusion/core/tests/sql/expr.rs b/datafusion/core/tests/sql/expr.rs index 086ead0d4114..3863da442045 100644 --- a/datafusion/core/tests/sql/expr.rs +++ b/datafusion/core/tests/sql/expr.rs @@ -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'))",