avantgardnerio commented on code in PR #7192:
URL: https://github.com/apache/arrow-datafusion/pull/7192#discussion_r1284632868


##########
datafusion/core/src/physical_optimizer/limit_aggregation.rs:
##########
@@ -0,0 +1,88 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//! An optimizer rule that detects aggregate operations that could use a 
limited bucket count
+
+use crate::physical_optimizer::PhysicalOptimizerRule;
+use crate::physical_plan::aggregates::AggregateExec;
+use crate::physical_plan::sorts::sort::SortExec;
+use crate::physical_plan::ExecutionPlan;
+use datafusion_common::config::ConfigOptions;
+use datafusion_common::{DataFusionError, Result};
+use std::sync::Arc;
+
+pub struct LimitAggregation {}
+
+impl LimitAggregation {
+    pub fn new() -> Self {
+        Self {}
+    }
+
+    fn recurse(plan: Arc<dyn ExecutionPlan>) -> Result<Arc<dyn ExecutionPlan>> 
{

Review Comment:
   yeah, it doesn't look like what I did works: 
   ```
   ---- cli_quick_test::case_3_set_batch_size stdout ----
   thread 'cli_quick_test::case_3_set_batch_size' panicked at 
/rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/core/src/ops/function.rs:250:5:
   Unexpected stdout, failed var == 
"[{\"name\":\"datafusion.execution.batch_size\",\"setting\":\"1\"}]\n"
   ├── var: "limit aggregation\ncaused by\nInternal error: Children cannot be 
replaced in LazyMemTableExec { .. }. This was likely caused by a bug in 
DataFusion's code and we would welcome that you file an bug report in our issue 
tracker\n"
   └── var as str: limit aggregation
       caused by
       Internal error: Children cannot be replaced in LazyMemTableExec { .. }. 
This was likely caused by a bug in DataFusion's code and we would welcome that 
you file an bug report in our issue tracker
   ```



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