Skip to content

Commit

Permalink
add synthetic columns to wildcard queries
Browse files Browse the repository at this point in the history
  • Loading branch information
jbellis committed Nov 22, 2024
1 parent 5b296bb commit 3a50985
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,21 @@ abstract class ColumnFilterFactory
*/
abstract ColumnFilter newInstance(List<Selector> selectors);

public static ColumnFilterFactory wildcard(TableMetadata table)
public static ColumnFilterFactory wildcard(TableMetadata table, Set<ColumnMetadata> orderingColumns)
{
return new PrecomputedColumnFilter(ColumnFilter.all(table));
ColumnFilter cf;
if (orderingColumns.isEmpty())
{
cf = ColumnFilter.all(table);
}
else
{
ColumnFilter.Builder builder = ColumnFilter.selectionBuilder();
builder.addAll(table.regularAndStaticColumns());
builder.addAll(orderingColumns);
cf = builder.build();
}
return new PrecomputedColumnFilter(cf);
}

public static ColumnFilterFactory fromColumns(TableMetadata table,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ public SimpleSelection(TableMetadata table,
selectedColumns,
orderingColumns,
SelectionColumnMapping.simpleMapping(selectedColumns),
isWildcard ? ColumnFilterFactory.wildcard(table)
isWildcard ? ColumnFilterFactory.wildcard(table, orderingColumns)
: ColumnFilterFactory.fromColumns(table, selectedColumns, orderingColumns, Collections.emptySet(), returnStaticContentOnPartitionWithNoRows),
isWildcard,
isJson);
Expand Down

0 comments on commit 3a50985

Please sign in to comment.