-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add placeholder for
relational.lookup
block (#364)
* add placeholder for relational.lookup block * update json schemas * update autogenerated docs --------- Co-authored-by: github-actions <[email protected]>
- Loading branch information
Showing
4 changed files
with
968 additions
and
743 deletions.
There are no files selected for viewing
Empty file.
71 changes: 71 additions & 0 deletions
71
core/src/datayoga_core/blocks/relational/lookup/block.schema.json
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,71 @@ | ||
{ | ||
"title": "relational.write", | ||
"description": "Lookup in a relational table", | ||
"type": "object", | ||
"additionalProperties": false, | ||
"examples": [ | ||
{ | ||
"id": "load_snowflake", | ||
"type": "relational.write", | ||
"properties": { | ||
"connection": "eu_datalake", | ||
"table": "employees", | ||
"schema": "dbo", | ||
"load_strategy": "APPEND" | ||
} | ||
} | ||
], | ||
"properties": { | ||
"condition": { | ||
"type": "string", | ||
"title": "The lookup condition", | ||
"description": "Use any valid SQL syntax. Use the alias `lookup` for the lookup table and `incoming` for the base table", | ||
"examples": ["lookup.account_number = incoming.i_acct_no"] | ||
}, | ||
"query": { | ||
"type": "string", | ||
"title": "Query string to use as an override to the built in query", | ||
"description": "Use any valid SQL syntax. Use the alias `lookup` for the lookup table and `incoming` for the base table", | ||
"examples": [ | ||
"select country_code,country_name from countries where is_active=1" | ||
] | ||
}, | ||
"schema": { | ||
"type": "string", | ||
"title": "The table schema of the lookup table", | ||
"description": "If not specified, no specific schema will be used when connecting to the database.", | ||
"examples": ["dbo"] | ||
}, | ||
"table": { | ||
"type": "string", | ||
"title": "The lookup table name", | ||
"description": "Lookup table name", | ||
"examples": ["countries"] | ||
}, | ||
"order_by": { | ||
"type": "array", | ||
"title": "List of keys to use for ordering. Applicable for multiple matches", | ||
"items": { | ||
"type": ["string"], | ||
"title": "name of column" | ||
}, | ||
"examples": [["country_name"]] | ||
}, | ||
"fields": { | ||
"type": "array", | ||
"title": "Columns to add to the output from the lookup table", | ||
"items": { | ||
"type": ["string", "object"], | ||
"title": "name of column" | ||
}, | ||
"examples": [["fname", { "lname": "last_name" }, "address", "gender"]] | ||
}, | ||
"multiple_match_policy": { | ||
"type": "string", | ||
"enum": ["first", "last", "all"], | ||
"description": "How to handle multiple matches in the lookup table", | ||
"default": "" | ||
} | ||
}, | ||
"required": [] | ||
} |
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,67 @@ | ||
--- | ||
parent: Blocks | ||
grand_parent: Reference | ||
--- | ||
|
||
# relational\.write | ||
|
||
Lookup in a relational table | ||
|
||
|
||
**Properties** | ||
|
||
|Name|Type|Description|Required| | ||
|----|----|-----------|--------| | ||
|**condition**<br/>(The lookup condition)|`string`|Use any valid SQL syntax. Use the alias `lookup` for the lookup table and `incoming` for the base table<br/>|no| | ||
|**query**<br/>(Query string to use as an override to the built in query)|`string`|Use any valid SQL syntax. Use the alias `lookup` for the lookup table and `incoming` for the base table<br/>|no| | ||
|**schema**<br/>(The table schema of the lookup table)|`string`|If not specified, no specific schema will be used when connecting to the database.<br/>|no| | ||
|**table**<br/>(The lookup table name)|`string`|Lookup table name<br/>|no| | ||
|[**order\_by**](#order_by)<br/>(List of keys to use for ordering\. Applicable for multiple matches)|`array`||no| | ||
|[**fields**](#fields)<br/>(Columns to add to the output from the lookup table)|`array`||no| | ||
|**multiple\_match\_policy**|`string`|How to handle multiple matches in the lookup table<br/>Default: `""`<br/>Enum: `"first"`, `"last"`, `"all"`<br/>|no| | ||
|
||
**Additional Properties:** not allowed | ||
**Example** | ||
|
||
```yaml | ||
id: load_snowflake | ||
type: relational.write | ||
properties: | ||
connection: eu_datalake | ||
table: employees | ||
schema: dbo | ||
load_strategy: APPEND | ||
|
||
``` | ||
|
||
<a name="order_by"></a> | ||
## order\_by\[\]: List of keys to use for ordering\. Applicable for multiple matches | ||
|
||
**Items: name of column** | ||
|
||
**Item Type:** `string` | ||
**Example** | ||
|
||
```yaml | ||
- country_name | ||
|
||
``` | ||
<a name="fields"></a> | ||
## fields\[\]: Columns to add to the output from the lookup table | ||
**Items: name of column** | ||
**No properties.** | ||
**Example** | ||
```yaml | ||
- fname | ||
- lname: last_name | ||
- address | ||
- gender | ||
|
||
``` | ||
Oops, something went wrong.