wiedld commented on code in PR #12199:
URL: https://github.com/apache/datafusion/pull/12199#discussion_r1733416035


##########
datafusion/substrait/tests/cases/roundtrip_logical_plan.rs:
##########
@@ -716,12 +716,29 @@ async fn all_type_literal() -> Result<()> {
             date32_col = arrow_cast('2020-01-01', 'Date32') AND
             binary_col = arrow_cast('binary', 'Binary') AND
             large_binary_col = arrow_cast('large_binary', 'LargeBinary') AND
+            view_binary_col = arrow_cast(arrow_cast('binary_view', 'Binary'), 
'BinaryView') AND
             utf8_col = arrow_cast('utf8', 'Utf8') AND
-            large_utf8_col = arrow_cast('large_utf8', 'LargeUtf8');",
+            large_utf8_col = arrow_cast('large_utf8', 'LargeUtf8') AND
+            view_utf8_col = arrow_cast('utf8_view', 'Utf8View');",
     )
         .await
 }
 
+/// Arrow-cast does not currently handle direct casting from utf8 to 
binaryView.
+#[tokio::test]
+async fn binaryview_type_literal_needs_casting_fix() -> Result<()> {
+    let err = roundtrip_all_types(
+        "select * from data where
+            view_binary_col = arrow_cast('binary_view', 'BinaryView');",
+    )
+    .await;
+
+    assert!(
+        matches!(err, Err(e) if e.to_string().contains("Unsupported CAST from 
Utf8 to BinaryView"))
+    );
+    Ok(())

Review Comment:
   I [see 
sqllogictests](https://github.com/apache/datafusion/blob/6ffb1f64a7b3f48c7693d2ecb34f72a2dca24acc/datafusion/sqllogictest/test_files/arrow_typeof.slt#L316)
 which demonstrate what is supported by arrow_cast. Then my follow ups will be: 
(a) make sqllogictests showing what is, and is not, supported of the new view 
types, and then (b) make the upstream arrow-rs changes (with some correctness 
guidance during code review).



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to