@SeeAlso(value=SelectHiveQL.class) @InputRequirement(value=INPUT_REQUIRED) @Tags(value={"sql","hive","put","database","update","insert"}) @CapabilityDescription(value="Executes a HiveQL DDL/DML command (UPDATE, INSERT, e.g.). The content of an incoming FlowFile is expected to be the HiveQL command to execute. The HiveQL command may use the ? to escape parameters. In this case, the parameters to use must exist as FlowFile attributes with the naming convention hiveql.args.N.type and hiveql.args.N.value, where N is a positive integer. The hiveql.args.N.type is expected to be a number indicating the JDBC Type. The content of the FlowFile is expected to be in UTF-8 format.") @ReadsAttribute(attribute="hiveql.args.N.type",description="Incoming FlowFiles are expected to be parametrized HiveQL statements. The type of each Parameter is specified as an integer that represents the JDBC Type of the parameter.") @ReadsAttribute(attribute="hiveql.args.N.value",description="Incoming FlowFiles are expected to be parametrized HiveQL statements. The value of the Parameters are specified as hiveql.args.1.value, hiveql.args.2.value, hiveql.args.3.value, and so on. The type of the hiveql.args.1.value Parameter is specified by the hiveql.args.1.type attribute.") @WritesAttribute(attribute="query.input.tables",description="This attribute is written on the flow files routed to the \'success\' relationships, and contains input table names (if any) in comma delimited \'databaseName.tableName\' format.") @WritesAttribute(attribute="query.output.tables",description="This attribute is written on the flow files routed to the \'success\' relationships, and contains the target table names in \'databaseName.tableName\' format.") @DeprecationNotice(classNames="org.apache.nifi.processors.hive.PutHive3QL") public class PutHiveQL extends AbstractHiveQLProcessor
| Modifier and Type | Class and Description |
|---|---|
private class |
PutHiveQL.FunctionContext |
AbstractHiveQLProcessor.TableName| Modifier and Type | Field and Description |
|---|---|
static PropertyDescriptor |
BATCH_SIZE |
private ExceptionHandler<PutHiveQL.FunctionContext> |
exceptionHandler |
private PartialFunctions.FetchFlowFiles<PutHiveQL.FunctionContext> |
fetchFlowFiles |
private PartialFunctions.InitConnection<PutHiveQL.FunctionContext,Connection> |
initConnection |
private Put<PutHiveQL.FunctionContext,Connection> |
process |
private static List<PropertyDescriptor> |
propertyDescriptors |
private Put.PutFlowFile<PutHiveQL.FunctionContext,Connection> |
putFlowFile |
static Relationship |
REL_FAILURE |
static Relationship |
REL_RETRY |
static Relationship |
REL_SUCCESS |
private static Set<Relationship> |
relationships |
static PropertyDescriptor |
STATEMENT_DELIMITER |
ATTR_INPUT_TABLES, ATTR_OUTPUT_TABLES, CHARSET, HIVE_DBCP_SERVICE, HIVEQL_TYPE_ATTRIBUTE_PATTERN, NUMBER_PATTERN| Constructor and Description |
|---|
PutHiveQL() |
| Modifier and Type | Method and Description |
|---|---|
void |
constructProcess() |
Set<Relationship> |
getRelationships() |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
private ExceptionHandler.OnError<PutHiveQL.FunctionContext,FlowFile> |
onFlowFileError(ProcessContext context,
ProcessSession session,
RoutingResult result) |
void |
onTrigger(ProcessContext context,
ProcessSessionFactory sessionFactory) |
findTableNames, getHiveQL, setParameter, setParameters, toQueryTableAttributesgetControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTruecustomValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitisStatefulgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatepublic static final PropertyDescriptor BATCH_SIZE
public static final PropertyDescriptor STATEMENT_DELIMITER
public static final Relationship REL_SUCCESS
public static final Relationship REL_RETRY
public static final Relationship REL_FAILURE
private static final List<PropertyDescriptor> propertyDescriptors
private static final Set<Relationship> relationships
private Put<PutHiveQL.FunctionContext,Connection> process
private ExceptionHandler<PutHiveQL.FunctionContext> exceptionHandler
private PartialFunctions.InitConnection<PutHiveQL.FunctionContext,Connection> initConnection
private PartialFunctions.FetchFlowFiles<PutHiveQL.FunctionContext> fetchFlowFiles
private Put.PutFlowFile<PutHiveQL.FunctionContext,Connection> putFlowFile
@OnScheduled public void constructProcess()
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponentpublic Set<Relationship> getRelationships()
getRelationships in interface ProcessorgetRelationships in class AbstractSessionFactoryProcessorprivate ExceptionHandler.OnError<PutHiveQL.FunctionContext,FlowFile> onFlowFileError(ProcessContext context, ProcessSession session, RoutingResult result)
public void onTrigger(ProcessContext context, ProcessSessionFactory sessionFactory) throws ProcessException
ProcessExceptionCopyright © 2023 Apache NiFi Project. All rights reserved.