use of io.cdap.cdap.etl.api.engine.sql.request.SQLJoinRequest in project cdap by caskdata.
the class BatchSQLEngineAdapter method join.
/**
* Executes a Join operation in the SQL engine
*
* @param datasetName the dataset name to use to store the result of the join operation
* @param joinDefinition the Join Definition
* @return Job representing this join operation
*/
@SuppressWarnings("unchecked,raw")
public SQLEngineJob<SQLDataset> join(String datasetName, JoinDefinition joinDefinition) {
return runJob(datasetName, SQLEngineJobType.EXECUTE, () -> {
Collection<SQLDataset> inputDatasets = getJoinInputDatasets(joinDefinition);
SQLJoinRequest joinRequest = new SQLJoinRequest(datasetName, joinDefinition, inputDatasets);
if (!sqlEngine.canJoin(joinRequest)) {
throw new IllegalArgumentException("Unable to execute this join in the SQL engine");
}
return joinInternal(joinRequest);
});
}
Aggregations