Skip to content

Commit

Permalink
[regression test](routine test) add case for exec_mem_limit (apache#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
liugddx authored and seawinde committed Nov 28, 2023
1 parent 623cee8 commit c39d45c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,8 @@ private void checkJobProperties() throws UserException {
RoutineLoadJob.DEFAULT_STRICT_MODE,
LoadStmt.STRICT_MODE + " should be a boolean");
execMemLimit = Util.getLongPropertyOrDefault(jobProperties.get(EXEC_MEM_LIMIT_PROPERTY),
RoutineLoadJob.DEFAULT_EXEC_MEM_LIMIT, EXEC_MEM_LIMIT_PRED, EXEC_MEM_LIMIT_PROPERTY + "should > 0");
RoutineLoadJob.DEFAULT_EXEC_MEM_LIMIT, EXEC_MEM_LIMIT_PRED,
EXEC_MEM_LIMIT_PROPERTY + " must be greater than 0");

sendBatchParallelism = ((Long) Util.getLongPropertyOrDefault(jobProperties.get(SEND_BATCH_PARALLELISM),
ConnectContext.get().getSessionVariable().getSendBatchParallelism(), SEND_BATCH_PARALLELISM_PRED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,47 @@ suite("test_routine_load","p0") {
}
}

i = 0
if (enabled != null && enabled.equalsIgnoreCase("true")) {
try {
for (String tableName in tables) {
sql new File("""${context.file.parent}/ddl/${tableName}_drop.sql""").text
sql new File("""${context.file.parent}/ddl/${tableName}_create.sql""").text

def name = "routine_load_" + tableName
try {
sql """
CREATE ROUTINE LOAD ${jobs[i]} ON ${name}
COLUMNS(${columns[i]}),
COLUMNS TERMINATED BY "|"
PROPERTIES
(
"exec_mem_limit" = "test",
"max_batch_interval" = "5",
"max_batch_rows" = "300000",
"max_batch_size" = "209715200"
)
FROM KAFKA
(
"kafka_broker_list" = "${externalEnvIp}:${kafka_port}",
"kafka_topic" = "${topics[i]}",
"property.kafka_default_offsets" = "OFFSET_BEGINNING"
);
"""
sql "sync"
i++
} catch (Exception e) {
log.info("exception: ${e.toString()}".toString())
assertEquals(e.toString(), "java.sql.SQLException: errCode = 2, detailMessage = exec_mem_limit must be greater than 0")
}
}
} finally {
for (String tableName in tables) {
sql new File("""${context.file.parent}/ddl/${tableName}_drop.sql""").text
}
}
}

// timezone
i = 0
if (enabled != null && enabled.equalsIgnoreCase("true")) {
Expand Down

0 comments on commit c39d45c

Please sign in to comment.