Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "third_party/substrait"]
path = third_party/substrait
url = https://github.com/substrait-io/substrait
[submodule "third_party/substrait-cpp"]
path = third_party/substrait-cpp
url = https://github.com/substrait-io/substrait-cpp
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,13 @@ relations {
```

## Load a Substrait Plan from JSON
A substrait plan can be loaded from its JSON representation
using the ``substrait.json.load_json`` and ``substrait.json.parse_json``
A substrait plan can be loaded [from the JSON representation
of the protobuf message](https://protobuf.dev/programming-guides/json/) using the [`protobuf` python library](https://pypi.org/project/protobuf/):
functions:

```
>>> import substrait.json
>>> from substrait.proto import Plan
>>> from google.protobuf import json_format
>>> jsontext = """{
... "relations":[
... {
Expand Down Expand Up @@ -182,7 +183,7 @@ functions:
... }
... ]
... }"""
>>> substrait.json.parse_json(jsontext)
>>> json_format.Parse(text=jsontext, mesage=Plan())
relations {
root {
input {
Expand Down
25 changes: 0 additions & 25 deletions src/substrait/json.py

This file was deleted.

4 changes: 2 additions & 2 deletions tests/sql/test_sql_to_substrait.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from substrait.sql.sql_to_substrait import convert
import pyarrow
import substrait.json
from google.protobuf import json_format
import tempfile
import pyarrow.substrait as pa_substrait
import pytest
Expand Down Expand Up @@ -91,7 +91,7 @@ def duckdb_schema_resolver(name: str):
conn.install_extension("substrait", repository="community")
conn.load_extension("substrait")

plan_json = substrait.json.dump_json(plan)
plan_json = json_format.MessageToJson(plan)
sql = f"CALL from_substrait_json('{plan_json}')"

substrait_out = conn.sql(sql)
Expand Down
71 changes: 0 additions & 71 deletions tests/test_json.py

This file was deleted.

1 change: 0 additions & 1 deletion third_party/substrait-cpp
Submodule substrait-cpp deleted from e26585
5 changes: 0 additions & 5 deletions update_cpp.sh

This file was deleted.

Loading