KEY_OUT
- The type for the Output Key when mapping a StructuredRecordVALUE_OUT
- The type for the Output Value when mapping a StructuredRecordKEY_IN
- The type for the Input Key when building a StructuredRecordVALUE_IN
- The type for the Input Value when building a StructuredRecord@Beta public interface SQLEngine<KEY_IN,VALUE_IN,KEY_OUT,VALUE_OUT> extends PipelineConfigurable, SubmitterLifecycle<RuntimeContext>
SQL Engines are implemented as plugins.
Internally, the SQL Engine needs to handle retries and only surface SQLEngineException
errors when there is a
problem that cannot be recovered from and pipeline must be stopped.
Note that this operation may be refactored at a later release, and thus this method signature is not guaranteed to remain stable.
Modifier and Type | Method and Description |
---|---|
boolean |
canJoin(SQLJoinDefinition joinDefinition)
Check if the supplied Join Definition can be executed in this engine.
|
void |
cleanup(String datasetName)
Deletes all temporary datasets and cleans up all temporary data from the SQL engine.
|
boolean |
exists(String datasetName)
Check if this dataset exists in the SQL Engine.
|
SQLPullDataset<io.cdap.cdap.api.data.format.StructuredRecord,KEY_IN,VALUE_IN> |
getPullProvider(SQLPullRequest pullRequest)
Creates an InputFormatProvider that can be used to pull records from the specified dataset.
|
SQLPushDataset<io.cdap.cdap.api.data.format.StructuredRecord,KEY_OUT,VALUE_OUT> |
getPushProvider(SQLPushRequest pushRequest)
Creates an Output Format Provided that can be used to push records into a SQL Engine.
|
SQLDataset |
join(SQLJoinRequest joinRequest)
Executes the join operation defined by the supplied join request.
|
configurePipeline
onRunFinish, prepareRun
SQLPushDataset<io.cdap.cdap.api.data.format.StructuredRecord,KEY_OUT,VALUE_OUT> getPushProvider(SQLPushRequest pushRequest) throws SQLEngineException
After created, this dataset will be considered "locked" until the output has been committed.
pushRequest
- the request containing information about the dataset name and schema.tSQLPushDataset
instance that can be used to write records to the SQL Engine.SQLEngineException
SQLPullDataset<io.cdap.cdap.api.data.format.StructuredRecord,KEY_IN,VALUE_IN> getPullProvider(SQLPullRequest pullRequest) throws SQLEngineException
pullRequest
- the request containing information about the dataset name and schema.SQLPullDataset
instance that can be used to read records from the SQL engine.SQLEngineException
boolean exists(String datasetName) throws SQLEngineException
This is a blocking call. if the process to write records into a dataset is ongoing, this method will block until the process completes. This ensures an accurate result for this operation.
datasetName
- the dataset name.SQLEngineException
boolean canJoin(SQLJoinDefinition joinDefinition)
joinDefinition
- the join definition to validateSQLDataset join(SQLJoinRequest joinRequest) throws SQLEngineException
All datasets involved in this joinRequest must be pushed to the SQL engine by calling the
getPushProvider(SQLPushRequest)
method, or as a result of another operation.
The returned SQLDataset
represents the resulting record form this operation
joinRequest
- the join request to execute.SQLDataset
instance representing the output of this operation.SQLEngineException
void cleanup(String datasetName) throws SQLEngineException
datasetName
- boolean specifying if all running tasks should be stopped at this time (if any are running).SQLEngineException
Copyright © 2021 Cask Data, Inc. Licensed under the Apache License, Version 2.0.