You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,20 @@ There's no formal set of dependencies for Substrait, but here are some that are
10
10
*[`protoc`](https://grpc.io/docs/protoc-installation/), used by `buf` and usable independent of `buf`
11
11
* A Python environment with [the website's `requirements.txt`](https://github.com/substrait-io/substrait/blob/main/site/requirements.txt) dependencies installed if you want to see changes to the website locally
12
12
13
+
## Documentation Examples
14
+
15
+
When adding examples to the documentation, please use external example files instead of inline code blocks. This ensures examples are validated against schemas in CI/CD and prevents documentation drift.
16
+
17
+
See [`site/examples/README.md`](site/examples/README.md) for complete instructions on creating and including validated examples.
18
+
19
+
Quick example:
20
+
21
+
```markdown
22
+
```yaml
23
+
--8<-- "examples/extensions/my_example.yaml"
24
+
```
25
+
```
26
+
13
27
## Commit Conventions
14
28
15
29
Substrait follows [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) for commit message structure. You can use [`pre-commit`](https://pre-commit.com/) to check your messages for you, but note that you must install pre-commit using `pre-commit install --hook-type commit-msg` for this to work. CI will also lint your commit messages. Please also ensure that your PR title and initial comment together form a valid commit message; that will save us some work formatting the merge commit message when we merge your PR.
Copy file name to clipboardExpand all lines: site/docs/expressions/user_defined_functions.md
+2-22Lines changed: 2 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,26 +7,6 @@ Here's an example function that doubles its input:
7
7
!!! info inline end "Implementation Note"
8
8
This implementation is only defined on 32-bit floats and integers but could be defined on all numbers (and even lists and strings). The user of the implementation can specify what happens when the resulting value falls outside of the valid range for a 32-bit float (either return NAN or raise an error).
Copy file name to clipboardExpand all lines: site/docs/extensions/index.md
+3-31Lines changed: 3 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,19 +35,7 @@ A YAML file can also reference types and type variations defined in another YAML
35
35
For example, if the extension with extension URN `extension:io.substrait:extension_types` defines a type called `point`, a different YAML file can use the type in a function declaration as follows:
The `any` type indicates that the argument can take any possible type. In the `foo` function above, arguments `a` and `b` can be of any type, even different ones in the same function invocation.
The `any[\d]` types (i.e. `any1`, `any2`, ..., `any9`) impose an additional restriction. Within a single function invocation, all any types with same numeric suffix _must_ be of the same type. In the `bar` function above, arguments `a` and `b` can have any type as long as both types are the same.
The structure field of a type is only intended to inform systems that don't have built-in support for the type about how they can create and transfer values of that type to systems that do support the type.
@@ -116,74 +96,41 @@ Literals for user-defined types can be represented in one of two ways:
116
96
User-defined types may be turned into compound types by requiring parameters to be passed to them. The supported "meta-types" for parameters are data types (like those used in `LIST`, `MAP`, and `STRUCT`), booleans, integers, enumerations, and strings. Using parameters, we could redefine "point" with different types of coordinates. For example:
This specifies a vector that can be either 2- or 3-dimensional. Note however that it's not currently possible to put constraints on data type, string, or (technically) boolean parameters.
167
123
168
124
Similar to function arguments, the last parameter may be specified to be variadic, allowing it to be specified one or more times instead of only once. For example:
169
125
170
126
```yaml
171
-
name: union
172
-
parameters:
173
-
- name: T
174
-
type: dataType
175
-
variadic: true
127
+
--8<-- "examples/types/union_variadic.yaml"
176
128
```
177
129
178
130
This defines a type that can be parameterized with one or more other data types, for example `union<i32, i64>` but also `union<bool>`. Zero or more is also possible, by making the last argument optional:
0 commit comments