konstantinb commented on code in PR #6014: URL: https://github.com/apache/hive/pull/6014#discussion_r2273796052
########## ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ASTConverter.java: ########## @@ -602,12 +604,26 @@ private QueryBlockInfo convertSource(RelNode r) throws CalciteSemanticException // retrieve the base table source. QueryBlockInfo tableFunctionSource = convertSource(tfs.getInput(0)); - String sqAlias = tableFunctionSource.schema.get(0).table; - // the schema will contain the base table source fields - s = new Schema(tfs, sqAlias); - ast = createASTLateralView(tfs, s, tableFunctionSource, sqAlias); + // Create schema that preserves base table columns with original alias, + // but gives new UDTF columns the unique lateral view alias + int baseFieldCount = tableFunctionSource.schema.size(); + List<RelDataTypeField> allOutputFields = tfs.getRowType().getFieldList(); Review Comment: It looks like `final String baseTableAlias = nextAlias();` works just as well, thank you for the suggestion! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org