Skip to content

Commit f6b4ca4

Browse files
committed
fix(datafusion): handle array concat like everything else
1 parent 6e51493 commit f6b4ca4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

ibis/backends/sql/compilers/datafusion.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import calendar
44
import math
5-
from functools import partial
5+
from functools import partial, reduce
66
from itertools import starmap
77

88
import sqlglot as sg
@@ -533,5 +533,13 @@ def visit_ArrayFlatten(self, op, *, arg):
533533
def visit_RandomUUID(self, op):
534534
return self.f.anon.uuid()
535535

536+
def visit_ArrayConcat(self, op, *, arg):
537+
return reduce(
538+
lambda x, y: self.if_(
539+
x.is_(NULL).or_(y.is_(NULL)), NULL, self.f.array_cat(x, y)
540+
),
541+
map(partial(self.cast, to=op.dtype), arg),
542+
)
543+
536544

537545
compiler = DataFusionCompiler()

0 commit comments

Comments
 (0)