(
schema: &SchemaRef,
column: &str,
alias: &str,
human_display: Option<&str>,
human_display_alias: Option<&str>,
)
| 3074 | } |
| 3075 | |
| 3076 | fn first_value_agg_expr( |
| 3077 | schema: &SchemaRef, |
| 3078 | column: &str, |
| 3079 | alias: &str, |
| 3080 | human_display: Option<&str>, |
| 3081 | human_display_alias: Option<&str>, |
| 3082 | ) -> Result<AggregateFunctionExpr> { |
| 3083 | let mut builder = |
| 3084 | AggregateExprBuilder::new(first_value_udaf(), vec![col(column, schema)?]) |
| 3085 | .order_by(vec![PhysicalSortExpr { |
| 3086 | expr: col(column, schema)?, |
| 3087 | options: SortOptions::new(false, false), |
| 3088 | }]) |
| 3089 | .schema(Arc::clone(schema)) |
| 3090 | .alias(alias); |
| 3091 | |
| 3092 | if let Some(human_display) = human_display { |
| 3093 | builder = builder.human_display(human_display); |
| 3094 | } |
| 3095 | if let Some(human_display_alias) = human_display_alias { |
| 3096 | builder = builder.human_display_alias(human_display_alias); |
| 3097 | } |
| 3098 | |
| 3099 | builder.build() |
| 3100 | } |
| 3101 | |
| 3102 | #[test] |
| 3103 | fn test_reverse_expr_preserves_aliased_human_display() -> Result<()> { |
searching dependent graphs…