jayzhan211 commented on code in PR #9249:
URL: https://github.com/apache/arrow-datafusion/pull/9249#discussion_r1508954280


##########
datafusion/core/tests/user_defined/user_defined_aggregates.rs:
##########
@@ -208,6 +210,98 @@ async fn execute(ctx: &SessionContext, sql: &str) -> 
Result<Vec<RecordBatch>> {
     ctx.sql(sql).await?.collect().await
 }
 
+#[tokio::test]
+async fn simple_udaf_order() -> Result<()> {
+    let schema = Schema::new(vec![
+        Field::new("a", DataType::Int32, false),
+        Field::new("b", DataType::Int32, false),
+    ]);
+
+    let batch = RecordBatch::try_new(
+        Arc::new(schema.clone()),
+        vec![
+            Arc::new(Int32Array::from(vec![1, 2, 3, 4])),
+            Arc::new(Int32Array::from(vec![1, 1, 2, 2])),
+        ],
+    )?;
+
+    let ctx = SessionContext::new();
+
+    let provider = MemTable::try_new(Arc::new(schema.clone()), 
vec![vec![batch]])?;
+    ctx.register_table("t", Arc::new(provider))?;
+
+    fn create_accumulator(

Review Comment:
   I found that `reverse` is an additional argument for 
OrderSensitiveArrayAggAccumulator. Unlike `FirstValueAccumulator` only current 
3 values are needed. Does this mean we need something like `context` to provide 
their optional info for their accumulator?



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