[fix](load) fix unified load converted failed when forwarding to master (#19779)

This commit is contained in:
Siyang Tang
2023-05-18 12:28:32 +08:00
committed by GitHub
parent f43e8cc98f
commit 50370dead9

View File

@ -598,18 +598,6 @@ public class StmtExecutor {
if (parsedStmt instanceof QueryStmt) {
context.getState().setIsQuery(true);
}
if (parsedStmt instanceof UnifiedLoadStmt) {
// glue code for unified load
final UnifiedLoadStmt unifiedLoadStmt = (UnifiedLoadStmt) parsedStmt;
unifiedLoadStmt.init();
final StatementBase proxyStmt = unifiedLoadStmt.getProxyStmt();
parsedStmt = proxyStmt;
if (!(proxyStmt instanceof LoadStmt)) {
Preconditions.checkState(
parsedStmt instanceof InsertStmt && ((InsertStmt) parsedStmt).needLoadManager(),
new IllegalStateException("enable_unified_load=true, should be external insert stmt"));
}
}
try {
if (context.isTxnModel() && !(parsedStmt instanceof InsertStmt)
@ -874,6 +862,20 @@ public class StmtExecutor {
}
}
// convert unified load stmt here
if (parsedStmt instanceof UnifiedLoadStmt) {
// glue code for unified load
final UnifiedLoadStmt unifiedLoadStmt = (UnifiedLoadStmt) parsedStmt;
unifiedLoadStmt.init();
final StatementBase proxyStmt = unifiedLoadStmt.getProxyStmt();
parsedStmt = proxyStmt;
if (!(proxyStmt instanceof LoadStmt)) {
Preconditions.checkState(
parsedStmt instanceof InsertStmt && ((InsertStmt) parsedStmt).needLoadManager(),
"enable_unified_load=true, should be external insert stmt");
}
}
if (parsedStmt instanceof QueryStmt
|| (parsedStmt instanceof InsertStmt && !((InsertStmt) parsedStmt).needLoadManager())
|| parsedStmt instanceof CreateTableAsSelectStmt