DB Table Partitioner

This node split rows from a DB Data table. The dialog enables you to specify the number of rows to split and the splitting strategy.

The created partitions might overlap depending on the database and the selected sampling option. KNIME is not storing the data of the first partition in any way but is executing the query that represents the first partition also as part of the query to retrieve the second partition. If the query that defines the first partition returns a different result for each execution the two partitions might overlap. This is most likely the case for random sampling without a fixed seed.

Options

First partition type
Defines how the size of the first partition is specified: as a percentage of total rows (relative) or as an absolute number of rows.
Relative size
Specifies the percentage of rows from the input table to be included in the first partition. Must be between 0 and 100 (inclusive).
Number of rows
Specifies the absolute number of rows to include in the first partition. If the input table contains fewer rows than specified, all rows are placed in the first table, and the second table will be empty.
Sampling strategy
Determines how rows are selected for the first partition. Strategies include random, stratified, and first rows (sequential).
  • Random: Randomly selects rows from the input table if the connected database supports random sampling. Note that this method might be very slow for large database tables.
  • Stratified: Preserves the distribution of values in the selected group column.
  • First rows: Allows you to select the top-most rows of the input table. Note that the order of the rows depends on the connected database.
Group column
Specifies the column whose value distribution should be preserved in stratified sampling. Ensures both output tables reflect the same distribution of values.
Fixed random seed
Optional seed value for random or stratified sampling. Using a seed ensures the same rows are selected each time the node is executed. Without a seed, a different random selection will occur each time.

Input Ports

Icon
DB Data to apply database sampling.

Output Ports

Icon
First DB Data partition with sampled rows.
Icon
Second DB Data partition with sampled rows.

Views

This node has no views

Workflows

  • No workflows found

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.