You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "Vikram-Atreya3 (via GitHub)" <gi...@apache.org> on 2025/06/18 06:02:21 UTC

[PR] Fabric Spark - EH Connector [spark]

Vikram-Atreya3 opened a new pull request, #51211:
URL: https://github.com/apache/spark/pull/51211

   Add translate function for eventstream properties to kafka properties
   
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as new features, bug fixes, or other behavior changes. Documentation-only updates are not considered user-facing changes.
   
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
   -->
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   <!--
   If generative AI tooling has been used in the process of authoring this patch, please include the
   phrase: 'Generated-by: ' followed by the name of the tool and its version.
   If no, write 'No'.
   Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
   -->
   


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] Fabric Spark - EH Connector [spark]

Posted by "yogeshgargmsft (via GitHub)" <gi...@apache.org>.
yogeshgargmsft commented on code in PR #51211:
URL: https://github.com/apache/spark/pull/51211#discussion_r2154263554


##########
connector/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala:
##########
@@ -454,6 +478,7 @@ private[kafka010] class KafkaSourceProvider extends DataSourceRegister
     override def toBatch(): Batch = {
       val caseInsensitiveOptions = CaseInsensitiveMap(options.asScala.toMap)
       validateBatchOptions(caseInsensitiveOptions)
+

Review Comment:
   These new line changes should be removed



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] Fabric Spark - EH Connector [spark]

Posted by "yogeshgargmsft (via GitHub)" <gi...@apache.org>.
yogeshgargmsft commented on code in PR #51211:
URL: https://github.com/apache/spark/pull/51211#discussion_r2154268116


##########
connector/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala:
##########
@@ -22,9 +22,9 @@ import java.util.{Locale, UUID}
 
 import scala.jdk.CollectionConverters._
 
+import EventStreamsKafkaConnector.KafkaOptionsUtils
 import org.apache.kafka.clients.consumer.ConsumerConfig
 import org.apache.kafka.clients.producer.ProducerConfig
-import org.apache.kafka.common.TopicPartition

Review Comment:
   Why is this import removed ?



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] Fabric Spark - EH Connector [spark]

Posted by "yogeshgargmsft (via GitHub)" <gi...@apache.org>.
yogeshgargmsft commented on code in PR #51211:
URL: https://github.com/apache/spark/pull/51211#discussion_r2154259807


##########
connector/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala:
##########
@@ -357,6 +358,29 @@ private[kafka010] class KafkaSourceProvider extends DataSourceRegister
     validateGeneralOptions(params)
   }
 
+  private def translateEventStreamProperties(params: CaseInsensitiveMap[String])
+  : CaseInsensitiveMap[String] = {
+    if (params.contains(EVENTSTREAM_NAME_OPTION_KEY) ||
+      params.contains(EVENTSTREAM_ARTIFACT_ID_OPTION_KEY) ||
+      params.contains(EVENTSTREAM_CONSUMER_GROUP_OPTION_KEY)) {
+      validateEventStreamOptions(params)

Review Comment:
   We should perform validation in eventstream jar, we should make minimal changes in spark code base



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] Fabric Spark - EH Connector [spark]

Posted by "yogeshgargmsft (via GitHub)" <gi...@apache.org>.
yogeshgargmsft commented on code in PR #51211:
URL: https://github.com/apache/spark/pull/51211#discussion_r2154258630


##########
connector/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala:
##########
@@ -357,6 +358,29 @@ private[kafka010] class KafkaSourceProvider extends DataSourceRegister
     validateGeneralOptions(params)
   }
 
+  private def translateEventStreamProperties(params: CaseInsensitiveMap[String])

Review Comment:
   Method name should be translateEventStreamPropertiesToKafkaProperties



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] Fabric Spark - EH Connector [spark]

Posted by "yogeshgargmsft (via GitHub)" <gi...@apache.org>.
yogeshgargmsft commented on code in PR #51211:
URL: https://github.com/apache/spark/pull/51211#discussion_r2154261713


