Skip to content

Commit 83902d3

Browse files
author
Christophe Di Prima
committed
fix: risingwave struct field access
Add a specific visit method for visit_StructField. "f{idx}" is not supported like in Postgres. Use dot and parenthesis annotation as dots only is not working on the first level. `dataframe.metadata["user.profile.link"].value.url`` Will be translated to: `(((("t1"."metadata")."user.profile.link").value).url)`` Resolves #11182
1 parent 46cce76 commit 83902d3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ibis/backends/sql/compilers/risingwave.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,5 +193,8 @@ def visit_MapContains(self, op, *, arg, key):
193193
self.cast(arg, op.arg.dtype), self.cast(key, op.key.dtype)
194194
)
195195

196+
def visit_StructField(self, op, *, arg, field):
197+
return sge.Dot(this=sge.Paren(this=arg), expression=sge.to_identifier(field))
198+
196199

197200
compiler = RisingWaveCompiler()

0 commit comments

Comments
 (0)