[fix](planner) Empty table source should not begin a transaction to avoid infinite transaction (#38991) (#39108)
## Proposed changes Issue Number: close #38956 As title.
This commit is contained in:
@ -196,9 +196,10 @@ public class InsertIntoTableCommand extends Command implements ForwardWithSync,
|
||||
// TODO: support other table types
|
||||
throw new AnalysisException("insert into command only support [olap, hive, iceberg] table");
|
||||
}
|
||||
|
||||
insertExecutor.beginTransaction();
|
||||
insertExecutor.finalizeSink(planner.getFragments().get(0), sink, physicalSink);
|
||||
if (!insertExecutor.isEmptyInsert()) {
|
||||
insertExecutor.beginTransaction();
|
||||
insertExecutor.finalizeSink(planner.getFragments().get(0), sink, physicalSink);
|
||||
}
|
||||
targetTableIf.readUnlock();
|
||||
} catch (Throwable e) {
|
||||
targetTableIf.readUnlock();
|
||||
|
||||
Reference in New Issue
Block a user