Skip to content

Commit

Permalink
fix(compilers): make sure memtable rows have names in the SQL string …
Browse files Browse the repository at this point in the history
…compilers
  • Loading branch information
cpcloud committed Aug 26, 2022
1 parent abfaf1f commit 18e7f95
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ibis/backends/base/sql/compiler/query_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ def _format_table(self, expr):
result = self._quote_identifier(name)
is_subquery = False
elif isinstance(ref_op, ops.InMemoryTable):
names = ref_op.schema.names
rows = ", ".join(
f"({', '.join(map(repr, col))})"
f"({', '.join(map('{} AS {}'.format, col, names))})"
for col in ref_op.data.itertuples(index=False)
)
result = f"(VALUES {rows})"
Expand Down

0 comments on commit 18e7f95

Please sign in to comment.