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

[Fix](iot) Fix unexpected error when iot auto detect get no data #40657

Merged
merged 2 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -79,6 +79,9 @@ public static void replacePartition(TableIf olapTable, List<String> partitionNam
ReplacePartitionClause replacePartitionClause = new ReplacePartitionClause(
new PartitionNames(false, partitionNames),
new PartitionNames(true, tempPartitionNames), true, properties);
if (replacePartitionClause.getTempPartitionNames().isEmpty()) {
return;
}
Env.getCurrentEnv()
.replaceTempPartition((Database) olapTable.getDatabase(),
(OlapTable) olapTable, replacePartitionClause);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,15 @@ suite("test_iot_auto_detect") {
qt_sql " select * from dt order by k0; "
try {
sql """ insert overwrite table dt partition(*) values ("2023-02-02"), ("3000-12-12"); """
fail()
} catch (Exception e) {
log.info(e.getMessage())
assertTrue(e.getMessage().contains('Insert has filtered data in strict mode') ||
e.getMessage().contains('Cannot found origin partitions in auto detect overwriting'))
}
zclllyybb marked this conversation as resolved.
Show resolved Hide resolved
}

// test no rows(no partition hits) overwrite
sql " create table dt2 like dt"
zclllyybb marked this conversation as resolved.
Show resolved Hide resolved
sql " insert overwrite table dt2 partition(*) select * from dt2"
sql " insert overwrite table dt partition(*) select * from dt2"
}
Loading