Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[regression test](routine test) add case for exec_mem_limit #27308

Merged
merged 4 commits into from
Nov 23, 2023
Merged
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 @@ -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 @@ -106,7 +106,7 @@ suite("test_routine_load","p0") {
'[\"$.k00\", \"$.k01\", \"$.k02\", \"$.k03\", \"$.k04\", \"$.k05\", \"$.k06\", \"$.k07\", \"$.k08\", \"$.k09\", \"$.k10\", \"$.k11\", \"$.k12\", \"$.k13\", \"$.k14\", \"$.k15\", \"$.k16\", \"$.k17\"]',
]

def columns = [
def columns = [
"k00,k01,k02,k03,k04,k05,k06,k07,k08,k09,k10,k11,k12,k13,k14,k15,k16,k17,k18",
"k00,k01,k02,k03,k04,k05,k06,k07,k08,k09,k10,k11,k12,k13,k14,k15,k16,k17,k18",
"k00,k01,k02,k03,k04,k05,k06,k07,k08,k09,k10,k11,k12,k13,k14,k15,k16,k17,k18",
Expand All @@ -116,8 +116,8 @@ suite("test_routine_load","p0") {
"k00,k01,k02,k03,k04,k05,k06,k07,k08,k09,k10,k11,k12,k13,k14,k15,k16,k17",
]

def timezoneColumns =
[
def timezoneColumns =
[
"k00=unix_timestamp('2007-11-30 10:30:19'),k01,k02,k03,k04,k05,k06,k07,k08,k09,k10,k11,k12,k13,k14,k15,k16,k17,k18",
"k00=unix_timestamp('2007-11-30 10:30:19'),k01,k02,k03,k04,k05,k06,k07,k08,k09,k10,k11,k12,k13,k14,k15,k16,k17,k18",
"k00=unix_timestamp('2007-11-30 10:30:19'),k01,k02,k03,k04,k05,k06,k07,k08,k09,k10,k11,k12,k13,k14,k15,k16,k17,k18",
Expand All @@ -140,7 +140,7 @@ suite("test_routine_load","p0") {
def formats = [
"csv",
"json",
]
]

def loadedRows = [0,0,0,0,17,17,17]

Expand Down Expand Up @@ -216,7 +216,7 @@ suite("test_routine_load","p0") {
sleep(5000)
count++
}

if (i <= 3) {
qt_sql_exec_mem_limit "select * from ${tableName1} order by k00,k01"
} else {
Expand All @@ -233,6 +233,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 Expand Up @@ -538,7 +579,7 @@ suite("test_routine_load","p0") {
sleep(5000)
count++
}

if (i <= 3) {
qt_sql_max_filter_ratio "select * from ${tableName1} order by k00,k01"
} else {
Expand Down Expand Up @@ -603,7 +644,7 @@ suite("test_routine_load","p0") {
} else {
qt_sql_load_to_single_tablet "select * from ${tableName1} order by k00"
}

sql "stop routine load for ${jobs[i]}"
i++
}
Expand Down Expand Up @@ -829,7 +870,7 @@ suite("test_routine_load","p0") {
}
}
}

// disable_simdjson_reader and load json
i = 0
if (enabled != null && enabled.equalsIgnoreCase("true")) {
Expand Down Expand Up @@ -927,7 +968,7 @@ suite("test_routine_load","p0") {
}
}
}


// TODO: need update kafka script
// i = 0
Expand Down Expand Up @@ -1071,13 +1112,13 @@ suite("test_routine_load","p0") {
sleep(5000)
count++
}

if (i <= 3) {
qt_sql_multi_table_one_data "select * from ${tableName1} order by k00,k01"
} else {
qt_sql_multi_table_one_data "select * from ${tableName1} order by k00"
}

i++
}
} finally {
Expand Down Expand Up @@ -1150,13 +1191,13 @@ suite("test_routine_load","p0") {
sleep(5000)
count++
}

if (i <= 3) {
qt_sql_multi_table "select * from ${tableName1} order by k00,k01"
} else {
qt_sql_multi_table "select * from ${tableName1} order by k00"
}

i++
}
} finally {
Expand Down
Loading