Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cpp/src/arrow/compute/exec/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ class ARROW_EXPORT FetchNodeOptions : public ExecNodeOptions {
int64_t count;
};

/// \brief Make a node which executes expressions on input batches, producing new batches.
/// \brief Make a node which executes expressions on input batches, producing batches
/// of the same length with new columns.
///
/// Each expression will be evaluated against each batch which is pushed to
/// this node to produce a corresponding output column.
Expand Down
12 changes: 8 additions & 4 deletions docs/source/cpp/streaming_execution.rst
Original file line number Diff line number Diff line change
Expand Up @@ -648,8 +648,9 @@ Example of using ``table_source``
----------

``filter`` operation, as the name suggests, provides an option to define data filtering
criteria. It selects rows matching a given expression. Filters can be written using
:class:`arrow::compute::Expression`. For example, if we wish to keep rows where the value
criteria. It selects rows where the given expression evaluates to true. Filters can be written using
:class:`arrow::compute::Expression`, and the expression should have a return type of boolean.
For example, if we wish to keep rows where the value
of column ``b`` is greater than 3, then we can use the following expression.

Filter example:
Expand All @@ -668,8 +669,11 @@ Filter example:

``project`` operation rearranges, deletes, transforms, and creates columns.
Each output column is computed by evaluating an expression
against the source record batch. This is exposed via
:class:`arrow::compute::ProjectNodeOptions` which requires,
against the source record batch. These must be scalar expressions
(expressions consisting of scalar literals, field references and scalar
functions, i.e. elementwise functions that return one value for each input
row independent of the value of all other rows).
This is exposed via :class:`arrow::compute::ProjectNodeOptions` which requires,
an :class:`arrow::compute::Expression` and name for each of the output columns (if names are not
provided, the string representations of exprs will be used).

Expand Down
1 change: 1 addition & 0 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ set(CYTHON_EXTENSIONS
_compute
_csv
_exec_plan
_acero
_feather
_fs
_hdfsio
Expand Down
43 changes: 43 additions & 0 deletions python/pyarrow/_acero.pxd
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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.

# cython: language_level = 3

from pyarrow.lib cimport *
from pyarrow.includes.common cimport *
from pyarrow.includes.libarrow cimport *


cdef class ExecNodeOptions(_Weakrefable):
cdef:
shared_ptr[CExecNodeOptions] wrapped

cdef void init(self, const shared_ptr[CExecNodeOptions]& sp)
cdef inline shared_ptr[CExecNodeOptions] unwrap(self) nogil


cdef class Declaration(_Weakrefable):

cdef:
CDeclaration decl

cdef void init(self, const CDeclaration& c_decl)

@staticmethod
cdef wrap(const CDeclaration& c_decl)

cdef inline CDeclaration unwrap(self) nogil
Loading