Source:
<code>private TableScanNode createTemporaryTableScan( TableHandle tableHandle, List<VariableReferenceExpression> outputVariables, Map<VariableReferenceExpression, ColumnMetadata> variableToColumnMap, PartitioningMetadata expectedPartitioningMetadata) { Map<String, ColumnHandle> columnHandles = metadata.getColumnHandles(session, tableHandle); Map<VariableReferenceExpression, ColumnMetadata> outputColumns = outputVariables.stream() .collect(toImmutableMap(identity(), variableToColumnMap::get)); Set<ColumnHandle> outputColumnHandles = outputColumns.values().stream() .map(ColumnMetadata::getName) .map(columnHandles::get) .collect(toImmutableSet()); TableLayoutResult selectedLayout = metadata.getLayout(session, tableHandle, Constraint.alwaysTrue(), Optional.of(outputColumnHandles)); verify(selectedLayout.getUnenforcedConstraint().equals(TupleDomain.all()), "temporary table layout shouldn't enforce any constraints"); verify(!selectedLayout.getLayout().getColumns().isPresent(), "temporary table layout must provide all the columns"); List<ColumnHandle> expectedPartitioningColumns = expectedPartitioningMetadata.getPartitionColumns().stream() .map(columnHandles::get) .collect(toImmutableList()); <START> verify(selectedLayout.getLayout().getTablePartitioning().get().getPartitioningColumns() <END> .equals(expectedPartitioningColumns), "invalid temporary table partition columns"); Map<VariableReferenceExpression, ColumnHandle> assignments = outputVariables.stream() .collect(toImmutableMap(identity(), variable -> columnHandles.get(outputColumns.get(variable).getName()))); return new TableScanNode( idAllocator.getNextId(), selectedLayout.getLayout().getNewTableHandle(), outputVariables, assignments, TupleDomain.all(), TupleDomain.all()); }</code><technical_language>this change changed</technical_language>

Target:
private TableScanNode createTemporaryTableScan( TableHandle tableHandle, List<VariableReferenceExpression> outputVariables, Map<VariableReferenceExpression, ColumnMetadata> variableToColumnMap, PartitioningMetadata expectedPartitioningMetadata) { Map<String, ColumnHandle> columnHandles = metadata.getColumnHandles(session, tableHandle); Map<VariableReferenceExpression, ColumnMetadata> outputColumns = outputVariables.stream() .collect(toImmutableMap(identity(), variableToColumnMap::get)); Set<ColumnHandle> outputColumnHandles = outputColumns.values().stream() .map(ColumnMetadata::getName) .map(columnHandles::get) .collect(toImmutableSet()); TableLayoutResult selectedLayout = metadata.getLayout(session, tableHandle, Constraint.alwaysTrue(), Optional.of(outputColumnHandles)); verify(selectedLayout.getUnenforcedConstraint().equals(TupleDomain.all()), "temporary table layout shouldn't enforce any constraints"); verify(!selectedLayout.getLayout().getColumns().isPresent(), "temporary table layout must provide all the columns"); TablePartitioning expectedPartitioning = new TablePartitioning( expectedPartitioningMetadata.getPartitioningHandle(), expectedPartitioningMetadata.getPartitionColumns().stream() .map(columnHandles::get) .collect(toImmutableList())); verify(selectedLayout.getLayout().getTablePartitioning().equals(Optional.of(expectedPartitioning)), "invalid temporary table partitioning"); Map<VariableReferenceExpression, ColumnHandle> assignments = outputVariables.stream() .collect(toImmutableMap(identity(), variable -> columnHandles.get(outputColumns.get(variable).getName()))); return new TableScanNode( idAllocator.getNextId(), selectedLayout.getLayout().getNewTableHandle(), outputVariables, assignments, TupleDomain.all(), TupleDomain.all()); }