Skip to content

Commit

Permalink
feat(clickhouse): implement struct field access
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored and kszucs committed Jun 7, 2022
1 parent 21bb6b4 commit fff69f3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ibis/backends/clickhouse/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,11 @@ def _clip(translator, expr):
return arg


def _struct_field(translator, expr):
op = expr.op()
return f"{translator.translate(op.arg)}.`{op.field}`"


# TODO: clickhouse uses different string functions
# for ascii and utf-8 encodings,

Expand Down Expand Up @@ -790,6 +795,7 @@ def _clip(translator, expr):
ops.Strftime: _fixed_arity("formatDateTime", 2),
ops.ArrayColumn: _array_column,
ops.Clip: _clip,
ops.StructField: _struct_field,
}


Expand Down

0 comments on commit fff69f3

Please sign in to comment.