[
https://issues.apache.org/jira/browse/BEAM-7511?focusedWorklogId=256283&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-256283
]
ASF GitHub Bot logged work on BEAM-7511:
----------------------------------------
Author: ASF GitHub Bot
Created on: 07/Jun/19 22:59
Start Date: 07/Jun/19 22:59
Worklog Time Spent: 10m
Work Description: akedin commented on pull request #8797: [BEAM-7511]
Fixes the bug in KafkaTable Initialization.
URL: https://github.com/apache/beam/pull/8797#discussion_r291777067
##########
File path:
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/kafka/BeamKafkaTable.java
##########
@@ -45,26 +46,11 @@
private List<TopicPartition> topicPartitions;
private Map<String, Object> configUpdates;
- protected BeamKafkaTable(Schema beamSchema) {
- super(beamSchema);
- }
-
public BeamKafkaTable(Schema beamSchema, String bootstrapServers,
List<String> topics) {
super(beamSchema);
this.bootstrapServers = bootstrapServers;
this.topics = topics;
- }
-
- public BeamKafkaTable(
- Schema beamSchema, List<TopicPartition> topicPartitions, String
bootstrapServers) {
- super(beamSchema);
- this.bootstrapServers = bootstrapServers;
- this.topicPartitions = topicPartitions;
- }
-
- public BeamKafkaTable updateConsumerProperties(Map<String, Object>
configUpdates) {
Review comment:
The only way to call it is by calling `buildBeamSqlTable()` on a
`KafkaTableProvider`, then casting it to correct class, and then calling this
method. I cannot find any code in Beam that does it. And no code should ever be
doing that in the first place. My assumption is it was used in tests similar to
`getBootstrapServers()` in the same class.
+1 to removing the `configUpdates`
----------------------------------------------------------------
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 256283)
Time Spent: 40m (was: 0.5h)
> KafkaTable Initialization
> -------------------------
>
> Key: BEAM-7511
> URL: https://issues.apache.org/jira/browse/BEAM-7511
> Project: Beam
> Issue Type: Bug
> Components: dsl-sql
> Reporter: Alireza Samadianzakaria
> Assignee: Alireza Samadianzakaria
> Priority: Minor
> Time Spent: 40m
> Remaining Estimate: 0h
>
> This exception is thrown when a kafka table is created because.
> Exception in thread "main" java.lang.NullPointerException
> at
> org.apache.beam.sdk.io.kafka.KafkaIO.updateKafkaProperties(KafkaIO.java:1028)
> at org.apache.beam.sdk.io.kafka.KafkaIO.access$900(KafkaIO.java:251)
> at
> org.apache.beam.sdk.io.kafka.KafkaIO$Read.withConsumerConfigUpdates(KafkaIO.java:814)
> at
> org.apache.beam.sdk.extensions.sql.meta.provider.kafka.BeamKafkaTable.buildIOReader(BeamKafkaTable.java:89)
> at
> org.apache.beam.sdk.extensions.sql.impl.rel.BeamIOSourceRel$Transform.expand(BeamIOSourceRel.java:67)
> at
> org.apache.beam.sdk.extensions.sql.impl.rel.BeamIOSourceRel$Transform.expand(BeamIOSourceRel.java:58)
> at org.apache.beam.sdk.Pipeline.applyInternal(Pipeline.java:537)
> at org.apache.beam.sdk.Pipeline.applyTransform(Pipeline.java:488)
> at
> org.apache.beam.sdk.extensions.sql.impl.rel.BeamSqlRelUtils.toPCollection(BeamSqlRelUtils.java:66)
> at
> org.apache.beam.sdk.extensions.sql.impl.rel.BeamSqlRelUtils.lambda$buildPCollectionList$0(BeamSqlRelUtils.java:47)
> at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
> at java.util.Iterator.forEachRemaining(Iterator.java:116)
> at
> java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
> at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
> at
> java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
> at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
> at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
> at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
> at
> org.apache.beam.sdk.extensions.sql.impl.rel.BeamSqlRelUtils.buildPCollectionList(BeamSqlRelUtils.java:48)
> at
> org.apache.beam.sdk.extensions.sql.impl.rel.BeamSqlRelUtils.toPCollection(BeamSqlRelUtils.java:64)
> at
> org.apache.beam.sdk.extensions.sql.impl.rel.BeamSqlRelUtils.lambda$buildPCollectionList$0(BeamSqlRelUtils.java:47)
> at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
> at java.util.Iterator.forEachRemaining(Iterator.java:116)
> at
> java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
> at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
> at
> java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
> at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
> at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
> at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
> at
> org.apache.beam.sdk.extensions.sql.impl.rel.BeamSqlRelUtils.buildPCollectionList(BeamSqlRelUtils.java:48)
> at
> org.apache.beam.sdk.extensions.sql.impl.rel.BeamSqlRelUtils.toPCollection(BeamSqlRelUtils.java:64)
> at
> org.apache.beam.sdk.extensions.sql.impl.rel.BeamSqlRelUtils.toPCollection(BeamSqlRelUtils.java:36)
> at
> org.apache.beam.sdk.extensions.sql.example.MyKafkaExample.main(MyKafkaExample.java:76)
>
> This happens because in
> org.apache.beam.sdk.extensions.sql.meta.provider.kafka, configupdates is not
> initialized anywhere and the method updateConsumerProperties is never called.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)