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


##########
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:
   Looks like we have a few missing `arrow_cast` for BinaryView. Going to file 
a ticket in arrow and put up a PR.
   
   



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