jerrypeng commented on code in PR #58213: URL: https://github.com/apache/spark/pull/58213#discussion_r3855487974
########## connector/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaRealTimeModeSourceEvolutionSuite.scala: ########## @@ -0,0 +1,261 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.kafka010 + +import java.io.File + +import org.scalatest.matchers.should.Matchers + +import org.apache.spark.SparkContext +import org.apache.spark.sql.AnalysisException +import org.apache.spark.sql.execution.datasources.v2.{LowLatencyClock, StreamingDataSourceV2Relation, StreamingDataSourceV2ScanRelation} +import org.apache.spark.sql.execution.streaming.RealTimeTrigger +import org.apache.spark.sql.execution.streaming.checkpointing.{OffsetMap, OffsetSeqLog} +import org.apache.spark.sql.execution.streaming.runtime.StreamExecution +import org.apache.spark.sql.execution.streaming.sources.ContinuousMemorySink +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.streaming.OutputMode.Update +import org.apache.spark.sql.test.TestSparkSession +import org.apache.spark.util.SystemClock + +/** + * Tests for streaming source naming and source evolution + * ([[SQLConf.ENABLE_STREAMING_SOURCE_EVOLUTION]]) with the Kafka source under Real-Time Mode. + * + * This is the Kafka counterpart to + * `org.apache.spark.sql.streaming.RealTimeModeSourceEvolutionSuite`. Because Kafka is reachable + * through `spark.readStream`, sources are named with the `.name()` API directly rather than by + * wrapping the logical plan, which is how a user actually names a Kafka source. The checks confirm + * that named Kafka sources get name-keyed checkpoint paths and a v2 name-keyed offset log under + * RTM, and that the naming enforcement rules fire on the RTM path. + */ +class KafkaRealTimeModeSourceEvolutionSuite extends KafkaSourceTest with Matchers { Review Comment: Can we also test the scenario in which we just swap / change kafka topics? -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
