Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
56acc8b
[SPARK-60101][SQL] Add a columnar data source API for JVM and native …
HyukjinKwon Oct 9, 2026
b032a0a
Make NativeBridge the only public API of native data sources
HyukjinKwon Oct 9, 2026
1fc3fc7
Pass the options of catalog tables to native data sources
HyukjinKwon Oct 9, 2026
aae6a4f
Find the native data source packages installed in SPARK_HOME automati…
HyukjinKwon Oct 9, 2026
a5d6708
Fix the Connect client compatibility check and the documentation build
HyukjinKwon Oct 9, 2026
4a2026e
Find installed native data source libraries automatically
HyukjinKwon Oct 9, 2026
822d33c
Format NativeDataSourceConnectSuite with scalafmt
HyukjinKwon Oct 9, 2026
9dd4f88
Address review comments on native data source lookup, distribution an…
HyukjinKwon Oct 10, 2026
3814147
Address more review comments on native data source packages and strea…
HyukjinKwon Oct 10, 2026
9ac5a49
Address review comments on sessions, distributed copies, schemas and …
HyukjinKwon Oct 10, 2026
acdc7eb
Check the Arrow data of native data sources, create writers late, pus…
HyukjinKwon Oct 10, 2026
a8f178b
Check the lengths of the arrays that native data sources export
HyukjinKwon Oct 11, 2026
ff7b1ae
Address review comments on the compatibility, predicates and checks o…
HyukjinKwon Oct 13, 2026
b9ad01a
Call native data sources through the FFM API instead of JNI
HyukjinKwon Oct 13, 2026
56febbb
Report FFM loading failures clearly and clarify the C interface
HyukjinKwon Oct 13, 2026
f55105d
Implement the Arrow C data interface with the FFM API, without arrow-…
HyukjinKwon Oct 13, 2026
45f428d
Revert "Implement the Arrow C data interface with the FFM API, withou…
HyukjinKwon Oct 13, 2026
dd3232f
Reject Arrow streams that the library did not initialize
HyukjinKwon Oct 13, 2026
6918d74
Keep a doc comment of NativeDataSourceConnectSuite within the scalafm…
HyukjinKwon Oct 13, 2026
a28dabe
Apply the latest review round of #59313 to the C interface
HyukjinKwon Oct 13, 2026
4f032d5
Ship spark_datasource.h in the include directory of a Spark distribution
HyukjinKwon Oct 14, 2026
e5352e1
Do not abort a data writer that committed, and run the native data so…
HyukjinKwon Oct 14, 2026
d2df236
Give the C interface a function table, structs from Spark, and capabi…
HyukjinKwon Oct 14, 2026
b36ec5e
Pass the name and the options of a data source to create in a size-pr…
HyukjinKwon Oct 15, 2026
51af65c
Say which sources native data sources fit, and what is out of their s…
HyukjinKwon Oct 15, 2026
2e674a2
Call native data sources with a frozen C core and versioned messages
HyukjinKwon Oct 15, 2026
85cc900
Exclude the messages of native data sources from the Python code of t…
HyukjinKwon Oct 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,15 @@ jobs:
export MAVEN_OPTS="-Xss64m -Xmx4g -Xms4g -XX:ReservedCodeCacheSize=128m -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN"
export MAVEN_CLI_OPTS="--no-transfer-progress"
./build/mvn $MAVEN_CLI_OPTS -DskipTests -Pyarn -Pkubernetes -Pvolcano -Phive -Phive-thriftserver -Phadoop-cloud -Pjvm-profiler -Pspark-ganglia-lgpl -Pkinesis-asl -Pcredential-aws clean install
# Native data sources are called with the FFM API, which requires Java 22 or later, so the
# other jobs, on Java 17, skip the tests that load a library. The tests build their library
# with the C++ compiler of the runner.
- name: Test native data sources
run: |
export MAVEN_OPTS="-Xss64m -Xmx4g -Xms4g -XX:ReservedCodeCacheSize=128m -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN"
export MAVEN_CLI_OPTS="--no-transfer-progress"
./build/mvn $MAVEN_CLI_OPTS -pl sql/core -Dtest=none -DwildcardSuites=org.apache.spark.sql.execution.datasources.v2.ffi.NativeDataSourceSuite,org.apache.spark.sql.execution.datasources.v2.ffi.NativeDataSourceClusterSuite test
./build/mvn $MAVEN_CLI_OPTS -pl sql/connect/server -Dtest=none -DwildcardSuites=org.apache.spark.sql.connect.NativeDataSourceConnectSuite test

