You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/05/01 16:09:30 UTC

[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #6177: fix: type coercion ignore prevent `Interval - Date`

alamb commented on code in PR #6177:
URL: https://github.com/apache/arrow-datafusion/pull/6177#discussion_r1181685877


##########
datafusion/core/tests/sqllogictests/test_files/type_coercion.slt:
##########
@@ -29,3 +29,25 @@ query B
 select 's' is not distinct from arrow_cast('s', 'LargeUtf8');
 ----
 true
+
+# date - interval
+query D
+select '2023-05-01'::date - interval '1 month';
+----
+2023-04-01
+
+# timestamp - interval
+query P
+SELECT '2023-05-01 12:30:00'::timestamp - interval '1 month';
+----
+2023-04-01T12:30:00
+
+# TODO: https://github.com/apache/arrow-datafusion/issues/6180
+# interval - date
+query error DataFusion error: This feature is not implemented: Unsupported interval argument\. Expected string literal, got: BinaryOp \{ left: Value\(SingleQuotedString\("1 month"\)\), op: Minus, right: Cast \{ expr: Value\(SingleQuotedString\("2023\-05\-01"\)\), data_type: Date \} \}
+select interval '1 month' - '2023-05-01'::date;
+
+# TODO: https://github.com/apache/arrow-datafusion/issues/6180

Review Comment:
   👍 



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org