MCPcopy Create free account
hub / github.com/apache/arrow / _dataset_to_decl

Function _dataset_to_decl

python/pyarrow/acero.py:59–79  ·  view source on GitHub ↗
(dataset, use_threads=True, implicit_ordering=False)

Source from the content-addressed store, hash-verified

57
58
59def _dataset_to_decl(dataset, use_threads=True, implicit_ordering=False):
60 decl = Declaration("scan", ScanNodeOptions(
61 dataset, use_threads=use_threads,
62 implicit_ordering=implicit_ordering))
63
64 # Get rid of special dataset columns
65 # "__fragment_index", "__batch_index", "__last_in_fragment", "__filename"
66 projections = [field(f) for f in dataset.schema.names]
67 decl = Declaration.from_sequence(
68 [decl, Declaration("project", ProjectNodeOptions(projections))]
69 )
70
71 filter_expr = dataset._scan_options.get("filter")
72 if filter_expr is not None:
73 # Filters applied in CScanNodeOptions are "best effort" for the scan node itself
74 # so we always need to inject an additional Filter node to apply them for real.
75 decl = Declaration.from_sequence(
76 [decl, Declaration("filter", FilterNodeOptions(filter_expr))]
77 )
78
79 return decl
80
81
82def _perform_join(join_type, left_operand, left_keys,

Callers 3

_perform_joinFunction · 0.85
_perform_join_asofFunction · 0.85
_sort_sourceFunction · 0.85

Calls 4

fieldFunction · 0.90
ScanNodeOptionsClass · 0.85
DeclarationClass · 0.50
getMethod · 0.45

Tested by

no test coverage detected