/** * Extract schema components from ResultSet schema. * * @param schema Schema object from the ResultSet * * @return Schema components. */ private Map<String, Object> getSchemaComponents(ResultSetSchema schema) { Map<String, Object> schemaComponents = new HashMap<>(); schemaComponents.put(SCHEMA_TIMEZONE, DateTimeUtils.getTimeZone(schema.getGranularity()).getID()); schemaComponents.put(SCHEMA_GRANULARITY, schema.getGranularity().getName()); schemaComponents.put( SCHEMA_DIM_COLUMNS, schema.getColumns(DimensionColumn.class) .stream() .map(Column::getName) .collect(Collectors.toCollection(LinkedHashSet::new)) ); schemaComponents.put( SCHEMA_METRIC_COLUMNS, getMetricColumnNames(schema) ); return schemaComponents; }