apache / apache/seatunnel

[Bug] Exception in variable acquisition for save_mode_create_template

Open
#10,043 0 comments 0 reactions 1 assignee View on GitHub

@Kurola-Bryson is already working on this.

Since Nov 8, 2025.

bug
Dominant language
Java
Stars
9.7k
Forks
2.4k
Avg merge
3d 9h
Merged PRs (30d)
204

Description

Search before asking
  • I had searched in the issues and found no similar issues.
What happened

2.3.12 After executing the seatunnel task, the conversion of config's save_mode_create_template only recognized the passed table name ${table}, all fields and field comments of ${rowtype_fields}, but did not retrieve the primary key ${rowtype_primary_key} and table comment ${comment}. If the primary key is empty after conversion, the task will fail. The source-side table has a primary key and table comment, but only the specified primary key and table comment can be displayed. Similar cases were also found in holo sink, where the sink-side automatic table creation detected that the table lacks comments. Perhaps automatic table creation in other sinks may also have similar issues. The automatically created table did not set the primary key of the source-side table, nor did it include the comments of the source-side table.

SeaTunnel Version

2.3.12

SeaTunnel Config
env {
  parallelism = 4
  job.mode = "BATCH"
}

source {
  Jdbc {
    url = "jdbc:mysql://***.mysql.rds.aliyuncs.com:3306/***?serverTimezone=GMT%2b8&useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true"
    driver = "com.mysql.cj.jdbc.Driver"
    connection_check_timeout_sec = 100
    username = "***"
    password = "***"
    query = "select * from zbx_payment_info limit 16;"
  }
}

transform {
}

sink {
  Maxcompute {
    accessId = "***"
    accesskey = "***"
    endpoint = "http://***/api"
    project = "***"
    table_name = "zbx_payment_info"
    schema_save_mode = "RECREATE_SCHEMA"
    data_save_mode = "DROP_DATA"
	save_mode_create_template = "CREATE TABLE IF NOT EXISTS `${table}` (${rowtype_fields}, PRIMARY KEY (${rowtype_primary_key}))TBLPROPERTIES ('transactional'='true','comment'=${comment});"
  }
}
Running Command
seatunnel.sh --config mysql2mc_test.conf -m local
Error Exception
Failed to retrieve the primary key ${rowtype_primary_key} and table comment ${comment}; an empty primary key after conversion will cause the task to fail
Zeta or Flink or Spark Version

zeta2.3.12

Java or Scala Version

java1.8

Screenshots
Image Image Image Image
Are you willing to submit PR?
  • Yes I am willing to submit a PR!
Code of Conduct

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.