/** * Generates ZonedSchema object from given JsonNode. * * @param schemaNode JsonNode which contains all the columns, timezone and granularity * * @return ResultSetSchema object generated from the JsonNode */ private ResultSetSchema getResultSetSchema(JsonNode schemaNode) { DateTimeZone timezone = generateTimezone( schemaNode.get(SCHEMA_TIMEZONE).asText(), DateTimeZone.forID( SYSTEM_CONFIG.getStringProperty(SYSTEM_CONFIG.getPackageVariableName("timezone"), "UTC") ) ); //Recreate ResultSetSchema LinkedHashSet<Column> columns = Stream.concat( Streams.stream(schemaNode.get(SCHEMA_DIM_COLUMNS)) .map(JsonNode::asText) .map(this::resolveDimensionName) .map(DimensionColumn::new), Streams.stream(() -> schemaNode.get(SCHEMA_METRIC_COLUMNS_TYPE).fields()) .map(entry -> new MetricColumnWithValueType(entry.getKey(), entry.getValue().asText())) ).collect(Collectors.toCollection(LinkedHashSet::new)); return new ResultSetSchema(generateGranularity(schemaNode.get(SCHEMA_GRANULARITY).asText(), timezone), columns); }
metricsRows.get(metricColumn.getName()).toString(), metricColumn.getClassType()