Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiafi authored and findepi committed Sep 27, 2019
1 parent 6845a1d commit e8a65d9
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,17 @@ public ConnectorInsertTableHandle beginInsert(ConnectorSession session, Connecto
{
JdbcTableHandle handle = (JdbcTableHandle) tableHandle;
ConnectorTableMetadata tableMetadata = getTableMetadata(session, tableHandle, true);
List<ColumnMetadata> nonRowkeyCols = tableMetadata.getColumns().stream()
List<ColumnMetadata> allColumns = tableMetadata.getColumns();
List<ColumnMetadata> nonRowkeyColumns = allColumns.stream()
.filter(column -> !ROWKEY.equalsIgnoreCase(column.getName()))
.collect(toImmutableList());

return new PhoenixOutputTableHandle(
Optional.ofNullable(handle.getSchemaName()),
handle.getTableName(),
nonRowkeyCols.stream().map(ColumnMetadata::getName).collect(toList()),
nonRowkeyCols.stream().map(ColumnMetadata::getType).collect(toList()),
nonRowkeyCols.size() != tableMetadata.getColumns().size());
nonRowkeyColumns.stream().map(ColumnMetadata::getName).collect(toImmutableList()),
nonRowkeyColumns.stream().map(ColumnMetadata::getType).collect(toImmutableList()),
nonRowkeyColumns.size() != allColumns.size());
}

@Override
Expand Down

0 comments on commit e8a65d9

Please sign in to comment.