public class SQLJob extends Job
JOB_TIMEOUT_SECOND
client, JOB_TRANSACTION_ERROR_CODE
Constructor and Description |
---|
SQLJob(Queue queue,
String sql) |
SQLJob(Queue queue,
String currentdb,
String sql) |
SQLJob(Queue queue,
String currentdb,
String sql,
String transactionId) |
Modifier and Type | Method and Description |
---|---|
void |
asyncSubmit() |
void |
cancelExportJob()
If exportResult is RUNNING or LAUNCHING,you can cancel it.
|
Reader |
exportResult()
Export QUEUE type job result with a iterator
|
Reader |
exportResult(Integer limit) |
void |
exportResult(String dataPath,
StorageType storageType,
CompressType compressType,
ExportMode exportMode,
String queueName)
Export QUEUE type job result.
|
void |
exportResult(String dataPath,
StorageType storageType,
CompressType compressType,
ExportMode exportMode,
String queueName,
boolean withColumnHeader) |
void |
exportResult(String dataPath,
StorageType storageType,
CompressType compressType,
ExportMode exportMode,
String queueName,
boolean withColumnHeader,
Integer limitNum) |
void |
exportResult(String dataPath,
StorageType storageType,
CompressType compressType,
ExportMode exportMode,
String queueName,
boolean withColumnHeader,
Integer limitNum,
String encodingType) |
String |
getCurrentdb() |
JobStatus |
getExportJobStatus()
If execute exportResult,you can get exportJob status.
|
String |
getJobMode() |
List<Row> |
getJobResult()
If job type is "QUEUE",you can get this job result.
|
List<Row> |
getJobResult(Integer pageSize,
Integer currentPage)
If job type is "QUEUE",you can get this job result.
|
ResultSet |
getJobResultSet() |
TableSchema |
getResultSchema() |
int |
getRowCount() |
String |
getSql() |
protected JobResultInfo |
getStatusResult(String jobId)
Get this job resultInfo: detail,statement,status...
|
List<Row> |
previewJobResult()
If job type is "QUEUE",you can get this job result
Just get top 1000
|
void |
setSql(String sql) |
void |
submit()
Submit SQL job
|
ResultSet |
submitQuery()
Submit a SQL job, which returns a
ResultSet object. |
cancelJob, checkJobFinish, checkJobFinish, checkJobRunningStatus, getConf, getJobId, getJobTimeout, getJobType, getProjectId, getQueue, getStatus, getTags, getTransactionKeyName, setConf, setJobId, setJobTimeout, setJobType, setTags
apiExceptionRetryManage, executeCall, executeWithRetry, getTransactionId, isServiceInsideError, setTransactionId
public String getJobMode()
public String getSql()
public void setSql(String sql)
public String getCurrentdb()
public ResultSet submitQuery() throws DLIException
ResultSet
object.DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic void submit() throws DLIException
submit
in class Job
DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic void asyncSubmit() throws DLIException
DLIException
protected JobResultInfo getStatusResult(String jobId) throws DLIException
Job
getStatusResult
in class Job
jobId
- the job idDLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic List<Row> getJobResult() throws DLIException
DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic List<Row> previewJobResult() throws DLIException
DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic List<Row> getJobResult(Integer pageSize, Integer currentPage) throws DLIException
pageSize
- The maximum number of jobs displayed on each page, in the range: [1, 100].currentPage
- The current page numberDLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic void exportResult(String dataPath, StorageType storageType, CompressType compressType, ExportMode exportMode, String queueName) throws DLIException
dataPath
- data pathstorageType
- StorageTypecompressType
- CompressTypeexportMode
- ExportModequeueName
- queue nameDLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic void exportResult(String dataPath, StorageType storageType, CompressType compressType, ExportMode exportMode, String queueName, boolean withColumnHeader) throws DLIException
dataPath
- data pathstorageType
- StorageTypecompressType
- CompressTypeexportMode
- ExportModequeueName
- queue namewithColumnHeader
- if with col headerDLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic void exportResult(String dataPath, StorageType storageType, CompressType compressType, ExportMode exportMode, String queueName, boolean withColumnHeader, Integer limitNum) throws DLIException
dataPath
- data pathstorageType
- StorageTypecompressType
- CompressTypeexportMode
- ExportModequeueName
- queue namewithColumnHeader
- if with col headerlimitNum
- limit numDLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic void exportResult(String dataPath, StorageType storageType, CompressType compressType, ExportMode exportMode, String queueName, boolean withColumnHeader, Integer limitNum, String encodingType) throws DLIException
dataPath
- data pathstorageType
- StorageTypecompressType
- CompressTypeexportMode
- ExportModequeueName
- queue namewithColumnHeader
- if with col headerlimitNum
- limit numencodingType
- encodingTypeDLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic Reader exportResult() throws DLIException
DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic Reader exportResult(Integer limit) throws DLIException
DLIException
public JobStatus getExportJobStatus() throws DLIException
DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic void cancelExportJob() throws DLIException
DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic int getRowCount() throws DLIException
DLIException
public TableSchema getResultSchema() throws DLIException
DLIException
public ResultSet getJobResultSet()
Copyright © 2023. All rights reserved.