https://github.com/substrait-io/substrait-js
https://github.com/substrait-io/substrait-js
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/substrait-io/substrait-js
- Owner: substrait-io
- License: apache-2.0
- Created: 2023-04-04T15:45:44.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-07T23:14:03.000Z (over 1 year ago)
- Last Synced: 2023-12-08T00:24:28.170Z (over 1 year ago)
- Language: TypeScript
- Size: 596 KB
- Stars: 2
- Watchers: 10
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# susbtrait-js
Typescript typings for Substrait specifications. Also provides a parser for translating substrait plans and a CLI tool to visualize substrait plans.Substrait is cross-language specification for data compute operations, composed primarily of:
1. a formal specification
2. a human readable text representation
3. a compact cross-language binary representationFor more details, please visit [substrait.io](https://substrait.io/)
Link to the substrait specifications repository: [github.com/substrait-io/substrait](https://github.com/substrait-io/substrait)## Development setup
Clone the github repository
```
git clone https://github.com/substrait-io/substrait-js.git
cd substrait-js/
git submodule update --init --recursive
```Installation includes the following steps:
1. Transpiling the `.ts` files
2. Downloading the substrait specification
3. Packaging the specifications to static `.js` module.```
npm ci
npm run build
```## Visualization
substrait-JS provides a CLI tool for exporting graph visualization of substrait JSON and binary plans. The tool currently uses the `--experimental-specifier-resolution` flag for module resolution. The visualization functions are the required helper methods for the [substrait-fiddle](https://github.com/voltrondata/substrait-fiddle) tool.The tool uses [viz-js](https://github.com/mdaines/viz-js) for rendering plots on JSDOM using [Graphviz](https://graphviz.org/)'s DOT language.
Plot generation includes the following steps:
```
// The tool currently requires NodeJS version 18.0.0 for operation
source ~/.nvm/nvm.sh
nvm use 18.0.0substrait -p ../plan.json -o
```## Testing
Jest is used for testing the visualization functionality of the library. To run the test, we need
to use `nvm v18.0.0`
```
source ~/.nvm/nvm.sh
nvm use 18.0.0npm run test
```
## License
[Apache-2.0 license](https://www.apache.org/licenses/LICENSE-2.0)