We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
times
UInt64
1 parent 84f701c commit b643544Copy full SHA for b643544
ibis/backends/clickhouse/registry.py
@@ -692,6 +692,13 @@ def _nth_value(translator, expr):
692
return f"nth_value({arg}, ({nth}) + 1)"
693
694
695
+def _repeat(translator, expr):
696
+ op = expr.op()
697
+ arg = translator.translate(op.arg)
698
+ times = translator.translate(op.times)
699
+ return f"repeat({arg}, CAST({times} AS UInt64))"
700
+
701
702
# TODO: clickhouse uses different string functions
703
# for ascii and utf-8 encodings,
704
@@ -789,7 +796,7 @@ def _nth_value(translator, expr):
789
796
ops.LStrip: _unary('trimLeft'),
790
797
ops.RStrip: _unary('trimRight'),
791
798
ops.Strip: _unary('trimBoth'),
792
- ops.Repeat: _fixed_arity("repeat", 2),
799
+ ops.Repeat: _repeat,
793
800
ops.StringConcat: _string_concat,
794
801
ops.RegexSearch: _fixed_arity('match', 2),
795
802
ops.RegexExtract: _regex_extract,
0 commit comments