Skip to content

Commit

Permalink
feat: allow source tables other than UnboundTable
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrist authored and gforsyth committed Oct 25, 2022
1 parent e268565 commit 22d90f1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ibis_substrait/compiler/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,12 +735,16 @@ def selection(
)
]

# TODO: there has to be a better way to get a list of unbound tables
# TODO: there has to be a better way to get a list of source tables
# underlying an expression
unbound_tables = {
t for t in to_op_dag(op.to_expr()).keys() if isinstance(t, ops.UnboundTable)
# TODO: settle on a better source table definition than "PhysicalTable with
# a schema"
source_tables = {
t
for t in to_op_dag(op.to_expr()).keys()
if isinstance(t, ops.PhysicalTable) and hasattr(t, "schema")
}
mapping_counter = itertools.count(sum(map(lambda t: len(t.schema), unbound_tables)))
mapping_counter = itertools.count(sum(len(t.schema) for t in source_tables))
if selections:

if relation.project.common.ListFields():
Expand Down

0 comments on commit 22d90f1

Please sign in to comment.