[ 
https://issues.apache.org/jira/browse/BEAM-7511?focusedWorklogId=256291&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-256291
 ]

ASF GitHub Bot logged work on BEAM-7511:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 07/Jun/19 23:14
            Start Date: 07/Jun/19 23:14
    Worklog Time Spent: 10m 
      Work Description: apilloud commented on pull request #8797: [BEAM-7511] 
Fixes the bug in KafkaTable Initialization.
URL: https://github.com/apache/beam/pull/8797#discussion_r291779115
 
 

 ##########
 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:
   I think it is quite possible that there exists external (possibly not 
opensource) code that extends `KafkaTableProvider` and overloads 
`buildBeamSqlTable()` for the purposes of adding features not in Beam. I've 
written things like this in the past.
   
   Even if that is the case I don't think supporting manipulating a single 
field is a reasonable approach. We should still delete this. (I think it would 
be reasonable to move the construction of the KafkaIO reader and writer into 
seperate functions that can be overloaded, but that doesn't need to be part of 
this change.)
 
----------------------------------------------------------------
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: 256291)
    Time Spent: 50m  (was: 40m)

> 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: 50m
>  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)

Reply via email to