From bc13904b779b62008e02261ff91446844d5f6bc9 Mon Sep 17 00:00:00 2001 From: jackylee-ch Date: Sat, 3 Oct 2026 22:26:39 +0800 Subject: [PATCH] docs: fix malformed rustdoc for bit_and/bit_or/bit_xor expr fns The make_bitwise_udaf_expr_and_func! macro built the expr fn doc by concat!-ing "Returns the bitwise", stringify!($OPR_TYPE) and "of a group of values" with no separators, so docs.rs rendered e.g. "Returns the bitwiseBitwiseOperationType :: Andof a group of values". Pass a readable operation name ("AND"/"OR"/"XOR") instead, yielding "Returns the bitwise AND of a group of values". --- datafusion/functions-aggregate/src/bit_and_or_xor.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/datafusion/functions-aggregate/src/bit_and_or_xor.rs b/datafusion/functions-aggregate/src/bit_and_or_xor.rs index 1928f5c51ccbc..cf4d606feb977 100644 --- a/datafusion/functions-aggregate/src/bit_and_or_xor.rs +++ b/datafusion/functions-aggregate/src/bit_and_or_xor.rs @@ -115,17 +115,14 @@ macro_rules! downcast_bitwise_accumulator { /// `EXPR_FN` identifier used to name the generated expression function. /// `AGGREGATE_UDF_FN` is an identifier used to name the underlying UDAF function. /// `OPR_TYPE` is an expression that evaluates to the type of bitwise operation to be performed. +/// `OPR_NAME` is a string literal naming the operation in the generated expression function's docs (e.g. `"AND"`). /// `DOCUMENTATION` documentation for the UDAF macro_rules! make_bitwise_udaf_expr_and_func { - ($EXPR_FN:ident, $AGGREGATE_UDF_FN:ident, $OPR_TYPE:expr, $DOCUMENTATION:expr) => { + ($EXPR_FN:ident, $AGGREGATE_UDF_FN:ident, $OPR_TYPE:expr, $OPR_NAME:literal, $DOCUMENTATION:expr) => { make_udaf_expr!( $EXPR_FN, expr_x, - concat!( - "Returns the bitwise", - stringify!($OPR_TYPE), - "of a group of values" - ), + concat!("Returns the bitwise ", $OPR_NAME, " of a group of values"), $AGGREGATE_UDF_FN ); create_func!( @@ -182,18 +179,21 @@ make_bitwise_udaf_expr_and_func!( bit_and, bit_and_udaf, BitwiseOperationType::And, + "AND", get_bit_and_doc() ); make_bitwise_udaf_expr_and_func!( bit_or, bit_or_udaf, BitwiseOperationType::Or, + "OR", get_bit_or_doc() ); make_bitwise_udaf_expr_and_func!( bit_xor, bit_xor_udaf, BitwiseOperationType::Xor, + "XOR", get_bit_xor_doc() );