Search in sources :

Example 1 with HiveQueryExecutor

use of com.sap.hadoop.windowing.runtime2.HiveQueryExecutor in project SQLWindowing by hbutani.

the class InputTranslation method translate.

private static HiveQueryDef translate(QueryDef qDef, HiveQuerySpec spec) throws WindowingException {
    HiveQueryDef def = new HiveQueryDef();
    HiveQueryExecutor hiveQryExec = qDef.getTranslationInfo().getHiveQueryExecutor();
    Hive hive = qDef.getTranslationInfo().getHive();
    String tableName = hiveQryExec.createTableAsQuery(spec.getHiveQuery());
    HiveTableSpec tSpec = new HiveTableSpec();
    tSpec.setDbName(hive.getCurrentDatabase());
    tSpec.setTableName(tableName);
    tSpec.setPartition(spec.getPartition());
    tSpec.setOrder(spec.getOrder());
    def = (HiveQueryDef) InputTranslation.translate(qDef, tSpec, (HiveTableDef) def);
    return def;
}
Also used : HiveQueryExecutor(com.sap.hadoop.windowing.runtime2.HiveQueryExecutor) Hive(org.apache.hadoop.hive.ql.metadata.Hive) HiveQueryDef(com.sap.hadoop.windowing.query2.definition.HiveQueryDef) HiveTableSpec(com.sap.hadoop.windowing.query2.specification.HiveTableSpec)

Aggregations

HiveQueryDef (com.sap.hadoop.windowing.query2.definition.HiveQueryDef)1 HiveTableSpec (com.sap.hadoop.windowing.query2.specification.HiveTableSpec)1 HiveQueryExecutor (com.sap.hadoop.windowing.runtime2.HiveQueryExecutor)1 Hive (org.apache.hadoop.hive.ql.metadata.Hive)1