@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 allows for inferring a schema based on the first line of the CSV, if a \'header line\' is present, or providing an explicit schema for interpreting 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 |
private ConfigurationContext |
context |
static PropertyDescriptor |
CSV_PARSER |
private org.apache.commons.csv.CSVFormat |
csvFormat |
private String |
csvParser |
private String |
dateFormat |
private boolean |
firstLineIsHeader |
private static AllowableValue |
HEADER_DERIVED |
private boolean |
ignoreHeader |
static AllowableValue |
JACKSON_CSV |
private String |
timeFormat |
private String |
timestampFormat |
static PropertyDescriptor |
TRIM_DOUBLE_QUOTE |
schemaAccessStrategy
Constructor and Description |
---|
CSVReader() |
Modifier and Type | Method and Description |
---|---|
RecordReader |
createRecordReader(Map<String,String> variables,
InputStream in,
long inputLength,
ComponentLog logger) |
protected AllowableValue |
getDefaultSchemaAccessStrategy() |
protected SchemaAccessStrategy |
getSchemaAccessStrategy(String allowableValue,
SchemaRegistry schemaRegistry,
PropertyContext context) |
protected List<AllowableValue> |
getSchemaAccessStrategyValues() |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
void |
storeStaticProperties(ConfigurationContext context) |
buildStrategyProperty, customValidate, getConfigurationContext, getSchema, getSchema, getSchemaAccessStrategy, getSchemaAcessStrategyDescriptor, getSuppliedSchemaFields, storeSchemaAccessStrategy
abstractClearConfigContext, abstractStoreConfigContext, disabled, enabled, getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, getProperty, getStateManager, init, initialize, isEnabled
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, toString, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
createRecordReader
initialize, isStateful
getIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
private static final AllowableValue HEADER_DERIVED
public static final AllowableValue APACHE_COMMONS_CSV
public static final AllowableValue JACKSON_CSV
public static final PropertyDescriptor CSV_PARSER
public static final PropertyDescriptor TRIM_DOUBLE_QUOTE
private volatile ConfigurationContext context
private volatile String csvParser
private volatile String dateFormat
private volatile String timeFormat
private volatile String timestampFormat
private volatile boolean firstLineIsHeader
private volatile boolean ignoreHeader
private volatile String charSet
private volatile org.apache.commons.csv.CSVFormat csvFormat
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors
in class SchemaRegistryService
@OnEnabled public void storeStaticProperties(ConfigurationContext context)
public RecordReader createRecordReader(Map<String,String> variables, InputStream in, long inputLength, ComponentLog logger) throws IOException, SchemaNotFoundException
createRecordReader
in interface RecordReaderFactory
IOException
SchemaNotFoundException
protected SchemaAccessStrategy getSchemaAccessStrategy(String allowableValue, SchemaRegistry schemaRegistry, PropertyContext context)
getSchemaAccessStrategy
in class SchemaRegistryService
protected List<AllowableValue> getSchemaAccessStrategyValues()
getSchemaAccessStrategyValues
in class SchemaRegistryService
protected AllowableValue getDefaultSchemaAccessStrategy()
getDefaultSchemaAccessStrategy
in class SchemaRegistryService
Copyright © 2023 Apache NiFi Project. All rights reserved.