[opt](Nereids) auto fallback when insert unsupport catalog (#33353) (#35453)

pick from master #33353
This commit is contained in:
morrySnow
2024-05-27 16:58:35 +08:00
committed by GitHub
parent 1a52e4f7db
commit 8c4f5af708

View File

@ -111,10 +111,18 @@ public class UnboundTableSinkCreator {
return new UnboundIcebergTableSink<>(nameParts, colNames, hints, partitions,
dmlCommandType, Optional.empty(), Optional.empty(), plan);
}
// TODO: we need to support insert into other catalog
try {
if (ConnectContext.get() != null) {
ConnectContext.get().getSessionVariable().enableFallbackToOriginalPlannerOnce();
}
} catch (Exception e) {
// ignore this.
}
throw new AnalysisException(
"Auto overwrite data to " + curCatalog.getClass().getSimpleName() + " is not supported."
(isOverwrite ? "insert overwrite" : "insert") + " data to " + curCatalog.getClass().getSimpleName()
+ " is not supported."
+ (isAutoDetectPartition
? " PARTITION(*) is only supported in overwrite partition for OLAP table"
: ""));
? " PARTITION(*) is only supported in overwrite partition for OLAP table" : ""));
}
}