-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b57e22c
commit f51b26d
Showing
3 changed files
with
228 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Data Transformers | ||
|
||
A data transformer allows a user can perform common data transformations on input data. | ||
Examples of such data transformations are selecting a sub-selection of a data object or concatenating strings. | ||
This document tracks the design of the data transformers for Fission Workflow. | ||
|
||
## Use Cases | ||
- Reference data from other tasks. For example: `$.tasks.foo.output` | ||
- Create subselections of data. For example: `$.tasks.foo.output.user.id` | ||
- Transform data. For example: `concat($.tasks.foo.output.user.firstName, ' ', $.tasks.foo.output.lastName)` | ||
|
||
## Data Types | ||
- string | ||
- bool | ||
- object | ||
- array | ||
- int | ||
|
||
### Special types | ||
- `expr`: referencing and manipulating data. | ||
- `raw`: default type, or fallback in case no other type could be assigned. Does not support selectors or most functions. | ||
|
||
## Design | ||
- There needs to be some symbol to differentiate functions from literals (or reverse token for literals) | ||
- The language and type determine which functions are available to invoke. For now that is solely JSON. | ||
- The TypedValue is similar to how Any works in Protobuf 3. | ||
- Selectors and transformers are implemented using Otto's Javascript engine. | ||
|
||
## Implementation | ||
- TypedValue, Type consists out of `<language/format>/<type>`. E.g. a JSON string is represented as `json/string`. | ||
It is allowed to just specify the language, allowing a parser to determine the actual type. | ||
|
||
### Functionality | ||
- [x] Transform Go primitive data types (interface{}) <-> TypedValue. | ||
- [x] Fission Proxy: Transform Go primitive data types (interface{}) <-> HTTP request. | ||
- [x] Add data transformation interface | ||
- [x] Parse and resolve expressions | ||
- [x] Add selector-based support | ||
- [ ] Add utility functions to the expression-parser. Status: | ||
- [ ] Allow data transformers to be run as regular tasks |
Oops, something went wrong.