viirya commented on code in PR #107:
URL: 
https://github.com/apache/arrow-datafusion-comet/pull/107#discussion_r1501751536


##########
core/src/execution/datafusion/expressions/cast.rs:
##########
@@ -75,8 +75,40 @@ impl Cast {
     fn cast_array(&self, array: ArrayRef) -> DataFusionResult<ArrayRef> {
         let array = array_with_timezone(array, self.timezone.clone(), 
Some(&self.data_type));
         let from_type = array.data_type();
-        let cast_result = cast_with_options(&array, &self.data_type, 
&CAST_OPTIONS)?;
-        Ok(spark_cast(cast_result, from_type, &self.data_type))
+        let to_type = &self.data_type;
+        let cast_result = match (from_type, to_type) {
+            (DataType::Utf8, DataType::Boolean) => 
Self::spark_cast_utf8_to_boolean::<i32>(&array),
+            (DataType::LargeUtf8, DataType::Boolean) => {
+                Self::spark_cast_utf8_to_boolean::<i64>(&array)
+            }

Review Comment:
   We probably need to handle dictionary types too. Maybe as a follow up.



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

Reply via email to