@Override public PhysicalPlan getPlan(SqlHandlerConfig config, String sql, SqlNode sqlNode) throws Exception { try{ final ConvertedRelNode convertedRelNode = PrelTransformer.validateAndConvert(config, sqlNode); final RelDataType validatedRowType = convertedRelNode.getValidatedRowType(); final RelNode queryRelNode = convertedRelNode.getConvertedNode(); final Rel drel = PrelTransformer.convertToDrel(config, queryRelNode, validatedRowType); final Pair<Prel, String> convertToPrel = PrelTransformer.convertToPrel(config, drel); final Prel prel = convertToPrel.getKey(); textPlan = convertToPrel.getValue(); final PhysicalOperator pop = PrelTransformer.convertToPop(config, prel); final PhysicalPlan plan = PrelTransformer.convertToPlan(config, pop); logger.debug("Final Physical Plan {}", textPlan); PrelTransformer.log(config, "Dremio Plan", plan, logger); return plan; }catch(Exception ex){ throw SqlExceptionHelper.coerceException(logger, sql, ex, true); } }
final RelDataType validatedRowType = convertedRelNode.getValidatedRowType(); final RelNode queryRelNode = convertedRelNode.getConvertedNode();
final RelDataType validatedRowType = convertedRelNode.getValidatedRowType(); final RelNode queryRelNode = convertedRelNode.getConvertedNode();
final RelDataType validatedRowType = convertedRelNode.getValidatedRowType(); final RelNode queryRelNode = convertedRelNode.getConvertedNode(); final RelNode newViewRelNode = SqlHandlerUtil.resolveNewTableRel(true, createView.getFieldNames(), validatedRowType, queryRelNode);
final RelDataType validatedRowType = convertedRelNode.getValidatedRowType(); final RelNode queryRelNode = convertedRelNode.getConvertedNode();
final RelDataType validatedRowType = convertedRelNode.getValidatedRowType(); final RelNode queryRelNode = convertedRelNode.getConvertedNode(); final RelNode newTblRelNode = SqlHandlerUtil.resolveNewTableRel(false, sqlCreateTable.getFieldNames(), validatedRowType, queryRelNode);