Class CompileColumnsToJSONProcessor
java.lang.Object
com.lumiomedical.etl.dataframe.processor.column.CompileColumnsToJSONProcessor
- All Implemented Interfaces:
TableProcessor
public class CompileColumnsToJSONProcessor extends Object implements TableProcessor
This transformer will turn a series of column into a single JSON object stored in a new column.
This can be helpful when attempting to merge/append dataframes with different column schemas: we can compile extraneous columns into a single one if we need their contents down the line, and only retain columns that are in common.
An optional "dropColumns" argument can be passed in order to require the removal of compiled columns.
- Author:
- Pierre Lecerf ([email protected]) Created on 2020/08/20
-
Constructor Summary
Constructors Constructor Description CompileColumnsToJSONProcessor(String columnName, boolean dropColumns, String... columns)
CompileColumnsToJSONProcessor(String columnName, boolean dropColumns, Collection<String> columns)
CompileColumnsToJSONProcessor(String columnName, String... columns)
CompileColumnsToJSONProcessor(String columnName, Collection<String> columns)
-
Method Summary
Modifier and Type Method Description tech.tablesaw.api.Table
process(tech.tablesaw.api.Table table)
-
Constructor Details
-
CompileColumnsToJSONProcessor
-
CompileColumnsToJSONProcessor
-
CompileColumnsToJSONProcessor
-
CompileColumnsToJSONProcessor
public CompileColumnsToJSONProcessor(String columnName, boolean dropColumns, Collection<String> columns)- Parameters:
columnName
-columns
-dropColumns
-
-
-
Method Details
-
process
public tech.tablesaw.api.Table process(tech.tablesaw.api.Table table) throws TableProcessorException- Specified by:
process
in interfaceTableProcessor
- Returns:
- Throws:
TableProcessorException
-