jihoonson commented on a change in pull request #8823: Add InputSource and
InputFormat interfaces
URL: https://github.com/apache/incubator-druid/pull/8823#discussion_r344422296
##########
File path:
server/src/main/java/org/apache/druid/segment/indexing/DataSchema.java
##########
@@ -53,38 +57,53 @@
private static final Logger log = new Logger(DataSchema.class);
private static final Pattern INVALIDCHARS = Pattern.compile("(?s).*[^\\S
].*");
private final String dataSource;
- private final Map<String, Object> parser;
private final AggregatorFactory[] aggregators;
private final GranularitySpec granularitySpec;
private final TransformSpec transformSpec;
+ private final Map<String, Object> parserMap;
+ private final ObjectMapper objectMapper;
- private final ObjectMapper jsonMapper;
+ // The below fields can be initialized lazily from parser for backward
compatibility.
+ private TimestampSpec timestampSpec;
+ private DimensionsSpec dimensionsSpec;
- private InputRowParser cachedParser;
+ // This is used for backward compatibility
+ private InputRowParser inputRowParser;
@JsonCreator
public DataSchema(
@JsonProperty("dataSource") String dataSource,
- @JsonProperty("parser") Map<String, Object> parser,
+ @JsonProperty("timestampSpec") @Nullable TimestampSpec timestampSpec, //
can be null in old task spec
+ @JsonProperty("dimensionsSpec") @Nullable DimensionsSpec dimensionsSpec,
// can be null in old task spec
@JsonProperty("metricsSpec") AggregatorFactory[] aggregators,
@JsonProperty("granularitySpec") GranularitySpec granularitySpec,
@JsonProperty("transformSpec") TransformSpec transformSpec,
- @JacksonInject ObjectMapper jsonMapper
+ @Deprecated @JsonProperty("parser") @Nullable Map<String, Object>
parserMap,
+ @JacksonInject ObjectMapper objectMapper
Review comment:
I would rather not adding it because it's never null in production code.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]