[fix](load) fix unified load converted failed when forwarding to master (#19779)
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user