Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support struct type field when creating materialized view #1285

Open
akrambek opened this issue Oct 8, 2024 · 0 comments
Open

Support struct type field when creating materialized view #1285

akrambek opened this issue Oct 8, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@akrambek
Copy link
Contributor

akrambek commented Oct 8, 2024

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                                                                |           |
 
@akrambek akrambek added the enhancement New feature or request label Oct 8, 2024
@akrambek akrambek self-assigned this Oct 8, 2024
@akrambek akrambek changed the title Support struct type fields when creating materialized view Support struct type field when creating materialized view Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant