@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 |
---|---|
private org.apache.commons.csv.CSVFormat |
csvFormat |
private String |
dateFormat |
private AllowableValue |
headerDerivedAllowableValue |
private String |
timeFormat |
private String |
timestampFormat |
Constructor and Description |
---|
CSVReader() |
Modifier and Type | Method and Description |
---|---|
RecordReader |
createRecordReader(FlowFile flowFile,
InputStream in,
ComponentLog logger) |
protected AllowableValue |
getDefaultSchemaAccessStrategy() |
protected SchemaAccessStrategy |
getSchemaAccessStrategy(String allowableValue,
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, getSchemaAccessStrategy, getSuppliedSchemaFields, storeSchemaAccessStrategy
getControllerServiceLookup, getIdentifier, getLogger, getStateManager, init, initialize
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, toString, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
initialize
getIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
private final AllowableValue headerDerivedAllowableValue
private volatile org.apache.commons.csv.CSVFormat csvFormat
private volatile String dateFormat
private volatile String timeFormat
private volatile String timestampFormat
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors
in class SchemaRegistryService
@OnEnabled public void storeCsvFormat(ConfigurationContext context)
public RecordReader createRecordReader(FlowFile flowFile, InputStream in, ComponentLog logger) throws IOException, SchemaNotFoundException
createRecordReader
in interface RecordReaderFactory
IOException
SchemaNotFoundException
protected SchemaAccessStrategy getSchemaAccessStrategy(String allowableValue, 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 © 2017 Apache NiFi Project. All rights reserved.