apache / paimon

Apache Paimon is a lake format that enables building a Realtime Lakehouse Architecture with Flink and Spark for both streaming and batch operations.
https://paimon.apache.org/
Apache License 2.0
2.39k stars 942 forks source link

[Feature] Add unit test for ALTER TABLE in Flink 1.17 #1152

Closed qidian99 closed 1 year ago

qidian99 commented 1 year ago

Search before asking

Motivation

  1. I ran Flink 1.17 cluster and tested out Paimon catalog DDL scenarios, and add/drop column statements suceeded without exceptions
    ALTER TABLE my_table ADD (
    ts AS TO_TIMESTAMP(log_ts) AFTER log_ts
    );

image

  1. I noticed that SchemaChangeITCase missed the altering columns case, so I tried to add corresponding test cases to SchemaChangeITCase, and got an exception:

image

  1. I noticed that in Flink 1.15 and 1.16,SqlToOperationConverter::convertAlterTable does not support add/drop columns

Altering table add/drop columns is a new feature introduced in Flink 1.17. Therefore, it's better to add tests in paimon-flink-1.17

Solution

Add the corresponding tests that cover add column, drop column and modify column.

Anything else?

No response

Are you willing to submit a PR?

qidian99 commented 1 year ago

As per discussion, the tests are added in paimon-flink-common, which depends on Flink-1.17