Converts the selected columns content to a JSON value row-wise or column-wise. It also has an option to "undo" - with some limitations - the JSON to Table transformation, and can create JSON values for each row based on the column names.
Example input table:
a.b
a.c
d
b0
c0
d0
b1
c1
d1
With the different parameters, the following JSON values are generated: Row-oriented (datatable as one JSON value):
Configure how row keys should be handled in the JSON output.
Omit row key: The row keys will be omitted, not used in the generated JSON value (which are arrays when the rows are not kept).
Row key as JSON value with key: The row keys will be included in the generated JSON (array) value with the specified key.
Row key as JSON key: The row keys are added to the generated JSON value as a key, in this case not an array, but an object is created.
Row key name
The key name to use when row keys are included as JSON values.
Column names as paths
When enabled, column names are treated as hierarchical paths using the specified separator.
Path separator
When column names as paths is enabled, this value will be used to find the keys for JSON columns based on the column names.
Aggregation direction
Configure how to aggregate the selected columns into JSON.
Row-oriented (n input rows → 1 output cell): The values from the selected columns are collected and concatenated row-wise to a JSON object/array, after that these are combined by the rows to a single JSON value.
Keep rows (n input rows → n output cells): The selected columns are combined to a new JSON column containing the values from the columns and the name of the columns as keys. This option does not combine the rows of the input table.
Column-oriented (n input rows → 1 output cell): The values from the selected columns are collected and concatenated column-wise to a JSON object/array, after that these are combined by the columns to a single JSON value.
Remove source columns
When checked, the source columns are removed when the rows are kept. It has no effect for the other aggregation direction options, when all columns are removed.
Missing values
Configure how missing values should be handled in the JSON output.
are omitted: Missing values from the input table do not generate a key in the resulting JSON structure, they are omitted completely. Note that in a column-oriented transformation missing cells will still be inserted as null values in the column's array because otherwise the row arrays for different columns may have different numbers of entries. This would make it impossible to reconstruct the original table.
are inserted as 'null': Missing values from the input table are inserted as null values.
Do you have feedback, questions, comments about NodePit, want to support this platform, or want your own nodes or workflows listed here as well?
Do you think, the search results could be improved or something is missing?
Then please get in touch! Alternatively, you can send us an email to mail@nodepit.com.
Please note that this is only about NodePit. We do not provide general support for KNIME — please use the KNIME forums instead.