lyne7-sc commented on code in PR #2464:
URL: https://github.com/apache/auron/pull/2464#discussion_r3758358833
##########
native-engine/datafusion-ext-plans/src/sort_exec.rs:
##########
@@ -1547,6 +1557,35 @@ mod test {
Ok(())
}
+ #[tokio::test]
+ async fn test_top_k_with_only_sort_column() -> Result<()> {
+ MemManager::init(100);
+ let session_ctx = SessionContext::new();
+ let task_ctx = session_ctx.task_ctx();
+ let input = build_single_column_table("id", (0..10).rev().collect())?;
+ let sort_exprs = vec![PhysicalSortExpr {
+ expr: Arc::new(Column::new("id", 0)),
+ options: SortOptions::default(),
+ }];
+
+ let sort = SortExec::new(input, sort_exprs, Some(6), 0);
+ let output = sort.execute(0, task_ctx)?;
+ let batches = common::collect(output).await?;
+ let expected = r#"+----+
+| id |
++----+
+| 0 |
+| 1 |
+| 2 |
+| 3 |
+| 4 |
+| 5 |
++----+"#;
+ assert_batches_eq!(expected.lines().collect::<Vec<_>>(), &batches);
Review Comment:
rustfmt compacts the suggested `Vec<&str>` form into a few long lines,
making the expected table less readable. The raw string has no leading spaces,
so I prefer to keep the current format.
--
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]