This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.1 by this push:
new 75cd4405f60 branch-4.1: [improve](job) Support internal pass-through
properties with "__" prefix in streaming job #62193 (#62251)
75cd4405f60 is described below
commit 75cd4405f60f91455090701582a5808ab5624be5
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sat Apr 11 23:18:54 2026 +0800
branch-4.1: [improve](job) Support internal pass-through properties with
"__" prefix in streaming job #62193 (#62251)
Cherry-picked from #62193
Co-authored-by: wudi <[email protected]>
---
.../insert/streaming/StreamingJobProperties.java | 7 +++++++
.../cdc/test_streaming_mysql_job_create_alter.groovy | 14 ++++++++++----
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/job/extensions/insert/streaming/StreamingJobProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/job/extensions/insert/streaming/StreamingJobProperties.java
index 58e236e6720..7da9f897fe4 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/job/extensions/insert/streaming/StreamingJobProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/job/extensions/insert/streaming/StreamingJobProperties.java
@@ -41,6 +41,7 @@ public class StreamingJobProperties implements JobProperties {
public static final String S3_MAX_BATCH_FILES_PROPERTY =
"s3.max_batch_files";
public static final String S3_MAX_BATCH_BYTES_PROPERTY =
"s3.max_batch_bytes";
public static final String SESSION_VAR_PREFIX = "session.";
+ public static final String INTERNAL_KEY_PREFIX = "__";
public static final String OFFSET_PROPERTY = "offset";
public static final List<String> SUPPORT_STREAM_JOB_PROPS =
Arrays.asList(MAX_INTERVAL_SECOND_PROPERTY,
S3_MAX_BATCH_FILES_PROPERTY, S3_MAX_BATCH_BYTES_PROPERTY,
OFFSET_PROPERTY);
@@ -69,6 +70,12 @@ public class StreamingJobProperties implements JobProperties
{
public void validate() throws AnalysisException {
List<String> invalidProps = new ArrayList<>();
for (String key : properties.keySet()) {
+ // Keys starting with "__" are internal pass-through properties
+ // that are stored as-is without validation, allowing users
+ // to attach custom metadata.
+ if (key.startsWith(INTERNAL_KEY_PREFIX)) {
+ continue;
+ }
if (!SUPPORT_STREAM_JOB_PROPS.contains(key) &&
!key.startsWith(SESSION_VAR_PREFIX)) {
invalidProps.add(key);
}
diff --git
a/regression-test/suites/job_p0/streaming_job/cdc/test_streaming_mysql_job_create_alter.groovy
b/regression-test/suites/job_p0/streaming_job/cdc/test_streaming_mysql_job_create_alter.groovy
index b412c470558..3cff8061616 100644
---
a/regression-test/suites/job_p0/streaming_job/cdc/test_streaming_mysql_job_create_alter.groovy
+++
b/regression-test/suites/job_p0/streaming_job/cdc/test_streaming_mysql_job_create_alter.groovy
@@ -196,7 +196,11 @@ suite("test_streaming_mysql_job_create_alter",
"p0,external,mysql,external_docke
sql """INSERT INTO ${mysqlDb}.${table1} (name, age) VALUES ('B1',
2);"""
}
+ // internal pass-through property "__source_subtype" should be
accepted in job properties
sql """CREATE JOB ${jobName}
+ PROPERTIES (
+ "__source_subtype" = "aws_aurora_mysql"
+ )
ON STREAMING
FROM MYSQL (
"jdbc_url" = "jdbc:mysql://${externalEnvIp}:${mysql_port}",
@@ -205,7 +209,7 @@ suite("test_streaming_mysql_job_create_alter",
"p0,external,mysql,external_docke
"user" = "root",
"password" = "123456",
"database" = "${mysqlDb}",
- "include_tables" = "${table1}",
+ "include_tables" = "${table1}",
"offset" = "initial"
)
TO DATABASE ${currentDb} (
@@ -419,10 +423,11 @@ suite("test_streaming_mysql_job_create_alter",
"p0,external,mysql,external_docke
"""
log.info("jobInfoOrigin: " + jobInfoOrigin)
- // alter job properties
+ // alter job properties with internal pass-through property
sql """ALTER JOB ${jobName}
PROPERTIES(
- "max_interval" = "5"
+ "max_interval" = "5",
+ "__source_subtype" = "aws_rds_mysql"
) """
sql "RESUME JOB where jobname = '${jobName}'";
@@ -452,7 +457,8 @@ suite("test_streaming_mysql_job_create_alter",
"p0,external,mysql,external_docke
log.info("jobInfoCurrent: " + jobInfoCurrent)
assert jobInfoCurrent.get(0).get(0) == jobInfoOrigin.get(0).get(0)
assert jobInfoCurrent.get(0).get(1) == jobInfoOrigin.get(0).get(1)
- assert jobInfoCurrent.get(0).get(2) == "{\"max_interval\":\"5\"}"
+ assert jobInfoCurrent.get(0).get(2).contains("\"max_interval\":\"5\"")
+ assert
jobInfoCurrent.get(0).get(2).contains("\"__source_subtype\":\"aws_rds_mysql\"")
assert jobInfoCurrent.get(0).get(3).contains("latest")
sql """
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]