com.amazonaws.services.athena.model.QueryExecution Maven / Gradle / Ivy
Show all versions of aws-java-sdk-athena Show documentation
/*
* Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.athena.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Information about a single instance of a query execution.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class QueryExecution implements Serializable, Cloneable, StructuredPojo {
/**
*
* The unique identifier for each query execution.
*
*/
private String queryExecutionId;
/**
*
* The SQL query statements which the query execution ran.
*
*/
private String query;
/**
*
* The type of query statement that was run. DDL
indicates DDL query statements. DML
* indicates DML (Data Manipulation Language) query statements, such as CREATE TABLE AS SELECT
.
* UTILITY
indicates query statements other than DDL and DML, such as SHOW CREATE TABLE
,
* or DESCRIBE TABLE
.
*
*/
private String statementType;
/**
*
* The location in Amazon S3 where query results were stored and the encryption option, if any, used for query
* results. These are known as "client-side settings". If workgroup settings override client-side settings, then the
* query uses the location for the query results and the encryption configuration that are specified for the
* workgroup.
*
*/
private ResultConfiguration resultConfiguration;
/**
*
* The database in which the query execution occurred.
*
*/
private QueryExecutionContext queryExecutionContext;
/**
*
* The completion date, current state, submission time, and state change reason (if applicable) for the query
* execution.
*
*/
private QueryExecutionStatus status;
/**
*
* Query execution statistics, such as the amount of data scanned, the amount of time that the query took to
* process, and the type of statement that was run.
*
*/
private QueryExecutionStatistics statistics;
/**
*
* The name of the workgroup in which the query ran.
*
*/
private String workGroup;
/**
*
* The engine version that executed the query.
*
*/
private EngineVersion engineVersion;
/**
*
* The unique identifier for each query execution.
*
*
* @param queryExecutionId
* The unique identifier for each query execution.
*/
public void setQueryExecutionId(String queryExecutionId) {
this.queryExecutionId = queryExecutionId;
}
/**
*
* The unique identifier for each query execution.
*
*
* @return The unique identifier for each query execution.
*/
public String getQueryExecutionId() {
return this.queryExecutionId;
}
/**
*
* The unique identifier for each query execution.
*
*
* @param queryExecutionId
* The unique identifier for each query execution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public QueryExecution withQueryExecutionId(String queryExecutionId) {
setQueryExecutionId(queryExecutionId);
return this;
}
/**
*
* The SQL query statements which the query execution ran.
*
*
* @param query
* The SQL query statements which the query execution ran.
*/
public void setQuery(String query) {
this.query = query;
}
/**
*
* The SQL query statements which the query execution ran.
*
*
* @return The SQL query statements which the query execution ran.
*/
public String getQuery() {
return this.query;
}
/**
*
* The SQL query statements which the query execution ran.
*
*
* @param query
* The SQL query statements which the query execution ran.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public QueryExecution withQuery(String query) {
setQuery(query);
return this;
}
/**
*
* The type of query statement that was run. DDL
indicates DDL query statements. DML
* indicates DML (Data Manipulation Language) query statements, such as CREATE TABLE AS SELECT
.
* UTILITY
indicates query statements other than DDL and DML, such as SHOW CREATE TABLE
,
* or DESCRIBE TABLE
.
*
*
* @param statementType
* The type of query statement that was run. DDL
indicates DDL query statements.
* DML
indicates DML (Data Manipulation Language) query statements, such as
* CREATE TABLE AS SELECT
. UTILITY
indicates query statements other than DDL and
* DML, such as SHOW CREATE TABLE
, or DESCRIBE TABLE
.
* @see StatementType
*/
public void setStatementType(String statementType) {
this.statementType = statementType;
}
/**
*
* The type of query statement that was run. DDL
indicates DDL query statements. DML
* indicates DML (Data Manipulation Language) query statements, such as CREATE TABLE AS SELECT
.
* UTILITY
indicates query statements other than DDL and DML, such as SHOW CREATE TABLE
,
* or DESCRIBE TABLE
.
*
*
* @return The type of query statement that was run. DDL
indicates DDL query statements.
* DML
indicates DML (Data Manipulation Language) query statements, such as
* CREATE TABLE AS SELECT
. UTILITY
indicates query statements other than DDL and
* DML, such as SHOW CREATE TABLE
, or DESCRIBE TABLE
.
* @see StatementType
*/
public String getStatementType() {
return this.statementType;
}
/**
*
* The type of query statement that was run. DDL
indicates DDL query statements. DML
* indicates DML (Data Manipulation Language) query statements, such as CREATE TABLE AS SELECT
.
* UTILITY
indicates query statements other than DDL and DML, such as SHOW CREATE TABLE
,
* or DESCRIBE TABLE
.
*
*
* @param statementType
* The type of query statement that was run. DDL
indicates DDL query statements.
* DML
indicates DML (Data Manipulation Language) query statements, such as
* CREATE TABLE AS SELECT
. UTILITY
indicates query statements other than DDL and
* DML, such as SHOW CREATE TABLE
, or DESCRIBE TABLE
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see StatementType
*/
public QueryExecution withStatementType(String statementType) {
setStatementType(statementType);
return this;
}
/**
*
* The type of query statement that was run. DDL
indicates DDL query statements. DML
* indicates DML (Data Manipulation Language) query statements, such as CREATE TABLE AS SELECT
.
* UTILITY
indicates query statements other than DDL and DML, such as SHOW CREATE TABLE
,
* or DESCRIBE TABLE
.
*
*
* @param statementType
* The type of query statement that was run. DDL
indicates DDL query statements.
* DML
indicates DML (Data Manipulation Language) query statements, such as
* CREATE TABLE AS SELECT
. UTILITY
indicates query statements other than DDL and
* DML, such as SHOW CREATE TABLE
, or DESCRIBE TABLE
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see StatementType
*/
public QueryExecution withStatementType(StatementType statementType) {
this.statementType = statementType.toString();
return this;
}
/**
*
* The location in Amazon S3 where query results were stored and the encryption option, if any, used for query
* results. These are known as "client-side settings". If workgroup settings override client-side settings, then the
* query uses the location for the query results and the encryption configuration that are specified for the
* workgroup.
*
*
* @param resultConfiguration
* The location in Amazon S3 where query results were stored and the encryption option, if any, used for
* query results. These are known as "client-side settings". If workgroup settings override client-side
* settings, then the query uses the location for the query results and the encryption configuration that are
* specified for the workgroup.
*/
public void setResultConfiguration(ResultConfiguration resultConfiguration) {
this.resultConfiguration = resultConfiguration;
}
/**
*
* The location in Amazon S3 where query results were stored and the encryption option, if any, used for query
* results. These are known as "client-side settings". If workgroup settings override client-side settings, then the
* query uses the location for the query results and the encryption configuration that are specified for the
* workgroup.
*
*
* @return The location in Amazon S3 where query results were stored and the encryption option, if any, used for
* query results. These are known as "client-side settings". If workgroup settings override client-side
* settings, then the query uses the location for the query results and the encryption configuration that
* are specified for the workgroup.
*/
public ResultConfiguration getResultConfiguration() {
return this.resultConfiguration;
}
/**
*
* The location in Amazon S3 where query results were stored and the encryption option, if any, used for query
* results. These are known as "client-side settings". If workgroup settings override client-side settings, then the
* query uses the location for the query results and the encryption configuration that are specified for the
* workgroup.
*
*
* @param resultConfiguration
* The location in Amazon S3 where query results were stored and the encryption option, if any, used for
* query results. These are known as "client-side settings". If workgroup settings override client-side
* settings, then the query uses the location for the query results and the encryption configuration that are
* specified for the workgroup.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public QueryExecution withResultConfiguration(ResultConfiguration resultConfiguration) {
setResultConfiguration(resultConfiguration);
return this;
}
/**
*
* The database in which the query execution occurred.
*
*
* @param queryExecutionContext
* The database in which the query execution occurred.
*/
public void setQueryExecutionContext(QueryExecutionContext queryExecutionContext) {
this.queryExecutionContext = queryExecutionContext;
}
/**
*
* The database in which the query execution occurred.
*
*
* @return The database in which the query execution occurred.
*/
public QueryExecutionContext getQueryExecutionContext() {
return this.queryExecutionContext;
}
/**
*
* The database in which the query execution occurred.
*
*
* @param queryExecutionContext
* The database in which the query execution occurred.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public QueryExecution withQueryExecutionContext(QueryExecutionContext queryExecutionContext) {
setQueryExecutionContext(queryExecutionContext);
return this;
}
/**
*
* The completion date, current state, submission time, and state change reason (if applicable) for the query
* execution.
*
*
* @param status
* The completion date, current state, submission time, and state change reason (if applicable) for the query
* execution.
*/
public void setStatus(QueryExecutionStatus status) {
this.status = status;
}
/**
*
* The completion date, current state, submission time, and state change reason (if applicable) for the query
* execution.
*
*
* @return The completion date, current state, submission time, and state change reason (if applicable) for the
* query execution.
*/
public QueryExecutionStatus getStatus() {
return this.status;
}
/**
*
* The completion date, current state, submission time, and state change reason (if applicable) for the query
* execution.
*
*
* @param status
* The completion date, current state, submission time, and state change reason (if applicable) for the query
* execution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public QueryExecution withStatus(QueryExecutionStatus status) {
setStatus(status);
return this;
}
/**
*
* Query execution statistics, such as the amount of data scanned, the amount of time that the query took to
* process, and the type of statement that was run.
*
*
* @param statistics
* Query execution statistics, such as the amount of data scanned, the amount of time that the query took to
* process, and the type of statement that was run.
*/
public void setStatistics(QueryExecutionStatistics statistics) {
this.statistics = statistics;
}
/**
*
* Query execution statistics, such as the amount of data scanned, the amount of time that the query took to
* process, and the type of statement that was run.
*
*
* @return Query execution statistics, such as the amount of data scanned, the amount of time that the query took to
* process, and the type of statement that was run.
*/
public QueryExecutionStatistics getStatistics() {
return this.statistics;
}
/**
*
* Query execution statistics, such as the amount of data scanned, the amount of time that the query took to
* process, and the type of statement that was run.
*
*
* @param statistics
* Query execution statistics, such as the amount of data scanned, the amount of time that the query took to
* process, and the type of statement that was run.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public QueryExecution withStatistics(QueryExecutionStatistics statistics) {
setStatistics(statistics);
return this;
}
/**
*
* The name of the workgroup in which the query ran.
*
*
* @param workGroup
* The name of the workgroup in which the query ran.
*/
public void setWorkGroup(String workGroup) {
this.workGroup = workGroup;
}
/**
*
* The name of the workgroup in which the query ran.
*
*
* @return The name of the workgroup in which the query ran.
*/
public String getWorkGroup() {
return this.workGroup;
}
/**
*
* The name of the workgroup in which the query ran.
*
*
* @param workGroup
* The name of the workgroup in which the query ran.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public QueryExecution withWorkGroup(String workGroup) {
setWorkGroup(workGroup);
return this;
}
/**
*
* The engine version that executed the query.
*
*
* @param engineVersion
* The engine version that executed the query.
*/
public void setEngineVersion(EngineVersion engineVersion) {
this.engineVersion = engineVersion;
}
/**
*
* The engine version that executed the query.
*
*
* @return The engine version that executed the query.
*/
public EngineVersion getEngineVersion() {
return this.engineVersion;
}
/**
*
* The engine version that executed the query.
*
*
* @param engineVersion
* The engine version that executed the query.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public QueryExecution withEngineVersion(EngineVersion engineVersion) {
setEngineVersion(engineVersion);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getQueryExecutionId() != null)
sb.append("QueryExecutionId: ").append(getQueryExecutionId()).append(",");
if (getQuery() != null)
sb.append("Query: ").append(getQuery()).append(",");
if (getStatementType() != null)
sb.append("StatementType: ").append(getStatementType()).append(",");
if (getResultConfiguration() != null)
sb.append("ResultConfiguration: ").append(getResultConfiguration()).append(",");
if (getQueryExecutionContext() != null)
sb.append("QueryExecutionContext: ").append(getQueryExecutionContext()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus()).append(",");
if (getStatistics() != null)
sb.append("Statistics: ").append(getStatistics()).append(",");
if (getWorkGroup() != null)
sb.append("WorkGroup: ").append(getWorkGroup()).append(",");
if (getEngineVersion() != null)
sb.append("EngineVersion: ").append(getEngineVersion());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof QueryExecution == false)
return false;
QueryExecution other = (QueryExecution) obj;
if (other.getQueryExecutionId() == null ^ this.getQueryExecutionId() == null)
return false;
if (other.getQueryExecutionId() != null && other.getQueryExecutionId().equals(this.getQueryExecutionId()) == false)
return false;
if (other.getQuery() == null ^ this.getQuery() == null)
return false;
if (other.getQuery() != null && other.getQuery().equals(this.getQuery()) == false)
return false;
if (other.getStatementType() == null ^ this.getStatementType() == null)
return false;
if (other.getStatementType() != null && other.getStatementType().equals(this.getStatementType()) == false)
return false;
if (other.getResultConfiguration() == null ^ this.getResultConfiguration() == null)
return false;
if (other.getResultConfiguration() != null && other.getResultConfiguration().equals(this.getResultConfiguration()) == false)
return false;
if (other.getQueryExecutionContext() == null ^ this.getQueryExecutionContext() == null)
return false;
if (other.getQueryExecutionContext() != null && other.getQueryExecutionContext().equals(this.getQueryExecutionContext()) == false)
return false;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
if (other.getStatistics() == null ^ this.getStatistics() == null)
return false;
if (other.getStatistics() != null && other.getStatistics().equals(this.getStatistics()) == false)
return false;
if (other.getWorkGroup() == null ^ this.getWorkGroup() == null)
return false;
if (other.getWorkGroup() != null && other.getWorkGroup().equals(this.getWorkGroup()) == false)
return false;
if (other.getEngineVersion() == null ^ this.getEngineVersion() == null)
return false;
if (other.getEngineVersion() != null && other.getEngineVersion().equals(this.getEngineVersion()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getQueryExecutionId() == null) ? 0 : getQueryExecutionId().hashCode());
hashCode = prime * hashCode + ((getQuery() == null) ? 0 : getQuery().hashCode());
hashCode = prime * hashCode + ((getStatementType() == null) ? 0 : getStatementType().hashCode());
hashCode = prime * hashCode + ((getResultConfiguration() == null) ? 0 : getResultConfiguration().hashCode());
hashCode = prime * hashCode + ((getQueryExecutionContext() == null) ? 0 : getQueryExecutionContext().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getStatistics() == null) ? 0 : getStatistics().hashCode());
hashCode = prime * hashCode + ((getWorkGroup() == null) ? 0 : getWorkGroup().hashCode());
hashCode = prime * hashCode + ((getEngineVersion() == null) ? 0 : getEngineVersion().hashCode());
return hashCode;
}
@Override
public QueryExecution clone() {
try {
return (QueryExecution) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.athena.model.transform.QueryExecutionMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}