Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1824,6 +1824,8 @@ public String getShowCreateInfo() {
appendProperties(sb, JsonFileFormatProperties.PROP_JSON_ROOT, getJsonRoot(), false);
appendProperties(sb, LoadCommand.STRICT_MODE, isStrictMode(), false);
appendProperties(sb, LoadCommand.TIMEZONE, getTimezone(), false);
appendProperties(sb, CreateRoutineLoadInfo.SEND_BATCH_PARALLELISM, getSendBatchParallelism(), false);
appendProperties(sb, CreateRoutineLoadInfo.LOAD_TO_SINGLE_TABLET, isLoadToSingleTablet(), false);
appendProperties(sb, LoadCommand.EXEC_MEM_LIMIT, getMemLimit(), true);
sb.append(")\n");
// 6. data_source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ public void testGetShowCreateInfo() throws UserException {
+ "\"fuzzy_parse\" = \"false\",\n"
+ "\"strict_mode\" = \"false\",\n"
+ "\"timezone\" = \"Asia/Shanghai\",\n"
+ "\"send_batch_parallelism\" = \"1\",\n"
+ "\"load_to_single_tablet\" = \"false\",\n"
+ "\"exec_mem_limit\" = \"2147483648\"\n"
+ ")\n"
+ "FROM KAFKA\n"
Expand All @@ -379,6 +381,24 @@ public void testGetShowCreateInfo() throws UserException {
Assertions.assertEquals(expect, showCreateInfo);
}

@Test
public void testGetShowCreateInfoWithNonDefaultLoadProperties() throws UserException {
KafkaRoutineLoadJob routineLoadJob = new KafkaRoutineLoadJob(
111L, "test_load", 1, 11,
"localhost:9092", "test_topic", UserIdentity.ADMIN);

Deencapsulation.setField(routineLoadJob, "sendBatchParallelism", 2);
Deencapsulation.setField(routineLoadJob, "loadToSingleTablet", true);

String showCreateInfo = routineLoadJob.getShowCreateInfo();

String expectedProperties = "\"send_batch_parallelism\" = \"2\",\n"
+ "\"load_to_single_tablet\" = \"true\",\n"
+ "\"exec_mem_limit\" = \"2147483648\"\n";

Assertions.assertTrue(showCreateInfo.contains(expectedProperties), showCreateInfo);
}

@Test
public void testParseUniqueKeyUpdateMode() {
// Test valid mode strings
Expand Down
Loading