Partition an existing delta stream, stream, window, or module in the Visual
editor.
Prerequisites
(Optional) To use a parameter to specify the number of partitions you wish to create,
create a global parameter first. See
Declaring a Parameter for detailed steps
on creating a parameter.
Task- Click Add Partition Policy
.
- Select a partition policy.
- In the Properties view, specify a value or parameter for the Number of Partitions
to create. To use a parameter, either enter the parameter name or click
Select and select the parameter from the list.
- Select the new partition and edit its properties in the Properties view:
Partition Policy |
Steps |
ROUNDROBIN |
- Select a source for the partition.
|
HASH |
- Select a source for the partition.
- Select the columns to use for the HASH function and click
Add.
|
CUSTOM |
- Select a source for the partition.
- On the Expression tab, edit the partition function. To show
syntax completion proposals, press
Ctrl+Space.
- To ensure that the function returns a valid partition ID, apply
a modulo operation in the return statement and use the implicit
global parameter of the partition as its divisor. For example,
for an output window called maxPriceW, use
maxPriceW_partitions as the divisor:
BY priceW
{
integer hashValue := ascii(substr(priceW.isin,1,1));
return hashValue % maxPriceW_partitions;
}
|