Skip to content

Commit ab20c64

Browse files
committed
fix test case && doc
1 parent b1b9455 commit ab20c64

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

datafusion/core/tests/user_defined/user_defined_aggregates.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ async fn test_udaf_as_window_with_frame_without_retract_batch() {
140140
let sql = "SELECT time_sum(time) OVER(ORDER BY time ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) as time_sum from t";
141141
// Note if this query ever does start working
142142
let err = execute(&ctx, sql).await.unwrap_err();
143-
assert_contains!(err.to_string(), "This feature is not implemented: Aggregate can not be used as a sliding accumulator because `retract_batch` is not implemented: AggregateUDF { name: \"time_sum\"");
143+
assert_contains!(err.to_string(), "This feature is not implemented: Aggregate can not be used as a sliding accumulator because `retract_batch` is not implemented: AggregateUDF { inner: AggregateUDF { name: \"time_sum\", signature: Signature { type_signature: Exact([Timestamp(Nanosecond, None)]), volatility: Immutable }, fun: \"<FUNC>\" } }(t.time) ORDER BY [t.time ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING");
144144
}
145145

146146
/// Basic query for with a udaf returning a structure

datafusion/core/tests/user_defined/user_defined_scalar_functions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,8 @@ async fn udaf_as_window_func() -> Result<()> {
291291
context.register_udaf(my_acc);
292292

293293
let sql = "SELECT a, MY_ACC(b) OVER(PARTITION BY a) FROM my_table";
294-
let expected = r#"Projection: my_table.a, AggregateUDF { name: "my_acc", signature: Signature { type_signature: Exact([Int32]), volatility: Immutable }, fun: "<FUNC>" }(my_table.b) PARTITION BY [my_table.a] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
295-
WindowAggr: windowExpr=[[AggregateUDF { name: "my_acc", signature: Signature { type_signature: Exact([Int32]), volatility: Immutable }, fun: "<FUNC>" }(my_table.b) PARTITION BY [my_table.a] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING]]
294+
let expected = r#"Projection: my_table.a, AggregateUDF { inner: AggregateUDF { name: "my_acc", signature: Signature { type_signature: Exact([Int32]), volatility: Immutable }, fun: "<FUNC>" } }(my_table.b) PARTITION BY [my_table.a] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
295+
WindowAggr: windowExpr=[[AggregateUDF { inner: AggregateUDF { name: "my_acc", signature: Signature { type_signature: Exact([Int32]), volatility: Immutable }, fun: "<FUNC>" } }(my_table.b) PARTITION BY [my_table.a] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING]]
296296
TableScan: my_table"#;
297297

298298
let dataframe = context.sql(sql).await.unwrap();

datafusion/expr/src/udaf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl AggregateUDF {
112112
}
113113
}
114114

115-
/// Return the underlying [`WindowUDFImpl`] trait object for this function
115+
/// Return the underlying [`AggregateUDFImpl`] trait object for this function
116116
pub fn inner(&self) -> Arc<dyn AggregateUDFImpl> {
117117
self.inner.clone()
118118
}

0 commit comments

Comments
 (0)