[fix](Outfile) Infer the column name if the column is expression in select into outfile (#25854)
This pr do two things: 1. Infer the column name if the column is expression in `select into outfile`. The rule for column name generation can be refered in pr: #24990 2. fix bug that it will core dump if the `_schema` fails to build in the open phase in vorc_transformer.cpp TODO: 1. Support infer the column name if the column is expression in `select into outfile` in new optimizer(Nereids).
This commit is contained in:
@ -545,7 +545,8 @@ public class SelectStmt extends QueryStmt {
|
||||
resultExprs.add(rewriteQueryExprByMvColumnExpr(item.getExpr(), analyzer));
|
||||
String columnLabel = null;
|
||||
Class<? extends StatementBase> statementClazz = analyzer.getRootStatementClazz();
|
||||
if (statementClazz != null && !QueryStmt.class.isAssignableFrom(statementClazz)) {
|
||||
if (statementClazz != null
|
||||
&& (!QueryStmt.class.isAssignableFrom(statementClazz) || hasOutFileClause())) {
|
||||
// Infer column name when item is expr
|
||||
columnLabel = item.toColumnLabel(i);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user