liukun4515 commented on a change in pull request #1974:
URL: https://github.com/apache/arrow-datafusion/pull/1974#discussion_r824323294
##########
File path: datafusion/tests/sql/expr.rs
##########
@@ -714,17 +714,36 @@ async fn in_list_array() -> Result<()> {
#[tokio::test]
async fn test_extract_date_part() -> Result<()> {
- test_expression!("date_part('hour', CAST('2020-01-01' AS DATE))", "0");
- test_expression!("EXTRACT(HOUR FROM CAST('2020-01-01' AS DATE))", "0");
- test_expression!(
- "EXTRACT(HOUR FROM to_timestamp('2020-09-08T12:00:00+00:00'))",
- "12"
- );
test_expression!("date_part('YEAR', CAST('2000-01-01' AS DATE))", "2000");
test_expression!(
"EXTRACT(year FROM to_timestamp('2020-09-08T12:00:00+00:00'))",
"2020"
);
+ test_expression!("date_part('MONTH', CAST('2000-01-01' AS DATE))", "1");
+ test_expression!(
+ "EXTRACT(month FROM to_timestamp('2020-09-08T12:00:00+00:00'))",
+ "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'))'
Review comment:
@Ted-Jiang Maybe you can file a pr to fix this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]