use of org.apache.hadoop.hive.ql.parse.ColumnAccessInfo in project flink by apache.
the class HiveParserCalcitePlanner method logicalPlan.
private RelNode logicalPlan() {
if (semanticAnalyzer.columnAccessInfo == null) {
semanticAnalyzer.columnAccessInfo = new ColumnAccessInfo();
}
subqueryId = 0;
relToRowResolver.clear();
relToHiveColNameCalcitePosMap.clear();
try {
RelNode plan = genLogicalPlan(getQB(), true, null, null);
if (createViewInfo != null) {
semanticAnalyzer.resultSchema = HiveParserUtils.convertRowSchemaToResultSetSchema(relToRowResolver.get(plan), false);
HiveParserUtils.saveViewDefinition(semanticAnalyzer.resultSchema, createViewInfo, semanticAnalyzer.ctx.getTokenRewriteStream(), semanticAnalyzer.unparseTranslator, semanticAnalyzer.getConf());
} else if (ctasCols != null) {
// CTAS doesn't allow specifying col list, so we set it according to result schema
semanticAnalyzer.resultSchema = HiveParserUtils.convertRowSchemaToResultSetSchema(relToRowResolver.get(plan), false);
ctasCols.addAll(semanticAnalyzer.resultSchema);
}
return plan;
} catch (SemanticException e) {
throw new RuntimeException(e);
}
}
Aggregations