@@ -1523,12 +1523,17 @@ impl FromStr for BuiltinScalarFunction {
15231523 }
15241524}
15251525
1526+ /// Creates a function that returns a type based on the type of string to the
1527+ /// first argument
1528+ ///
1529+ /// If the input type is `LargeUtf8` or `LargeBinary` the return type is `largeUtf8Type`,
1530+ /// If the input type is `Utf8` or `Binary` the return type is `utf8Type`,
15261531macro_rules! make_utf8_to_return_type {
15271532 ( $FUNC: ident, $largeUtf8Type: expr, $utf8Type: expr) => {
15281533 fn $FUNC( arg_type: & DataType , name: & str ) -> Result <DataType > {
15291534 Ok ( match arg_type {
1530- DataType :: LargeUtf8 => $largeUtf8Type,
1531- DataType :: Utf8 => $utf8Type,
1535+ DataType :: LargeUtf8 | DataType :: LargeBinary => $largeUtf8Type,
1536+ DataType :: Utf8 | DataType :: Binary => $utf8Type,
15321537 DataType :: Null => DataType :: Null ,
15331538 DataType :: Dictionary ( _, value_type) => match * * value_type {
15341539 DataType :: LargeUtf8 => $largeUtf8Type,
@@ -1554,7 +1559,9 @@ macro_rules! make_utf8_to_return_type {
15541559 } ;
15551560}
15561561
1562+ /// `utf8_to_str_type` returns either a Utf8 or LargeUtf8 based on the input type size.
15571563make_utf8_to_return_type ! ( utf8_to_str_type, DataType :: LargeUtf8 , DataType :: Utf8 ) ;
1564+ /// `utf8_to_str_type` returns either a Int32 or Int64 based on the input type size.
15581565make_utf8_to_return_type ! ( utf8_to_int_type, DataType :: Int64 , DataType :: Int32 ) ;
15591566
15601567fn utf8_or_binary_to_binary_type ( arg_type : & DataType , name : & str ) -> Result < DataType > {
0 commit comments