/** * Get the columns from the schema for this physical table. * * @return The columns of this physical table * * @deprecated In favor of getting the columns directly from the schema */ @Deprecated default Set<Column> getColumns() { return getSchema().getColumns(); }
@Override public boolean test(PhysicalTable table) { if (!requestConstraint.getMinimumGranularity().satisfiedBy(table.getSchema().getGranularity())) { return false; } Set<String> supplyNames = table.getSchema().getColumns().stream() .map(Column::getName) .collect(Collectors.toCollection(LinkedHashSet::new)); Set<String> columnNames = requestConstraint.getAllColumnNames(); return supplyNames.containsAll(columnNames); }
/** * Map availabilities in schema-less columns to a {@link Column} keyed availability map for a given table. * * @param rawIntervals The map of physical name to {@link SimplifiedIntervalList}s as the source availability * @param schema The schema describing the columns of this table, which includes the logical -> physical * mappings * * @return map of column to set of available intervals */ default Map<Column, SimplifiedIntervalList> mapToSchemaAvailability( Map<String, SimplifiedIntervalList> rawIntervals, PhysicalTableSchema schema ) { return schema.getColumns().stream() .collect( Collectors.toMap( Function.identity(), column -> rawIntervals.getOrDefault( schema.getPhysicalColumnName(column.getName()), new SimplifiedIntervalList() ) ) ); } }
.map(schema -> schema.getColumns(DimensionColumn.class)) .flatMap(Set::stream) .map(DimensionColumn::getDimension)