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;
}
Aggregations