@Tags(value={"csv","parse","record","row","reader","delimited","comma","separated","values"}) @CapabilityDescription(value="Parses CSV-formatted data, returning each row in the CSV file as a separate record. This reader assumes that the first line in the content is the column names and all subsequent lines are the values. See Controller Service\'s Usage for further documentation.") public class CSVReader extends SchemaRegistryService implements RecordReaderFactory
Modifier and Type | Field and Description |
---|---|
static AllowableValue |
APACHE_COMMONS_CSV |
private String |
charSet |
static PropertyDescriptor |
CSV_PARSER |
private org.apache.commons.csv.CSVFormat |
csvFormat |
private String |
csvParser |
private String |
dateFormat |
private boolean |
firstLineIsHeader |
private AllowableValue |
headerDerivedAllowableValue |
private boolean |
ignoreHeader |
static AllowableValue |
JACKSON_CSV |
private String |
timeFormat |
private String |
timestampFormat |
Constructor and Description |
---|
CSVReader() |
Modifier and Type | Method and Description |
---|---|
RecordReader |
createRecordReader(Map<String,String> variables,
InputStream in,
ComponentLog logger) |
protected AllowableValue |
getDefaultSchemaAccessStrategy() |
protected SchemaAccessStrategy |
getSchemaAccessStrategy(String strategy,
SchemaRegistry schemaRegistry,
ConfigurationContext context) |
protected SchemaAccessStrategy |
getSchemaAccessStrategy(String allowableValue,
SchemaRegistry schemaRegistry,
ValidationContext context) |
protected List<AllowableValue> |
getSchemaAccessStrategyValues() |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
void |
storeCsvFormat(ConfigurationContext context) |
customValidate, getConfigurationContext, getSchema, getSchema, getSchemaAccessStrategy, getSchemaAcessStrategyDescriptor, getSuppliedSchemaFields, storeSchemaAccessStrategy
abstractClearConfigContext, abstractStoreConfigContext, disabled, enabled, getControllerServiceLookup, getIdentifier, getLogger, getProperty, getStateManager, init, initialize, isEnabled
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, toString, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
createRecordReader
initialize
getIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
private final AllowableValue headerDerivedAllowableValue
public static final AllowableValue APACHE_COMMONS_CSV
public static final AllowableValue JACKSON_CSV
public static final PropertyDescriptor CSV_PARSER
private volatile String csvParser
private volatile org.apache.commons.csv.CSVFormat csvFormat
private volatile String dateFormat
private volatile String timeFormat
private volatile String timestampFormat
private volatile boolean firstLineIsHeader
private volatile boolean ignoreHeader
private volatile String charSet
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors
in class SchemaRegistryService
@OnEnabled public void storeCsvFormat(ConfigurationContext context)
public RecordReader createRecordReader(Map<String,String> variables, InputStream in, ComponentLog logger) throws IOException, SchemaNotFoundException
createRecordReader
in interface RecordReaderFactory
IOException
SchemaNotFoundException
protected SchemaAccessStrategy getSchemaAccessStrategy(String strategy, SchemaRegistry schemaRegistry, ConfigurationContext context)
getSchemaAccessStrategy
in class SchemaRegistryService
protected SchemaAccessStrategy getSchemaAccessStrategy(String allowableValue, SchemaRegistry schemaRegistry, ValidationContext context)
getSchemaAccessStrategy
in class SchemaRegistryService
protected List<AllowableValue> getSchemaAccessStrategyValues()
getSchemaAccessStrategyValues
in class SchemaRegistryService
protected AllowableValue getDefaultSchemaAccessStrategy()
getDefaultSchemaAccessStrategy
in class SchemaRegistryService
Copyright © 2018 Apache NiFi Project. All rights reserved.