[Enhancement](array-type) Add readable information in subquery for array type #12463

This commit is contained in:
xy720
2022-09-09 11:17:50 +08:00
committed by GitHub
parent a04f9814fe
commit 73351917ab

View File

@ -109,7 +109,9 @@ public class Subquery extends Expr {
ArrayList<Expr> stmtResultExprs = stmt.getResultExprs();
if (stmtResultExprs.size() == 1) {
type = stmtResultExprs.get(0).getType();
Preconditions.checkState(!type.isComplexType());
if (type.isComplexType()) {
throw new AnalysisException("A subquery should not return Array/Map/Struct type: " + toSql());
}
} else {
type = createStructTypeFromExprList();
}