aocsa commented on a change in pull request #11274:
URL: https://github.com/apache/arrow/pull/11274#discussion_r718834634



##########
File path: cpp/src/arrow/compute/exec/select_k.cc
##########
@@ -0,0 +1,74 @@
+// 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.
+
+#include "arrow/compute/exec/select_k.h"
+
+#include <functional>
+#include <memory>
+#include <mutex>
+#include <vector>
+#include "arrow/compute/api_vector.h"
+#include "arrow/compute/exec/options.h"
+#include "arrow/record_batch.h"
+#include "arrow/result.h"
+#include "arrow/status.h"
+#include "arrow/table.h"
+#include "arrow/type.h"
+
+namespace arrow {
+namespace compute {
+
+class SelectKBasicImpl : public SelectKImpl {

Review comment:
       I was thinking about a streaming and concurrent version of SelectK, 
however even though it is possible to implement that It will still require to 
use `Take` kernel, and `Take` needs the all the batches (table input).
   
   The other option is to have a container with the first k elements, not only 
the indices, and select `top_k/bottom_k` rows while baches passed through it. 
However columnar format for RecordBatches  is not friendly with this operation, 
I think  this version is implementable but the cost could be worst that the 
bulkload version of it.




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