Skip to content

Commit 589141e

Browse files
committed
[SPARK-53233][SQL][FOLLOWUP] Add compatibility class/object for org.apache.spark.sql.execution.streaming
### What changes were proposed in this pull request? This is a followup of #51959 . Although internal APIs are allowed to be changed, it's still better to keep compatibility if possible to avoid breaking existing Spark plugins. This PR brings back `HDFSMetadataLog` and `SerializedOffset` to the original package, to avoid breaking the pulsar data source: https://github.com/streamnative/pulsar-spark/blob/master/src/main/scala/org/apache/spark/sql/pulsar/PulsarSources.scala#L27 ### Why are the changes needed? Avoid breaking Spark plugins ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? manual test ### Was this patch authored or co-authored using generative AI tooling? no Closes #52387 from cloud-fan/compat. Lead-authored-by: Wenchen Fan <[email protected]> Co-authored-by: Wenchen Fan <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
1 parent 4f10262 commit 589141e

File tree

1 file changed

+33
-0
lines changed
  • sql/core/src/main/scala/org/apache/spark/sql/execution/streaming

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.spark.sql.execution.streaming
19+
20+
import scala.reflect.ClassTag
21+
22+
import org.apache.spark.sql.SparkSession
23+
import org.apache.spark.sql.execution.streaming.checkpointing.{HDFSMetadataLog => ActualHDFSMetadataLog}
24+
import org.apache.spark.sql.execution.streaming.runtime.{SerializedOffset => ActualSerializedOffset}
25+
26+
@deprecated("use org.apache.spark.sql.execution.streaming.checkpointing.HDFSMetadataLog")
27+
class HDFSMetadataLog[T <: AnyRef: ClassTag](sparkSession: SparkSession, path: String)
28+
extends ActualHDFSMetadataLog[T](sparkSession, path)
29+
30+
@deprecated("use org.apache.spark.sql.execution.streaming.runtime.SerializedOffset")
31+
object SerializedOffset {
32+
def apply(offset: String): ActualSerializedOffset = ActualSerializedOffset(offset)
33+
}

0 commit comments

Comments
 (0)