public static List < Expression > renameColumns ( List < String > inputFields , List < Expression > newAliases ) { LinkedHashMap < String , Expression > finalFields = new LinkedHashMap <> ( ) ; inputFields . forEach ( field -> finalFields . put ( field , new UnresolvedReferenceExpression ( field ) ) ) ; newAliases . forEach ( expr -> { String name = expr . accept ( renameColumnExtractor ) ; finalFields . put ( name , expr ) ; } ) ; return new ArrayList <> ( finalFields . values ( ) ) ; }
Creates a projection list that renames existing columns to new names .