[ https://issues.apache.org/jira/browse/FLINK-9627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fabian Hueske closed FLINK-9627. -------------------------------- Resolution: Fixed Fix Version/s: 1.5.1 1.4.3 1.6.0 Fixed for 1.6.0 with 65ad34ca128d6e9b7f81df71cb7f0bbcc54e016a Fixed for 1.5.1 with 84f94809daaec8a5ecaa7e4b42a673bdf5cf1c1c Fixed for 1.4.3 with 8fa60ec20e45c311afc30eb6658ee6edddc65a64 > Extending 'KafkaJsonTableSource' according to comments will result in NPE > ------------------------------------------------------------------------- > > Key: FLINK-9627 > URL: https://issues.apache.org/jira/browse/FLINK-9627 > Project: Flink > Issue Type: Bug > Affects Versions: 1.5.0 > Reporter: Dominik Wosiński > Assignee: vinoyang > Priority: Major > Labels: pull-request-available > Fix For: 1.6.0, 1.4.3, 1.5.1 > > > According to the comments what is needed to extend the 'KafkaJsonTableSource' > looks as follows: > > {code:java} > A version-agnostic Kafka JSON {@link StreamTableSource}. > * > * <p>The version-specific Kafka consumers need to extend this class and > * override {@link #createKafkaConsumer(String, Properties, > DeserializationSchema)}}. > * > * <p>The field names are used to parse the JSON file and so are the > types.{code} > This will cause an NPE, since there is no default value for startupMode in > the abstract class itself only in the builder of this class. > For the 'getKafkaConsumer' method the switch statement will be executed on > non-initialized 'startupMode' field: > {code:java} > switch (startupMode) { > case EARLIEST: > kafkaConsumer.setStartFromEarliest(); > break; > case LATEST: > kafkaConsumer.setStartFromLatest(); > break; > case GROUP_OFFSETS: > kafkaConsumer.setStartFromGroupOffsets(); > break; > case SPECIFIC_OFFSETS: > kafkaConsumer.setStartFromSpecificOffsets(specificStartupOffsets); > break; > }{code} > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)