You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@beam.apache.org by "Balogh, György" <bo...@ultinous.com> on 2022/04/06 08:56:44 UTC

[Question] proper type for beam udf for complex types

Hi,
I'd like to use BeamSqlUdf-s with complex (potential nested) types. It is
not clear how to specify the type to achieve this.

Eg.: I've a rectangle with x,y,width,height and want to operate on this.
I'm getting this error:

No match found for function signature iou(<RecordType(INTEGER x, INTEGER y,
INTEGER width, INTEGER height)>) -> [Help 1]

So I'd like to have this type: RecordType(INTEGER x, INTEGER y, INTEGER
width, INTEGER height)>, how to specify this type in my UDF?

Thank you,
Gyorgy


-- 

György Balogh
CEO
E gyorgy.balogh@ultinous.com <zs...@ultinous.com>
M +36 30 270 8342 <+36%2030%20270%208342>
A HU, 1117 Budapest, Budafoki út 209.
W www.ultinous.com

Re: [Question] proper type for beam udf for complex types

Posted by Andrew Pilloud <ap...@google.com>.
This isn't supported. https://issues.apache.org/jira/browse/BEAM-11871

I believe you can get values with the WrappedRow type but that is an
internal interface (subject to change at any time) and doesn't expose
columns in a sensical way. (You can't access them by name and the indexes
are not stable.)

On Wed, Apr 6, 2022 at 9:10 AM Ahmet Altay <al...@google.com> wrote:

> /cc @Kyle Weaver <kc...@google.com>
>
> On Wed, Apr 6, 2022 at 1:57 AM Balogh, György <bo...@ultinous.com> wrote:
>
>> Hi,
>> I'd like to use BeamSqlUdf-s with complex (potential nested) types. It is
>> not clear how to specify the type to achieve this.
>>
>> Eg.: I've a rectangle with x,y,width,height and want to operate on this.
>> I'm getting this error:
>>
>> No match found for function signature iou(<RecordType(INTEGER x, INTEGER
>> y, INTEGER width, INTEGER height)>) -> [Help 1]
>>
>> So I'd like to have this type: RecordType(INTEGER x, INTEGER y, INTEGER
>> width, INTEGER height)>, how to specify this type in my UDF?
>>
>> Thank you,
>> Gyorgy
>>
>>
>> --
>>
>> György Balogh
>> CEO
>> E gyorgy.balogh@ultinous.com <zs...@ultinous.com>
>> M +36 30 270 8342 <+36%2030%20270%208342>
>> A HU, 1117 Budapest, Budafoki út 209.
>> W www.ultinous.com
>>
>

Re: [Question] proper type for beam udf for complex types

Posted by Ahmet Altay <al...@google.com>.
/cc @Kyle Weaver <kc...@google.com>

On Wed, Apr 6, 2022 at 1:57 AM Balogh, György <bo...@ultinous.com> wrote:

> Hi,
> I'd like to use BeamSqlUdf-s with complex (potential nested) types. It is
> not clear how to specify the type to achieve this.
>
> Eg.: I've a rectangle with x,y,width,height and want to operate on this.
> I'm getting this error:
>
> No match found for function signature iou(<RecordType(INTEGER x, INTEGER
> y, INTEGER width, INTEGER height)>) -> [Help 1]
>
> So I'd like to have this type: RecordType(INTEGER x, INTEGER y, INTEGER
> width, INTEGER height)>, how to specify this type in my UDF?
>
> Thank you,
> Gyorgy
>
>
> --
>
> György Balogh
> CEO
> E gyorgy.balogh@ultinous.com <zs...@ultinous.com>
> M +36 30 270 8342 <+36%2030%20270%208342>
> A HU, 1117 Budapest, Budafoki út 209.
> W www.ultinous.com
>