@EventDriven @InputRequirement(value=INPUT_ALLOWED) @Tags(value={"sql","select","jdbc","query","database"}) @CapabilityDescription(value="Execute provided SQL select query. Query result will be converted to Avro format. Streaming is used so arbitrarily large result sets are supported. This processor can be scheduled to run on a timer, or cron expression, using the standard scheduling methods, or it can be triggered by an incoming FlowFile. If it is triggered by an incoming FlowFile, then attributes of that FlowFile will be available when evaluating the select query. FlowFile attribute \'executesql.row.count\' indicates how many rows were selected.") @WritesAttribute(attribute="executesql.row.count", description="Contains the number of rows returned in the select query") public class ExecuteSQL extends AbstractProcessor
Modifier and Type | Field and Description |
---|---|
static PropertyDescriptor |
DBCP_SERVICE |
static PropertyDescriptor |
NORMALIZE_NAMES_FOR_AVRO |
private List<PropertyDescriptor> |
propDescriptors |
static PropertyDescriptor |
QUERY_TIMEOUT |
static Relationship |
REL_FAILURE |
static Relationship |
REL_SUCCESS |
private Set<Relationship> |
relationships |
static String |
RESULT_ROW_COUNT |
static PropertyDescriptor |
SQL_SELECT_QUERY |
Constructor and Description |
---|
ExecuteSQL() |
Modifier and Type | Method and Description |
---|---|
Set<Relationship> |
getRelationships() |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
void |
setup(ProcessContext context) |
onTrigger
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
public static final String RESULT_ROW_COUNT
public static final Relationship REL_SUCCESS
public static final Relationship REL_FAILURE
private final Set<Relationship> relationships
public static final PropertyDescriptor DBCP_SERVICE
public static final PropertyDescriptor SQL_SELECT_QUERY
public static final PropertyDescriptor QUERY_TIMEOUT
public static final PropertyDescriptor NORMALIZE_NAMES_FOR_AVRO
private final List<PropertyDescriptor> propDescriptors
public Set<Relationship> getRelationships()
getRelationships
in interface Processor
getRelationships
in class AbstractSessionFactoryProcessor
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors
in class AbstractConfigurableComponent
@OnScheduled public void setup(ProcessContext context)
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger
in class AbstractProcessor
ProcessException
Copyright © 2017 Apache NiFi Project. All rights reserved.