ImmutableMap.Builder<Symbol, ColumnHandle> newAssignmentsBuilder = ImmutableMap.builder();
for (Map.Entry<Symbol, ColumnHandle> assignmentEntry : assignments.entrySet()) {
ColumnMetadata originalColumn = metadata.getColumnMetadata(tableHandle, assignmentEntry.getValue());
ColumnHandle aliasedColumnHandle = lookupColumns.get(originalColumn.getName());
checkState(aliasedColumnHandle != null, "no matching column for original column %s found!", originalColumn);
newAssignmentsBuilder.put(assignmentEntry.getKey(), aliasedColumnHandle);
}
return new TableScanNode(node.getId(), aliasTableHandle.get(), node.getOutputSymbols(), newAssignmentsBuilder.build(), node.getOriginalConstraint(), node.getGeneratedPartitions());