[ 
https://issues.apache.org/jira/browse/FLINK-37619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17941437#comment-17941437
 ] 

linqichen commented on FLINK-37619:
-----------------------------------

firstly, i create a mysql -> paimon job。  yaml is:

 
{code:java}
source:
  type: mysql
  name: mysql source
  hostname: xxxxxx
  port: 3306
  username: root
  password: xxxxxx
  tables: my_testdb.test_1,my_testdb.test_2,my_testdb.test_3
  schema-change.enabled: true
  server-id: 25032501-25032505
  server-time-zone: Asia/Shanghai
  connect.max-retries: 3
  connect.timeout: 60s
sink:
  type: paimon
  name: Paimon Sink
  catalog.properties.metastore: hive
  catalog.properties.warehouse: xxxxx
  catalog.properties.uri: xxxxx
  table.properties.metastore.partitioned-table: true
  commit.user: hadoop
  partition.key: 
my_testdb.test_1:my_date;my_testdb.test_2:my_date;my_testdb.test_3:my_date;
pipeline:
  name: Sync MySQL Database to paimon
  parallelism: 1
 
{code}
then,  i add  column in mysql and update:

 
{code:java}
ALTER TABLE  test_1 ADD COLUMN new_column VARCHAR(20);
UPDATE test_1 SET new_column='aabbcc' WHERE 1=1;
 
{code}
 

when i try to read data in paimon , it failed:
{code:java}
hive (my_testdb)> select * from test_1  limit 10;
FAILED: IllegalArgumentException Hive DDL and paimon schema mismatched! It is 
recommended not to write any column definition as Paimon external table can 
read schema from the specified location.
There are 20 fields in Hive DDL: id, name, description, created_date, 
modified_datetime, status, price, quantity, code, category_id, supplier_id, 
discount, tax_rate, total_amount, remarks, is_active, registration_date, 
last_login, phone_number, email_address
There are 21 fields in Paimon schema: id, name, description, created_date, 
modified_datetime, status, price, quantity, code, category_id, supplier_id, 
discount, tax_rate, total_amount, remarks, is_active, registration_date, 
last_login, phone_number, email_address, new_column{code}
 

 

 

 

 

 

 

> cdcpiple sink paimon meet IllegalArgumentException when add column
> ------------------------------------------------------------------
>
>                 Key: FLINK-37619
>                 URL: https://issues.apache.org/jira/browse/FLINK-37619
>             Project: Flink
>          Issue Type: Bug
>          Components: Flink CDC
>    Affects Versions: cdc-3.2.1
>            Reporter: linqichen
>            Priority: Major
>
> hive (my_testdb)> select * from test_1  limit 10;
> FAILED: IllegalArgumentException Hive DDL and paimon schema mismatched! It is 
> recommended not to write any column definition as Paimon external table can 
> read schema from the specified location.
> There are 20 fields in Hive DDL: id, name, description, created_date, 
> modified_datetime, status, price, quantity, code, category_id, supplier_id, 
> discount, tax_rate, total_amount, remarks, is_active, registration_date, 
> last_login, phone_number, email_address
> There are 21 fields in Paimon schema: id, name, description, created_date, 
> modified_datetime, status, price, quantity, code, category_id, supplier_id, 
> discount, tax_rate, total_amount, remarks, is_active, registration_date, 
> last_login, phone_number, email_address, new_column



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to