@EventDriven @InputRequirement(value=INPUT_ALLOWED) @Tags(value={"hive","sql","select","jdbc","query","database"}) @CapabilityDescription(value="Execute provided HiveQL SELECT query against a Hive database connection. Query result will be converted to Avro or CSV 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 \'selecthiveql.row.count\' indicates how many rows were selected.") @WritesAttribute(attribute="mime.type",description="Sets the MIME type for the outgoing flowfile to application/avro-binary for Avro or text/csv for CSV.") @WritesAttribute(attribute="filename",description="Adds .avro or .csv to the filename attribute depending on which output format is selected.") @WritesAttribute(attribute="selecthiveql.row.count",description="Indicates how many rows were selected/returned by the query.") public class SelectHiveQL extends AbstractHiveQLProcessor
| Modifier and Type | Field and Description |
|---|---|
protected static String |
AVRO |
static String |
AVRO_MIME_TYPE |
protected static String |
CSV |
static String |
CSV_MIME_TYPE |
static PropertyDescriptor |
HIVEQL_OUTPUT_FORMAT |
static PropertyDescriptor |
HIVEQL_SELECT_QUERY |
private static List<PropertyDescriptor> |
propertyDescriptors |
static Relationship |
REL_FAILURE |
static Relationship |
REL_SUCCESS |
private static Set<Relationship> |
relationships |
static String |
RESULT_ROW_COUNT |
HIVE_DBCP_SERVICE| Constructor and Description |
|---|
SelectHiveQL() |
| Modifier and Type | Method and Description |
|---|---|
Set<Relationship> |
getRelationships() |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
onTriggergetControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTruecustomValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatepublic static final String RESULT_ROW_COUNT
protected static final String AVRO
protected static final String CSV
public static final String AVRO_MIME_TYPE
public static final String CSV_MIME_TYPE
public static final Relationship REL_SUCCESS
public static final Relationship REL_FAILURE
public static final PropertyDescriptor HIVEQL_SELECT_QUERY
public static final PropertyDescriptor HIVEQL_OUTPUT_FORMAT
private static final List<PropertyDescriptor> propertyDescriptors
private static final Set<Relationship> relationships
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponentpublic Set<Relationship> getRelationships()
getRelationships in interface ProcessorgetRelationships in class AbstractSessionFactoryProcessorpublic void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger in class AbstractProcessorProcessExceptionCopyright © 2016 Apache NiFi Project. All rights reserved.