![JAR search and dependency download from the Maven repository](/logo.png)
org.apache.apex.malhar.hive.HiveOutputModule Maven / Gradle / Ivy
The newest version!
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.apex.malhar.hive;
import java.util.ArrayList;
import java.util.Arrays;
import javax.annotation.Nonnull;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.beanutils.converters.AbstractConverter;
import org.apache.commons.beanutils.converters.ArrayConverter;
import org.apache.hadoop.conf.Configuration;
import com.datatorrent.api.DAG;
import com.datatorrent.api.Module;
import com.datatorrent.contrib.hive.FSPojoToHiveOperator;
import com.datatorrent.contrib.hive.FSPojoToHiveOperator.FIELD_TYPE;
import com.datatorrent.contrib.hive.HiveOperator;
import com.datatorrent.contrib.hive.HiveStore;
/**
* HiveOutputModule provides abstraction for the operators needed for writing
* tuples to hive. This module will be expanded to FSPojoToHiveOperator and
* HiveOperator in physical plan.
*
* @since 3.5.0
*/
@org.apache.hadoop.classification.InterfaceStability.Evolving
public class HiveOutputModule implements Module
{
/**
* The path of the directory to where files are written.
*/
@NotNull
private String filePath;
/**
* Names of the columns in hive table (excluding partitioning columns).
*/
private String[] hiveColumns;
/**
* Data types of the columns in hive table (excluding partitioning columns).
* This sequence should match to the fields in hiveColumnDataTypes
*/
private FIELD_TYPE[] hiveColumnDataTypes;
/**
* Expressions for the hive columns (excluding partitioning columns). This
* sequence should match to the fields in hiveColumnDataTypes
*/
private String[] expressionsForHiveColumns;
/**
* Names of the columns on which hive data should be partitioned
*/
private String[] hivePartitionColumns;
/**
* Data types of the columns on which hive data should be partitioned. This
* sequence should match to the fields in hivePartitionColumns
*/
private FIELD_TYPE[] hivePartitionColumnDataTypes;
/**
* Expressions for the hive partition columns. This sequence should match to
* the fields in hivePartitionColumns
*/
private String[] expressionsForHivePartitionColumns;
/**
* The maximum length in bytes of a rolling file. Default value is 128MB.
*/
@Min(1)
protected Long maxLength = 134217728L;
/**
* Connection URL for connecting to hive.
*/
@NotNull
private String databaseUrl;
/**
* Driver for connecting to hive.
*/
@NotNull
private String databaseDriver;
/**
* Username for connecting to hive
*/
private String userName;
/**
* Password for connecting to hive
*/
private String password;
/**
* Table name for writing data into hive
*/
@Nonnull
protected String tablename;
/**
* Input port for files metadata.
*/
public final transient ProxyInputPort
© 2015 - 2025 Weber Informatics LLC | Privacy Policy