gamblewin opened a new issue, #8260:
URL: https://github.com/apache/hudi/issues/8260

   - Problem
   Now I want to do a poc on hudi with flinksql. That is I have table A and 
table B, and I join table A and table B to get a new table C. Now when I make 
changes to base table(table A or table B), how to make table C auto update?
   
   - Example
   1 create table hudi_patient
   ```sql
   create table hudi_patient(
        id bigint,
        name String,
        PRIMARY KEY (`id`) NOT ENFORCED
   )
   with(
   'connector'='hudi',
   'path'='/Users/gamblewin/hudi/hudi_patient',
   'hoodie.datasource.write.recordkey.field'='id',
   'hoodie.parquet.max.file.size'='268435456',
   'hoodie.datasource.write.recordkey.field'='id',
   'changelog.enabled'='true',
   'table.type'='COPY_ON_WRITE'
   );
   ```
   2 insert data into hudi_patient
   ```sql
   insert into hudi_patient(id, name) VALUES(1, 'otis');
   ```
   
   3 create table hudi_disease
   ```sql
   create table hudi_disease(
        id bigint,
        disease_name String,
        PRIMARY KEY (`id`) NOT ENFORCED
   )
   with(
   'connector'='hudi',
   'path'='/Users/gamblewin/hudi/hudi_disease',
   'hoodie.datasource.write.recordkey.field'='id',
   'hoodie.parquet.max.file.size'='268435456',
   'hoodie.datasource.write.recordkey.field'='id',
   
   'table.type'='COPY_ON_WRITE'
   );
   ```
   
   4 insert data into hudi_disease
   ```sql
   insert into hudi_disease(id, disease_name) VALUES (1, 'headache');
   ```
   
   5 create a join table hudi_pat_disease
   ```sql
   create table hudi_pat_disease(
        id BIGINT,
        name STRING,
        disease_name STRING,
        PRIMARY KEY(id) NOT ENFORCED
   ) WITH (
        'connector'='hudi',
        'path'='/Users/gamblewin/hudi/hudi_pat_diesease',
        'hoodie.datasource.write.recordkey.field'='id',
        'hoodie.parquet.max.file.size'='268435456',
        'hoodie.datasource.write.recordkey.field'='id',
        'changelog.enabled'='true',
        'table.type'='COPY_ON_WRITE'
   )
   ```
   
   6 insert join data into hudi_pat_disease
   ```sql
   insert into hudi_pat_disease
   select
        hudi_patient.id as id,
        hudi_patient.name as name,
        hudi_disease.disease_name as disease_name
   from
        hudi_patient
   left join
        hudi_disease
   on
        hudi_patient.id = hudi_disease.id;
   ```
   
   7 now I can get data `1  otis  headache` from `hudi_pat_disease`,
   but when I `insert into hudi_patient(id, name) VALUES (2, 'gamblewin`),
   I expect a new record `2, gambelwin, NULL` from table `hudi_pat_disease`,
    but `hudi_pat_disease` will not automatically update this record based on 
changes of `hudi_patient`,
   so how does hudi implement this auto incremental functionality.
   
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to