##########
connector/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala:
##########
@@ -357,6 +358,29 @@ private[kafka010] class KafkaSourceProvider extends DataSourceRegister
     validateGeneralOptions(params)
   }
 
+  private def translateEventStreamProperties(params: CaseInsensitiveMap[String])
+  : CaseInsensitiveMap[String] = {
+    if (params.contains(EVENTSTREAM_NAME_OPTION_KEY) ||
+      params.contains(EVENTSTREAM_ARTIFACT_ID_OPTION_KEY) ||
+      params.contains(EVENTSTREAM_CONSUMER_GROUP_OPTION_KEY)) {
+      validateEventStreamOptions(params)
+      return CaseInsensitiveMap(KafkaOptionsUtils.buildKafkaOptionsFromSparkConfig(params));

Review Comment:
   Method name should be "EventStreamUtils", KafkaOptionsUtils is a generic name which is more suitable for open source kafka connector utils



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] Fabric Spark - EH Connector [spark]

Posted by "yogeshgargmsft (via GitHub)" <gi...@apache.org>.
yogeshgargmsft commented on code in PR #51211:
URL: https://github.com/apache/spark/pull/51211#discussion_r2154262646


##########
connector/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala:
##########
@@ -357,6 +358,29 @@ private[kafka010] class KafkaSourceProvider extends DataSourceRegister
     validateGeneralOptions(params)
   }
 
+  private def translateEventStreamProperties(params: CaseInsensitiveMap[String])
+  : CaseInsensitiveMap[String] = {
+    if (params.contains(EVENTSTREAM_NAME_OPTION_KEY) ||
+      params.contains(EVENTSTREAM_ARTIFACT_ID_OPTION_KEY) ||
+      params.contains(EVENTSTREAM_CONSUMER_GROUP_OPTION_KEY)) {
+      validateEventStreamOptions(params)

Review Comment:
   In short, my suggestion is to remove this validation method from here



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] Fabric Spark - EH Connector [spark]

Posted by "Vikram-Atreya3 (via GitHub)" <gi...@apache.org>.
Vikram-Atreya3 commented on code in PR #51211:
URL: https://github.com/apache/spark/pull/51211#discussion_r2153715108


##########
connector/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala:
##########
@@ -58,7 +58,7 @@ private[kafka010] class KafkaSourceProvider extends DataSourceRegister
     with Logging {
   import KafkaSourceProvider._
 
-  override def shortName(): String = "kafka"
+  override def shortName(): String = "eventstreams"

Review Comment:
   Will fix this



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] Fabric Spark - EH Connector [spark]

Posted by "yogeshgargmsft (via GitHub)" <gi...@apache.org>.
yogeshgargmsft commented on code in PR #51211:
URL: https://github.com/apache/spark/pull/51211#discussion_r2154266419


##########
connector/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala:
##########
@@ -613,60 +639,6 @@ private[kafka010] object KafkaSourceProvider extends Logging {
   private val serClassName = classOf[ByteArraySerializer].getName
   private val deserClassName = classOf[ByteArrayDeserializer].getName
 
-  def checkStartOffsetNotGreaterThanEndOffset(

Review Comment:
   May be I am missing something, but why are these methods removed ?



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] Fabric Spark - EH Connector [spark]

Posted by "Vikram-Atreya3 (via GitHub)" <gi...@apache.org>.
Vikram-Atreya3 commented on code in PR #51211:
URL: https://github.com/apache/spark/pull/51211#discussion_r2153778598


##########
connector/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala:
##########
@@ -357,6 +358,29 @@ private[kafka010] class KafkaSourceProvider extends DataSourceRegister
     validateGeneralOptions(params)
   }
 
+  private def translateEventStreamProperties(params: CaseInsensitiveMap[String])
+  : CaseInsensitiveMap[String] = {

Review Comment:
   Use reflection instead of import



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] Fabric Spark - EH Connector [spark]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #51211:
URL: https://github.com/apache/spark/pull/51211#issuecomment-3629640559

   We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
   If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] Fabric Spark - EH Connector [spark]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #51211: Fabric Spark - EH Connector
URL: https://github.com/apache/spark/pull/51211


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org