Repository navigation
Convert DeltaV2TableShims from Java to Scala - #7869
Draft
HaoSun1993 wants to merge 5 commits into
Draft
HaoSun1993 wants to merge 5 commits into
HaoSun1993 wants to merge 5 commits into
Conversation
Signed-off-by: Hao Sun <86338940+HaoSun1993@users.noreply.github.com>
Signed-off-by: Hao Sun <86338940+HaoSun1993@users.noreply.github.com>
Signed-off-by: Hao Sun <86338940+HaoSun1993@users.noreply.github.com>
Signed-off-by: Hao Sun <86338940+HaoSun1993@users.noreply.github.com>
Signed-off-by: Hao Sun <86338940+HaoSun1993@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which Delta project/connector is this regarding?
Description
Convert the Spark 4.2
DeltaV2TableShimsimplementation from Java to Scala and move it to the Scala shim source directory. Preserve schema-evolution decisions, metadata-only DELETE dispatch and predicate short-circuiting.Use Scala
Optionfor the capability helper and catalog hook. Update both Scala callers and Spark 4.0/4.1 Java shim variants together. Reuse the existing query-context option and adapt it withScalaUtils.toJavaOptionalat the Java metadata-only DELETE executor boundary. Keep Spark-required arrays,TableChange/TableCapability/predicate hierarchies andSupports*interfaces for their Spark contracts.KernelEngineand protocol/metadata objects are existing library/domain interfaces with no equivalent representation to migrate. DirectArrays.streamtraversal avoids collection copies and extra adapters.Keep the Scala class
private[v2]for its class-type consumers/subclasses withinio.delta.spark.internal.v2. Keep the companion public becauseInMemorySparkTableinorg.apache.spark.sql.delta.catalogcalls its helper across separate package trees. Class and constructor remain JVM-public.Compatibility: the internal helper/hook return descriptors change from
OptionaltoOption; repository callers are migrated and already-compiled consumers must be rebuilt. No required stable external contract was found. Scala protected hooks emit JVM-public methods, so Java subclasses with protected overrides must widen them when rebuilt (protocol,metadata,kernelEngine,initialSnapshot,catalogTable).The adapter may allocate one
Optionalper catalog-backed metadata-only DELETE, outside predicate traversal; empty usesOptional.empty. CapabilitySomereplaces the priorOptional.ofwrapper. No persistent fields, collection copies or per-row adapters are added. Performance is unmeasured; allocation elimination is not assumed. No tests, cases, assertions or coverage are added.How was this patch tested?
build/sbt -DsparkVersion=<version> 'sparkV2/compile'passed for Spark 4.0, 4.1 and 4.2 on commit418750bcd35b067d3619da391aa29de80b8f4ebf(tree15e935babefcf7a947af891c93e65d75a051e6be).scalafmtCheck(3.8.6) passed. A previous fullsparkV2/scalastylerun failed on two existingdeltahadoopconfigurationviolations at unchanged linesKernelContext.scala:39andDeltaV2Table.scala:151; no full module lint pass is claimed.Does this PR introduce any user-facing changes?
No intended query behavior changes. Scala class access is intentionally restricted to V2; the companion remains public. The Java subclass source-compatibility caveat is described above.