Recursively searches children of LogicalPlan to find an Aggregate node if exists
prior to encountering a Join, TableScan, or a nested subquery (derived table factor).
If an Aggregate or node is not found prior to this or at all before reaching the end
of the tree, None is returned.
Recursively searches children of LogicalPlan to find Window nodes if exist
prior to encountering a Join, TableScan, or a nested subquery (derived table factor).
If Window node is not found prior to this or at all before reaching the end
of the tree, None is returned.
SQLite does not support timestamp/date scalars like to_timestamp, from_unixtime, date_trunc, etc.
This uses the strftime function to format the timestamp as a string depending on the truncation unit.
SQLite does not support timestamp/date scalars like to_timestamp, from_unixtime, date_trunc, etc.
This remaps from_unixtime to datetime(expr, 'unixepoch'), expecting the input to be in seconds.
It supports no other arguments, so if any are supplied it will return an error.
Iterates through the children of a LogicalPlan to find a TableScan node before encountering
a Projection or any unexpected node that indicates the presence of a Projection (SELECT) in the plan.
If a TableScan node is found, returns the TableScan node without filters, along with the collected filters separately.
If the plan contains a Projection, returns None.
Transforms all Column expressions in a sort expression into the actual expression from aggregation or projection if found.
This is required because if an ORDER BY expression is present in an Aggregate or Select, it is replaced
with a Column expression (e.g., βsum(catalog_returns.cr_net_loss)β). We need to transform it back to
the actual expression, such as sum(βcatalog_returnsβ.βcr_net_lossβ).