4242# 4. Open a focused PR.
4343#
4444# Environment overrides:
45- # UC_DIR directory to clone into (default: /tmp/unitycatalog)
46- # UC_REPO git remote URL (default: upstream unitycatalog)
47- # UC_REF must be `main` or UC_PIN_SHA (default: UC_PIN_SHA below)
48- # UC_FORCE set to "1" to rebuild even when the Ivy artifact exists
45+ # UC_DIR directory to clone into (default: /tmp/unitycatalog)
46+ # UC_REPO git remote URL (default: upstream unitycatalog)
47+ # UC_REF must be `main` or UC_PIN_SHA (default: UC_PIN_SHA below)
48+ # UC_FORCE set to "1" to rebuild even when the Ivy artifact exists
49+ # SPARK_VERSION Spark major.minor UC should build for (default: 4.1)
50+ # Forwarded as -DsparkVersion to UC's sbt; also determines the published
51+ # artifact name (unitycatalog-spark_${X.Y}_2.13). Delta's build.sbt sets
52+ # this from CrossSparkVersions when invoking the script; matrix CI
53+ # workflows set it from `matrix.spark_version`. Default matches UC's own
54+ # default in project/spark-versions.json - workflows that don't care which
55+ # Spark variant UC builds (kernel/flink/etc.) inherit it.
4956#
5057# UC_REF is restricted to exactly two values by design: the pinned SHA (the normal case) or
5158# `main` (for the floating-main canary flow). Any other value is rejected. CI should never set
@@ -57,14 +64,15 @@ set -euo pipefail
5764# The pin. Bump both lines together if UC's version.sbt changed at the new SHA. build.sbt's
5865# `unityCatalogVersion` is obtained by running this script with `--print-version`, so these two
5966# values are the single source of truth.
60- UC_PIN_SHA=cd6fec685e9c2ce23fd85552ffac94c7b7e9cbd6
67+ UC_PIN_SHA=af090e73979bc216a0fe8feff59a5bbce0f41f14
6168UC_BASE_VERSION=0.5.0-SNAPSHOT
6269# ---------------------------------------------------------------------------------------------
6370
6471UC_DIR=" ${UC_DIR:-/ tmp/ unitycatalog} "
6572UC_REPO=" ${UC_REPO:- https:// github.com/ unitycatalog/ unitycatalog.git} "
6673UC_REF=" ${UC_REF:- $UC_PIN_SHA } "
6774UC_FORCE=" ${UC_FORCE:- 0} "
75+ SPARK_VERSION=" ${SPARK_VERSION:- 4.1} "
6876
6977# Enforce the two-value contract. Anything else is either a typo or a misuse and would bypass the
7078# safety check below.
92100# Canonical Ivy + Maven artifact paths. Delta depends on all three UC modules; sbt resolves from
93101# ~/.ivy2/local, mvn (kernel-examples integration tests) resolves from ~/.m2/repository. If any
94102# is missing in either layout we must re-publish.
103+ # UC publishes its Spark connector under a per-Spark-version coordinate
104+ # (e.g. unitycatalog-spark_4.1_2.13). The suffix tracks SPARK_VERSION so the
105+ # canary check matches whatever variant we tell UC to build below.
106+ UC_SPARK_ARTIFACT=" unitycatalog-spark_${SPARK_VERSION} _2.13"
95107IVY_LOCAL=" $HOME /.ivy2/local/io.unitycatalog"
96108IVY_CANARY_CLIENT=" $IVY_LOCAL /unitycatalog-client/$UC_VERSION /ivys/ivy.xml"
97109IVY_CANARY_SERVER=" $IVY_LOCAL /unitycatalog-server/$UC_VERSION /ivys/ivy.xml"
98- IVY_CANARY_SPARK=" $IVY_LOCAL /unitycatalog-spark_2.13 /$UC_VERSION /ivys/ivy.xml"
110+ IVY_CANARY_SPARK=" $IVY_LOCAL /$UC_SPARK_ARTIFACT /$UC_VERSION /ivys/ivy.xml"
99111IVY_CANARY_HADOOP=" $IVY_LOCAL /unitycatalog-hadoop/$UC_VERSION /ivys/ivy.xml"
100112M2_LOCAL=" $HOME /.m2/repository/io/unitycatalog"
101113M2_CANARY_CLIENT=" $M2_LOCAL /unitycatalog-client/$UC_VERSION /unitycatalog-client-$UC_VERSION .pom"
102114M2_CANARY_SERVER=" $M2_LOCAL /unitycatalog-server/$UC_VERSION /unitycatalog-server-$UC_VERSION .pom"
103- M2_CANARY_SPARK=" $M2_LOCAL /unitycatalog-spark_2.13 /$UC_VERSION /unitycatalog-spark_2.13 -$UC_VERSION .pom"
115+ M2_CANARY_SPARK=" $M2_LOCAL /$UC_SPARK_ARTIFACT /$UC_VERSION /$UC_SPARK_ARTIFACT -$UC_VERSION .pom"
104116M2_CANARY_HADOOP=" $M2_LOCAL /unitycatalog-hadoop/$UC_VERSION /unitycatalog-hadoop-$UC_VERSION .pom"
105117ALL_CANARIES=(" $IVY_CANARY_CLIENT " " $IVY_CANARY_SERVER " " $IVY_CANARY_SPARK " " $IVY_CANARY_HADOOP "
106118 " $M2_CANARY_CLIENT " " $M2_CANARY_SERVER " " $M2_CANARY_SPARK " " $M2_CANARY_HADOOP " )
@@ -175,9 +187,16 @@ echo ">>> Building and publishing UC client + server to local Maven repo"
175187 hadoop/publishM2
176188
177189# spark/publishM2 can hit a transient coursier lock race - retry up to 3 times.
178- echo " >>> Building and publishing UC spark module to local Maven repo"
190+ # -DsparkVersion picks the Spark variant UC builds against; the resulting artifact is
191+ # unitycatalog-spark_${SPARK_VERSION}_2.13, matching UC_SPARK_ARTIFACT above.
192+ # -DskipDeltaSpark=true drops UC's test-only delta-spark_X.Y dep, which would otherwise
193+ # fail resolution: we publish UC before Delta itself is built, and on snapshot Spark
194+ # versions (e.g. 4.2) no matching delta-spark release exists at all.
195+ echo " >>> Building and publishing UC spark module (Spark $SPARK_VERSION ) to local Maven repo"
179196for attempt in 1 2 3; do
180197 if ./build/sbt \
198+ -DsparkVersion=" $SPARK_VERSION " \
199+ -DskipDeltaSpark=true \
181200 " $SET_VERSION_CMD " \
182201 " set client / Compile / packageDoc / publishArtifact := false" \
183202 spark/publishLocal \
0 commit comments