Search in sources :

Example 6 with TableType

use of com.thinkbiganalytics.util.TableType in project kylo by Teradata.

the class TableRegisterSupport method registerStandardTables.

public boolean registerStandardTables(String source, String tableEntity, ColumnSpec[] feedColumnSpecs, String feedFormatOptions, String targetFormatOptions, ColumnSpec[] partitions, ColumnSpec[] columnSpecs, String tblProperties) {
    boolean result = true;
    registerDatabase(source);
    Set<String> existingTables = fetchExisting(source, tableEntity);
    TableType[] tableTypes = new TableType[] { TableType.FEED, TableType.INVALID, TableType.VALID, TableType.MASTER };
    for (TableType tableType : tableTypes) {
        if (!existingTables.contains(tableType.deriveTablename(tableEntity))) {
            result = registerTable(source, tableEntity, feedColumnSpecs, feedFormatOptions, targetFormatOptions, partitions, columnSpecs, tblProperties, tableType, false) && result;
        }
    }
    if (!existingTables.contains(TableType.PROFILE.deriveTablename(tableEntity))) {
        result = registerProfileTable(source, tableEntity, targetFormatOptions) && result;
    }
    return result;
}
Also used : TableType(com.thinkbiganalytics.util.TableType)

Aggregations

TableType (com.thinkbiganalytics.util.TableType)6 ColumnSpec (com.thinkbiganalytics.util.ColumnSpec)4 Test (org.junit.Test)3 ThriftService (com.thinkbiganalytics.nifi.v2.thrift.ThriftService)2 TableRegisterConfiguration (com.thinkbiganalytics.util.TableRegisterConfiguration)2 FlowFile (org.apache.nifi.flowfile.FlowFile)2 ProcessException (org.apache.nifi.processor.exception.ProcessException)2 TableRegisterSupport (com.thinkbiganalytics.ingest.TableRegisterSupport)1 FEED_CATEGORY (com.thinkbiganalytics.nifi.v2.ingest.IngestProperties.FEED_CATEGORY)1 FEED_NAME (com.thinkbiganalytics.nifi.v2.ingest.IngestProperties.FEED_NAME)1 FIELD_SPECIFICATION (com.thinkbiganalytics.nifi.v2.ingest.IngestProperties.FIELD_SPECIFICATION)1 ExecuteHQLStatement (com.thinkbiganalytics.nifi.v2.thrift.ExecuteHQLStatement)1 Path (java.nio.file.Path)1 Paths (java.nio.file.Paths)1 Connection (java.sql.Connection)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Collections (java.util.Collections)1 HashSet (java.util.HashSet)1 List (java.util.List)1