Skip to content

Support struct type field when creating materialized view #1285

@akrambek

Description

@akrambek

If we have the following method whose return type is struct

CREATE FUNCTION assess_fround(varchar, varchar, double precision) RETURNS struct<summary varchar, risk int>
LANGUAGE python AS assess_fround;

and create a materialized view using that method

CREATE MATERIALIZED VIEW streampay_payment_risk_assesment AS
  SELECT
      id,
      to_user_id_identity,
      assess_fround(from_username, to_username, amount) as response
  FROM
      streampay_payment_requests;

risingwave binding fails to create a materialized view and the reason is when we describe materialized view response type is empty that can't figure out how to create topic and schema registry.

                Name                |                                            Type                                            | Is Hidden | Description
------------------------------------+--------------------------------------------------------------------------------------------+-----------+-------------
 id                                 | character varying                                                                          | false     |
 to_user_id_identity                | character varying                                                                          | false     |
 response                           |                                                                                            | false     |
 streampay_payment_requests._row_id | serial                                                                                     | true      |
 streampay_payment_requests.$expr1  | character varying                                                                          | true      |
 primary key                        | streampay_payment_requests._row_id, to_user_id_identity, streampay_payment_requests.$expr1 |           |
 distribution key                   | streampay_payment_requests.$expr1                                                          |           |
 table description                  | streampay_payment_risk_test                                                                |           |
 

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions