feat(engine): build lance-spark bundle from main (lance-core 8.x) + pyspark 4.1.2#94
feat(engine): build lance-spark bundle from main (lance-core 8.x) + pyspark 4.1.2#94jiaoew1991 wants to merge 1 commit into
Conversation
…yspark 4.1.2
Native lance-spark writes (df.write.format("lance")) under RayDP need lance
#6946 — the JNI dispatcher classloader fix (resolve AsyncScanner at JNI_OnLoad
+ pass a GlobalRef to the native dispatcher). Without it the Rust dispatcher
thread does find_class on the *system* classloader, but Ray loads job jars in a
child job classloader, so it panics "AsyncScanner class not found" and kills
the executor on the distributed write.
The released lance-spark-bundle 0.5.1 on Maven still embeds pre-fix lance-core
7.0.0. lance-spark main now pins lance-core 8.0.0-beta.9 (post-#6946) but no
fixed bundle is published to Maven yet, so build it in-image from a pinned main
commit and drop the 0.5.1 wget. Both maven skips are required on a clean CI
.m2: -Dspotless.skip=true (google-java-format breaks on JDK17) and
-Dmaven.javadoc.skip=true (javadoc-plugin 2.9.1 attach-javadocs fails on
lance-spark-base).
Also:
- pin pyspark to ==4.1.2 (was >=4.1,<5) for a reproducible base.
- drop pyspark/jars/connect-repl: the Spark-Connect client fat jar shades Arrow
under org.sparkproject.* and carries a second ArrowUtils whose toArrowSchema
returns the shaded Schema, shadowing the real one on the RayDP executor
classpath and breaking mapInPandas with NoSuchMethodError.
Validated end-to-end on RayDP/dev-sydney: native df.write.format("lance")
downstream of a mapInPandas Arrow UDF, plus a pylance-7.0.0 readback of the
8.x-written table, all pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PR SummaryMedium Risk Overview PySpark is pinned to A new build step clones Reviewed by Cursor Bugbot for commit 77a2ac5. Bugbot is set up for automated code reviews on this repo. Configure here. |
Coverage ReportOverall: 58% Diff Coverage (changed files only)Diff CoverageDiff: origin/develop...HEAD, staged and unstaged changesNo lines with coverage information in this diff. |
What
The engine base now builds the lance-spark bundle from upstream
mainin-image (pinned commit656c882, lance-core 8.0.0-beta.9) instead ofwget-ing the releasedlance-spark-bundle-4.1_2.13/0.5.1from Maven, pins pyspark==4.1.2, and drops the Spark-Connect client fat jar.Why
Native lance-spark writes —
df.write.format("lance")— under RayDP need lance #6946, the JNI dispatcher classloader fix (resolveAsyncScanneratJNI_OnLoad+ hand the native dispatcher aGlobalRef). Without it the Rust dispatcher thread callsfind_classon the system classloader, but Ray loads job jars in a child job classloader, so it panicsAsyncScanner class not foundand kills the executor on the distributed write.The released
0.5.1bundle still embeds pre-fix lance-core 7.0.0. lance-sparkmainpins lance-core 8.0.0-beta.9 (post-#6946) but no fixed bundle is on Maven yet → build it in-image from a pinnedmaincommit. Swap back to a plainwgetonce a fixed bundle is published.Notes
.m2:-Dspotless.skip=true— google-java-format breaks under JDK17-Dmaven.javadoc.skip=true— javadoc-plugin2.9.1attach-javadocsfails buildinglance-spark-base(passes locally only because a dev.m2has cached javadoc artifacts)connect-replremoved: its shaded-ArrowArrowUtilsshadows the real one on the RayDP executor classpath →mapInPandasNoSuchMethodError: ArrowUtils.toArrowSchema.7.0.0(no8.xon PyPI; SDK-7 reads format-8 fine).Validation
End-to-end on RayDP / dev-sydney (RayJob
enwei-lance8-smoke, SUCCEEDED):df.write.format("lance")downstream of amapInPandasArrow UDF — noAsyncScannerpanic, noNoSuchMethodErrorassert rows == 200_000— passedSingle-file change; the publish workflow + raydp-python-pkg + connect-repl-era changes are already on
develop(#91/#92/#93).🤖 Generated with Claude Code