Package org.apache.nifi.csv
Class CSVReader
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.controller.AbstractControllerService
org.apache.nifi.serialization.SchemaRegistryService
org.apache.nifi.csv.CSVReader
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent
,org.apache.nifi.controller.ControllerService
,RecordReaderFactory
@Tags({"csv","parse","record","row","reader","delimited","comma","separated","values"})
@CapabilityDescription("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
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.nifi.components.AllowableValue
private String
private org.apache.nifi.controller.ConfigurationContext
static final org.apache.nifi.components.PropertyDescriptor
private org.apache.commons.csv.CSVFormat
private String
private String
static final org.apache.nifi.components.AllowableValue
private boolean
private static final org.apache.nifi.components.AllowableValue
private boolean
static final org.apache.nifi.components.AllowableValue
private String
private String
static final org.apache.nifi.components.PropertyDescriptor
Fields inherited from class org.apache.nifi.serialization.SchemaRegistryService
schemaAccessStrategy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateRecordReader
(Map<String, String> variables, InputStream in, long inputLength, org.apache.nifi.logging.ComponentLog logger) protected org.apache.nifi.components.AllowableValue
protected SchemaAccessStrategy
getSchemaAccessStrategy
(String allowableValue, SchemaRegistry schemaRegistry, org.apache.nifi.context.PropertyContext context) protected List
<org.apache.nifi.components.AllowableValue> protected List
<org.apache.nifi.components.PropertyDescriptor> void
storeStaticProperties
(org.apache.nifi.controller.ConfigurationContext context) Methods inherited from class org.apache.nifi.serialization.SchemaRegistryService
buildStrategyProperty, customValidate, getConfigurationContext, getSchema, getSchema, getSchemaAccessStrategy, getSchemaAccessStrategyDescriptor, getSuppliedSchemaFields, migrateProperties, storeSchemaAccessStrategy
Methods inherited from class org.apache.nifi.controller.AbstractControllerService
abstractClearConfigContext, abstractStoreConfigContext, disabled, enabled, getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, getProperty, getStateManager, init, initialize, isEnabled
Methods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, toString, validate
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.nifi.components.ConfigurableComponent
getIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
Methods inherited from interface org.apache.nifi.controller.ControllerService
initialize, isStateful, migrateProperties
Methods inherited from interface org.apache.nifi.serialization.RecordReaderFactory
createRecordReader
-
Field Details
-
HEADER_DERIVED
private static final org.apache.nifi.components.AllowableValue HEADER_DERIVED -
APACHE_COMMONS_CSV
public static final org.apache.nifi.components.AllowableValue APACHE_COMMONS_CSV -
JACKSON_CSV
public static final org.apache.nifi.components.AllowableValue JACKSON_CSV -
FAST_CSV
public static final org.apache.nifi.components.AllowableValue FAST_CSV -
CSV_PARSER
public static final org.apache.nifi.components.PropertyDescriptor CSV_PARSER -
TRIM_DOUBLE_QUOTE
public static final org.apache.nifi.components.PropertyDescriptor TRIM_DOUBLE_QUOTE -
context
private volatile org.apache.nifi.controller.ConfigurationContext context -
csvParser
-
dateFormat
-
timeFormat
-
timestampFormat
-
firstLineIsHeader
private volatile boolean firstLineIsHeader -
ignoreHeader
private volatile boolean ignoreHeader -
charSet
-
csvFormat
private volatile org.apache.commons.csv.CSVFormat csvFormat
-
-
Constructor Details
-
CSVReader
public CSVReader()
-
-
Method Details
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptors
in classSchemaRegistryService
-
storeStaticProperties
@OnEnabled public void storeStaticProperties(org.apache.nifi.controller.ConfigurationContext context) -
createRecordReader
public RecordReader createRecordReader(Map<String, String> variables, InputStream in, long inputLength, org.apache.nifi.logging.ComponentLog logger) throws IOException, SchemaNotFoundException- Specified by:
createRecordReader
in interfaceRecordReaderFactory
- Throws:
IOException
SchemaNotFoundException
-
getSchemaAccessStrategy
protected SchemaAccessStrategy getSchemaAccessStrategy(String allowableValue, SchemaRegistry schemaRegistry, org.apache.nifi.context.PropertyContext context) - Overrides:
getSchemaAccessStrategy
in classSchemaRegistryService
-
getSchemaAccessStrategyValues
- Overrides:
getSchemaAccessStrategyValues
in classSchemaRegistryService
-
getDefaultSchemaAccessStrategy
protected org.apache.nifi.components.AllowableValue getDefaultSchemaAccessStrategy()- Overrides:
getDefaultSchemaAccessStrategy
in classSchemaRegistryService
-