Skip to content

Commit

Permalink
feat(clickhouse): implement struct scalars
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Aug 17, 2022
1 parent 877a05d commit 1f3efe9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ibis/backends/clickhouse/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,11 @@ def _literal(translator, expr):
return str(list(_tuple_to_list(value)))
elif isinstance(expr, ir.SetScalar):
return '({})'.format(', '.join(map(repr, value)))
elif isinstance(expr, ir.StructScalar):
fields = ", ".join(
f"{value} as `{key}`" for key, value in expr.op().value.items()
)
return f"tuple({fields})"
else:
raise NotImplementedError(type(expr))

Expand Down

0 comments on commit 1f3efe9

Please sign in to comment.