pyarrow.acero.Declaration#
- classpyarrow.acero.Declaration(factory_name,ExecNodeOptionsoptions,inputs=None)#
Bases:
_WeakrefableHelper class for declaring the nodes of an ExecPlan.
A Declaration represents an unconstructed ExecNode, and potentiallymore since its inputs may also be Declarations or when constructedwith
from_sequence.The possible ExecNodes to use are registered with a name,the “factory name”, and need to be specified using this name, togetherwith its corresponding ExecNodeOptions subclass.
- Parameters:
- factory_name
str The ExecNode factory name, such as “table_source”, “filter”,“project” etc. See the ExecNodeOptions subclasses for the exactfactory names to use.
- options
ExecNodeOptions Corresponding ExecNodeOptions subclass (matching the factory name).
- inputs
listofDeclaration, optional Input nodes for this declaration. Optional if the node is a sourcenode, or when the declaration gets combined later with
from_sequence.
- factory_name
- Returns:
- __init__(*args,**kwargs)#
Methods
__init__(*args, **kwargs)from_sequence(decls)Convenience factory for the common case of a simple sequence of nodes.
to_reader(self, bool use_threads=True)Run the declaration and return results as a RecordBatchReader.
to_table(self, bool use_threads=True)Run the declaration and collect the results into a table.
- staticfrom_sequence(decls)#
Convenience factory for the common case of a simple sequence of nodes.
Each of the declarations will be appended to the inputs of thesubsequent declaration, and the final modified declaration willbe returned.
- Parameters:
- decls
listofDeclaration
- decls
- Returns:
- to_reader(self,booluse_threads=True)#
Run the declaration and return results as a RecordBatchReader.
For details about the parameters, seeto_table.
- Returns:
- to_table(self,booluse_threads=True)#
Run the declaration and collect the results into a table.
This method will implicitly add a sink node to the declarationto collect results into a table. It will then create an ExecPlanfrom the declaration, start the exec plan, block until the planhas finished, and return the created table.
- Parameters:
- Returns:

