Skip to content

Commit

Permalink
chore(deps): add iceberg jar to pyspark install for catalog testing
Browse files Browse the repository at this point in the history
  • Loading branch information
gforsyth committed Jul 18, 2024
1 parent 3b2a7ec commit 4e3fb6a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
10 changes: 10 additions & 0 deletions ibis/backends/pyspark/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@ def connect(*, tmpdir, worker_id, **kw):
.config("spark.sql.streaming.schemaInference", True)
)

config = (
config.config(
"spark.sql.extensions",
"org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions",
)
.config("spark.sql.catalog.local", "org.apache.iceberg.spark.SparkCatalog")
.config("spark.sql.catalog.local.type", "hadoop")
.config("spark.sql.catalog.local.warehouse", "icehouse")
)

try:
from delta.pip_utils import configure_spark_with_delta_pip
except ImportError:
Expand Down
17 changes: 16 additions & 1 deletion poetry-overrides.nix
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
_final: _prev: { }
final: prev: {
pyspark = prev.pyspark.overridePythonAttrs (attrs:
let
icebergJarUrl = "https://search.maven.org/remotecontent?filepath=org/apache/iceberg/iceberg-spark-runtime-3.5_2.12/1.5.2/iceberg-spark-runtime-3.5_2.12-1.5.2.jar";
icebergJar = final.pkgs.fetchurl {
name = "iceberg-spark-runtime-3.5_2.12-1.5.2.jar";
url = icebergJarUrl;
sha256 = "12v1704h0bq3qr2fci0mckg9171lyr8v6983wpa83k06v1w4pv1a";
};
in
{
postInstall = attrs.postInstall or "" + ''
cp ${icebergJar} $out/${final.python.sitePackages}/pyspark/jars/${icebergJar.name}
'';
});
}

0 comments on commit 4e3fb6a

Please sign in to comment.