@Override public String apply(String input) { return physicalTableSchema.getPhysicalColumnName(input); }
/** * 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() ) ) ); } }
@Override public String getPhysicalColumnName(String logicalName) { if (!getSchema().containsLogicalName(logicalName)) { LOG.warn( "No mapping found for logical name '{}' to physical name on table '{}'. Will use logical name as " + "physical name. This is unexpected and should not happen for properly configured " + "dimensions.", logicalName, getName() ); } return getSchema().getPhysicalColumnName(logicalName); }