# Documentation build
docs:
Expand Down
1 change: 1 addition & 0 deletions LICENSE-binary
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ joda-time:joda-time
net.sf.opencsv:opencsv
net.sf.supercsv:super-csv
net.sf.jpam:jpam
org.apache.arrow:arrow-c-data
org.apache.arrow:arrow-compression
org.apache.arrow:arrow-format
org.apache.arrow:arrow-memory-core
Expand Down
81 changes: 81 additions & 0 deletions common/utils/src/main/resources/error/error-conditions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4792,6 +4792,57 @@
],
"sqlState" : "42000"
},
"INVALID_NATIVE_DATA_SOURCE_LIBRARY" : {
"message" : [
"Invalid native data source library <path>:"
],
"subClass" : {
"CANNOT_LOAD" : {
"message" : [
"<reason>"
]
},
"REPLACED" : {
"message" : [
"The library was replaced after Spark loaded it: Spark loaded the build with the SHA-256 checksum <loadedChecksum>, but the file now has the checksum <checksum>. A JVM cannot load another build of a library from the same path, so restart the Spark application to use the new build."
]
},
"UNSUPPORTED_ABI_VERSION" : {
"message" : [
"It requires version <version> of the native data source interface, but Spark supports version <supported>."
]
}
},
"sqlState" : "22023"
},
"INVALID_NATIVE_DATA_SOURCE_PACKAGE" : {
"message" : [
"Invalid native data source package <path>:"
],
"subClass" : {
"INVALID_LIBRARY" : {
"message" : [
"Cannot load the library <library>: <reason>"
]
},
"INVALID_MANIFEST" : {
"message" : [
"<reason>"
]
},
"UNSUPPORTED_ABI_VERSION" : {
"message" : [
"It requires version <version> of the native data source interface, but Spark supports version <supported>."
]
},
"UNSUPPORTED_PLATFORM" : {
"message" : [
"It has no library for the platform <platform>. It has libraries for: <platforms>."
]
}
},
"sqlState" : "22023"
},
"INVALID_NON_DETERMINISTIC_EXPRESSIONS" : {
"message" : [
"The operator expects a deterministic expression, but the actual expression is <sqlExprs>."
Expand Down Expand Up @@ -6262,6 +6313,36 @@
],
"sqlState" : "0A000"
},
"NATIVE_DATA_SOURCE_ERROR" : {
"message" : [
"Failed to <action> native data source <name>: <msg>"
],
"sqlState" : "38000"
},
"NATIVE_DATA_SOURCE_LIBRARY_NOT_FOUND" : {
"message" : [
"Cannot find the native data source library <fileName> with the SHA-256 checksum <checksum>, which is installed at <path> on the driver. Install the same build of the library on every node, at the same path or in the native library path."
],
"sqlState" : "42K02"
},
"NATIVE_DATA_SOURCE_PACKAGE_CONFLICT" : {
"message" : [
"More than one native data source package provides the data source <name>: <packages>. Remove all but one of them."
],
"sqlState" : "42710"
},
"NATIVE_DATA_SOURCE_PACKAGE_NOT_FOUND" : {
"message" : [
"Cannot find the native data source package <fileName> with the SHA-256 checksum <checksum>. Add the package with `spark.addArtifact`, or install the same package under `spark.sql.dataSource.native.paths` on every node."
],
"sqlState" : "42K02"
},
"NATIVE_DATA_SOURCE_UNSUPPORTED_JAVA_VERSION" : {
"message" : [
"Native data sources require Java <required> or later, but Spark runs on Java <current>."
],
"sqlState" : "0A000"
},
"NEAREST_BY_JOIN" : {
"message" : [
"Invalid nearest-by join."
Expand Down
1 change: 1 addition & 0 deletions dev/deps/spark-deps-hadoop-3-hive-2.3
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ antlr4-runtime/4.13.1//antlr4-runtime-4.13.1.jar
aopalliance-repackaged/3.0.6//aopalliance-repackaged-3.0.6.jar
arpack/3.2.0//arpack-3.2.0.jar
arpack_combined_all/0.1//arpack_combined_all-0.1.jar
arrow-c-data/19.0.0//arrow-c-data-19.0.0.jar
arrow-compression/19.0.0//arrow-compression-19.0.0.jar
arrow-format/19.0.0//arrow-format-19.0.0.jar
arrow-memory-core/19.0.0//arrow-memory-core-19.0.0.jar
Expand Down
7 changes: 7 additions & 0 deletions dev/make-distribution.sh
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,13 @@ if [ -f "$DISTDIR"/jars/datasketches-memory-3.0.2.jar ]; then
zip -d "$DISTDIR"/jars/datasketches-memory-3.0.2.jar org/apache/datasketches/memory/internal/ResourceImpl.class
fi

# Copy the C header that the libraries of native data sources implement, and its messages
mkdir -p "$DISTDIR/include"
cp "$SPARK_HOME/sql/core/src/main/resources/org/apache/spark/sql/datasource/spark_datasource.h" \
"$DISTDIR/include/"
cp "$SPARK_HOME/sql/core/src/main/protobuf/org/apache/spark/sql/datasource/spark_datasource.proto" \
"$DISTDIR/include/"

# Only create the yarn directory if the yarn artifacts were built.
if [ -f "$SPARK_HOME"/common/network-yarn/target/scala*/spark-*-yarn-shuffle.jar ]; then
mkdir "$DISTDIR/yarn"
Expand Down
13 changes: 13 additions & 0 deletions docs/_data/menu-sql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,19 @@
url: sql-v2-data-sources.html#streaming
- text: Further Reading
url: sql-v2-data-sources.html#further-reading
- text: Native Data Sources
url: sql-native-data-sources.html
subitems:
- text: Overview
url: sql-native-data-sources.html#overview
- text: How It Works
url: sql-native-data-sources.html#how-it-works
- text: Packages
url: sql-native-data-sources.html#packages
- text: Example in Rust
url: sql-native-data-sources.html#example-in-rust
- text: Example in C++
url: sql-native-data-sources.html#example-in-c
- text: Performance Tuning
url: sql-performance-tuning.html
subitems:
Expand Down
Loading