Skip to content

Commit

Permalink
Rename a function and some variables
Browse files Browse the repository at this point in the history
  • Loading branch information
rcaudy committed Mar 18, 2024
1 parent d3d1a35 commit 8adf2d6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1664,7 +1664,7 @@ private static QueryTable staticIndexedAggregation(
// Create a lookup function from the index table
ac.supplyRowLookup(() -> {
final ToLongFunction<Object> lookupKeyToRowKey =
DataIndexUtils.buildRowKeyLookupMap(indexKeyTable, keyNames);
DataIndexUtils.buildRowKeyMappingFunction(indexKeyTable, keyNames);
return key -> (int) lookupKeyToRowKey.applyAsLong(key);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public static int hashLookupKey(@Nullable final Object key) {
* @param keyColumnNames The key columns to search
* @return A mapping function from lookup keys to {@code indexTable} row keys
*/
public static ToLongFunction<Object> buildRowKeyLookupMap(
public static ToLongFunction<Object> buildRowKeyMappingFunction(
final Table indexTable,
final String[] keyColumnNames) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ private void assertLookup(final DataIndex fullIndex,
final Table subIndexTable = subIndex.table();

final DataIndex.RowKeyLookup fullIndexRowKeyLookup = fullIndex.rowKeyLookup();
final ToLongFunction<Object> subIndexKeyMap =
DataIndexUtils.buildRowKeyLookupMap(subIndex.table(), subIndex.keyColumnNames().toArray(String[]::new));
final ToLongFunction<Object> subIndexRowKeyMappingFunction = DataIndexUtils.buildRowKeyMappingFunction(
subIndex.table(), subIndex.keyColumnNames().toArray(String[]::new));

ChunkSource.WithPrev<?> subKeys = DataIndexUtils.makeBoxedKeySource(subIndex.keyColumns());

Expand All @@ -369,7 +369,7 @@ private void assertLookup(final DataIndex fullIndex,
final Object subKey = subKeyIt.next();

// Verify the row sets at the lookup keys match.
final long subRowKey = subIndexKeyMap.applyAsLong(subKey);
final long subRowKey = subIndexRowKeyMappingFunction.applyAsLong(subKey);
final long fullRowKey = fullIndexRowKeyLookup.apply(subKey, false);

assertEquals(subIndex.rowSetColumn().get(subRowKey), fullIndex.rowSetColumn().get(fullRowKey));
Expand All @@ -382,8 +382,8 @@ private void assertLookupMutator(
final BasicDataIndex subIndex,
final Function<RowSet, RowSet> mutator) {
final Table fullIndexTable = fullIndex.table();
final ToLongFunction<Object> subIndexKeyMap =
DataIndexUtils.buildRowKeyLookupMap(subIndex.table(), subIndex.keyColumnNames().toArray(String[]::new));
final ToLongFunction<Object> subIndexRowKeyMappingFunction = DataIndexUtils.buildRowKeyMappingFunction(
subIndex.table(), subIndex.keyColumnNames().toArray(String[]::new));

ChunkSource.WithPrev<?> fullKeys = DataIndexUtils.makeBoxedKeySource(fullIndex.keyColumns());

Expand All @@ -397,7 +397,7 @@ private void assertLookupMutator(
final RowSet fullRowSet = fullRowSetIt.next();

// Is the key in the sub-index?
final long subRowKey = subIndexKeyMap.applyAsLong(fullKey);
final long subRowKey = subIndexRowKeyMappingFunction.applyAsLong(fullKey);
if (subRowKey == NULL_ROW_KEY) {
// Verify applying the mutator to the full row set results in an empty row set.
assertTrue(mutator.apply(fullRowSet).isEmpty());
Expand Down

0 comments on commit 8adf2d6

Please sign in to comment.