jackwener commented on code in PR #7339:
URL: https://github.com/apache/arrow-datafusion/pull/7339#discussion_r1299182448


##########
datafusion/expr/src/built_in_function.rs:
##########
@@ -1395,25 +1395,25 @@ macro_rules! make_utf8_to_return_type {
                 DataType::LargeUtf8 => $largeUtf8Type,
                 DataType::Utf8 => $utf8Type,
                 DataType::Null => DataType::Null,
-                DataType::Dictionary(_, value_type) => {
-                    match **value_type {
-                        DataType::LargeUtf8 => $largeUtf8Type,
-                        DataType::Utf8 => $utf8Type,
-                        DataType::Null => DataType::Null,
-                        _ => {
-                            // this error is internal as `data_types` should 
have captured this.
-                            return internal_err!(
-                                "The {:?} function can only accept strings.",
-                                name
-                            );
-                        }
+                DataType::Dictionary(_, value_type) => match **value_type {
+                    DataType::LargeUtf8 => $largeUtf8Type,
+                    DataType::Utf8 => $utf8Type,
+                    DataType::Null => DataType::Null,
+                    _ => {
+                        // this error is internal as `data_types` should have 
captured this.
+                        return internal_err!(
+                            "The {:?} function can only accept strings, but 
got {:?}.",
+                            name,
+                            **value_type
+                        );
                     }
-                }
-                _ => {
+                },
+                data_type => {
                     // this error is internal as `data_types` should have 
captured this.
                     return internal_err!(

Review Comment:
   ```suggestion
                       return plan_err!(
   ```



##########
datafusion/expr/src/built_in_function.rs:
##########
@@ -1395,25 +1395,25 @@ macro_rules! make_utf8_to_return_type {
                 DataType::LargeUtf8 => $largeUtf8Type,
                 DataType::Utf8 => $utf8Type,
                 DataType::Null => DataType::Null,
-                DataType::Dictionary(_, value_type) => {
-                    match **value_type {
-                        DataType::LargeUtf8 => $largeUtf8Type,
-                        DataType::Utf8 => $utf8Type,
-                        DataType::Null => DataType::Null,
-                        _ => {
-                            // this error is internal as `data_types` should 
have captured this.
-                            return internal_err!(
-                                "The {:?} function can only accept strings.",
-                                name
-                            );
-                        }
+                DataType::Dictionary(_, value_type) => match **value_type {
+                    DataType::LargeUtf8 => $largeUtf8Type,
+                    DataType::Utf8 => $utf8Type,
+                    DataType::Null => DataType::Null,
+                    _ => {
+                        // this error is internal as `data_types` should have 
captured this.
+                        return internal_err!(

Review Comment:
   ```suggestion
                           return plan_err!(
   ```



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