feat(dataflow): model production SQL flow patterns
This commit is contained in:
@@ -117,6 +117,8 @@ _NODE_TYPES = (
|
||||
("left", "All left rows"),
|
||||
("right", "All right rows"),
|
||||
("full", "All rows"),
|
||||
("semi", "Left rows with a match"),
|
||||
("anti", "Left rows without a match"),
|
||||
),
|
||||
),
|
||||
NodeConfigField(id="left_keys", label="Left keys", kind="column_list", required=True),
|
||||
@@ -289,6 +291,35 @@ _NODE_TYPES = (
|
||||
},
|
||||
sql_support="partial",
|
||||
),
|
||||
NodeTypeDefinition(
|
||||
type="calculate",
|
||||
category="transform",
|
||||
label="Calculate columns",
|
||||
description=(
|
||||
"Create or replace several columns using ordered safe typed "
|
||||
"expressions."
|
||||
),
|
||||
icon="calculator",
|
||||
input_ports=(NodePortDefinition(id="input", label="Input"),),
|
||||
config_fields=(
|
||||
NodeConfigField(
|
||||
id="calculations",
|
||||
label="Calculations",
|
||||
kind="calculations",
|
||||
required=True,
|
||||
),
|
||||
),
|
||||
default_config={
|
||||
"calculations": [
|
||||
{
|
||||
"target_column": "",
|
||||
"expression": "",
|
||||
"result_type": "unknown",
|
||||
}
|
||||
]
|
||||
},
|
||||
sql_support="partial",
|
||||
),
|
||||
NodeTypeDefinition(
|
||||
type="convert",
|
||||
category="transform",
|
||||
@@ -386,6 +417,53 @@ _NODE_TYPES = (
|
||||
config_fields=(NodeConfigField(id="fields", label="Sort fields", kind="sort_fields", required=True),),
|
||||
default_config={"fields": [{"column": "", "direction": "asc"}]},
|
||||
),
|
||||
NodeTypeDefinition(
|
||||
type="window.rank",
|
||||
category="transform",
|
||||
label="Rank rows",
|
||||
description=(
|
||||
"Number or rank rows within optional partitions using a stable "
|
||||
"ordering."
|
||||
),
|
||||
icon="list-ordered",
|
||||
input_ports=(NodePortDefinition(id="input", label="Input"),),
|
||||
config_fields=(
|
||||
NodeConfigField(
|
||||
id="method",
|
||||
label="Method",
|
||||
kind="select",
|
||||
options=(
|
||||
("row_number", "Row number"),
|
||||
("rank", "Rank with gaps"),
|
||||
("dense_rank", "Dense rank"),
|
||||
),
|
||||
),
|
||||
NodeConfigField(
|
||||
id="target_column",
|
||||
label="Output column",
|
||||
kind="text",
|
||||
required=True,
|
||||
),
|
||||
NodeConfigField(
|
||||
id="partition_by",
|
||||
label="Partition by",
|
||||
kind="column_list",
|
||||
),
|
||||
NodeConfigField(
|
||||
id="order_by",
|
||||
label="Order by",
|
||||
kind="sort_fields",
|
||||
required=True,
|
||||
),
|
||||
),
|
||||
default_config={
|
||||
"method": "row_number",
|
||||
"target_column": "row_number",
|
||||
"partition_by": [],
|
||||
"order_by": [{"column": "", "direction": "asc"}],
|
||||
},
|
||||
sql_support="partial",
|
||||
),
|
||||
NodeTypeDefinition(
|
||||
type="limit",
|
||||
category="transform",
|
||||
|
||||
Reference in New Issue
Block a user