This is an automated email from the ASF dual-hosted git repository. timsaucer pushed a commit to branch feat/ffi-query-planner-55 in repository https://gitbox.apache.org/repos/asf/datafusion-ballista.git
commit 44169f1d0859b9f9da136e52ad2397d29df35790 Author: Tim Saucer <[email protected]> AuthorDate: Fri Aug 7 13:29:37 2026 -0400 Update example to use new way to export codecs and query planner to datafusion-python --- python/examples/getting_started.ipynb | 38 ++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/python/examples/getting_started.ipynb b/python/examples/getting_started.ipynb index b2f725cba..b2b938ba5 100644 --- a/python/examples/getting_started.ipynb +++ b/python/examples/getting_started.ipynb @@ -58,7 +58,14 @@ "outputs": [], "source": [ "import ballista\n", - "from ballista import BallistaSessionContext, setup_test_cluster\n", + "from ballista._internal_ballista import ballista_datafusion_config_defaults\n", + "from ballista import (\n", + " BallistaQueryPlanner,\n", + " BallistaLogicalExtensionCodec,\n", + " BallistaPhysicalExtensionCodec,\n", + " setup_test_cluster,\n", + ")\n", + "from datafusion import SessionConfig, SessionContext\n", "%load_ext autoreload\n", "%autoreload 2\n", "\n", @@ -77,10 +84,31 @@ "# ctx = BallistaSessionContext(\"df://your-scheduler:50050\")\n", "\n", "host, port = setup_test_cluster()\n", - "ctx = BallistaSessionContext(f\"df://{host}:{port}\")\n", + "address = f\"df://{host}:{port}\"\n", + "\n", + "ballista_config = ballista_datafusion_config_defaults()\n", + "ctx = SessionContext(SessionConfig(ballista_config))\n", + "logical_codec = BallistaLogicalExtensionCodec(ctx)\n", + "physical_codec = BallistaPhysicalExtensionCodec(ctx, logical_codec)\n", + "\n", + "ctx = (\n", + " ctx.with_logical_extension_codec(logical_codec)\n", + " .with_physical_extension_codec(physical_codec)\n", + " .with_query_planner(BallistaQueryPlanner(address, ctx))\n", + ")\n", "\n", "print(f\"Connected to Ballista at {host}:{port}\")\n", - "print(f\"Session ID: {ctx.session_id}\")" + "print(f\"Session ID: {ctx.session_id()}\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ctx.deregister_table(\"public.test_data_v1\")\n", + "ctx.deregister_table(\"public.test_data_v2\")" ] }, { @@ -94,7 +122,7 @@ "ctx.register_parquet(\"public.test_data_v2\", \"../testdata/test.parquet\")\n", "\n", "# List registered tables\n", - "print(\"Registered schemas and tables:\\n\", ctx.get_tables())" + "print(\"Registered schemas and tables:\\n\", ctx.catalog().schema().table_names())" ] }, { @@ -321,7 +349,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.3" + "version": "3.12.9" } }, "nbformat": 4, --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
