Skip to content

Commit

Permalink
This release adds a field, AthenaError, to the GetQueryExecution resp…
Browse files Browse the repository at this point in the history
…onse object when a query fails.
  • Loading branch information
aws-sdk-dotnet-automation committed Jan 28, 2022
1 parent 03369b0 commit ffd636d
Show file tree
Hide file tree
Showing 12 changed files with 262 additions and 16 deletions.
15 changes: 14 additions & 1 deletion generator/ServiceModels/athena/athena-2017-05-18.api.json
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,12 @@
"max":1011,
"min":1
},
"AthenaError":{
"type":"structure",
"members":{
"ErrorCategory":{"shape":"ErrorCategory"}
}
},
"BatchGetNamedQueryInput":{
"type":"structure",
"required":["NamedQueryIds"],
Expand Down Expand Up @@ -792,6 +798,12 @@
"max":10,
"min":0
},
"ErrorCategory":{
"type":"integer",
"box":true,
"max":3,
"min":1
},
"ErrorCode":{
"type":"string",
"max":256,
Expand Down Expand Up @@ -1285,7 +1297,8 @@
"State":{"shape":"QueryExecutionState"},
"StateChangeReason":{"shape":"String"},
"SubmissionDateTime":{"shape":"Date"},
"CompletionDateTime":{"shape":"Date"}
"CompletionDateTime":{"shape":"Date"},
"AthenaError":{"shape":"AthenaError"}
}
},
"QueryString":{
Expand Down
20 changes: 16 additions & 4 deletions generator/ServiceModels/athena/athena-2017-05-18.docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
"UntagResourceInput$ResourceARN": "<p>Specifies the ARN of the resource from which tags are to be removed.</p>"
}
},
"AthenaError": {
"base": "<p>Provides information about an Athena query error. The <code>AthenaError</code> feature provides standardized error information to help you understand failed queries and take steps after a query failure occurs. <code>AthenaError</code> includes an <code>ErrorCategory</code> field that specifies whether the cause of the failed query is due to system error, user error, or unknown error.</p>",
"refs": {
"QueryExecutionStatus$AthenaError": "<p>Provides information about an Athena query error.</p>"
}
},
"BatchGetNamedQueryInput": {
"base": null,
"refs": {
Expand Down Expand Up @@ -98,17 +104,17 @@
"CatalogNameString": {
"base": null,
"refs": {
"CreateDataCatalogInput$Name": "<p>The name of the data catalog to create. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen characters.</p>",
"DataCatalog$Name": "<p>The name of the data catalog. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen characters.</p>",
"DataCatalogSummary$CatalogName": "<p>The name of the data catalog.</p>",
"CreateDataCatalogInput$Name": "<p>The name of the data catalog to create. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena.</p>",
"DataCatalog$Name": "<p>The name of the data catalog. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena.</p>",
"DataCatalogSummary$CatalogName": "<p>The name of the data catalog. The catalog name is unique for the Amazon Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena.</p>",
"DeleteDataCatalogInput$Name": "<p>The name of the data catalog to delete.</p>",
"GetDataCatalogInput$Name": "<p>The name of the data catalog to return.</p>",
"GetDatabaseInput$CatalogName": "<p>The name of the data catalog that contains the database to return.</p>",
"GetTableMetadataInput$CatalogName": "<p>The name of the data catalog that contains the database and table metadata to return.</p>",
"ListDatabasesInput$CatalogName": "<p>The name of the data catalog that contains the databases to return.</p>",
"ListTableMetadataInput$CatalogName": "<p>The name of the data catalog for which table metadata should be returned.</p>",
"QueryExecutionContext$Catalog": "<p>The name of the data catalog used in the query execution.</p>",
"UpdateDataCatalogInput$Name": "<p>The name of the data catalog to update. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen characters.</p>"
"UpdateDataCatalogInput$Name": "<p>The name of the data catalog to update. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena.</p>"
}
},
"Column": {
Expand Down Expand Up @@ -336,6 +342,12 @@
"ListEngineVersionsOutput$EngineVersions": "<p>A list of engine versions that are available to choose from.</p>"
}
},
"ErrorCategory": {
"base": null,
"refs": {
"AthenaError$ErrorCategory": "<p>An integer value that specifies the category of a query failure error. The following list shows the category for each integer value.</p> <p> <b>1</b> - System</p> <p> <b>2</b> - User</p> <p> <b>3</b> - Unknown</p>"
}
},
"ErrorCode": {
"base": "<p>The error code returned when the query execution failed to process, or when the processing request for the named query failed.</p>",
"refs": {
Expand Down
28 changes: 24 additions & 4 deletions generator/ServiceModels/athena/athena-2017-05-18.normal.json
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,16 @@
"max":1011,
"min":1
},
"AthenaError":{
"type":"structure",
"members":{
"ErrorCategory":{
"shape":"ErrorCategory",
"documentation":"<p>An integer value that specifies the category of a query failure error. The following list shows the category for each integer value.</p> <p> <b>1</b> - System</p> <p> <b>2</b> - User</p> <p> <b>3</b> - Unknown</p>"
}
},
"documentation":"<p>Provides information about an Athena query error. The <code>AthenaError</code> feature provides standardized error information to help you understand failed queries and take steps after a query failure occurs. <code>AthenaError</code> includes an <code>ErrorCategory</code> field that specifies whether the cause of the failed query is due to system error, user error, or unknown error.</p>"
},
"BatchGetNamedQueryInput":{
"type":"structure",
"required":["NamedQueryIds"],
Expand Down Expand Up @@ -669,7 +679,7 @@
"members":{
"Name":{
"shape":"CatalogNameString",
"documentation":"<p>The name of the data catalog to create. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen characters.</p>"
"documentation":"<p>The name of the data catalog to create. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena.</p>"
},
"Type":{
"shape":"DataCatalogType",
Expand Down Expand Up @@ -805,7 +815,7 @@
"members":{
"Name":{
"shape":"CatalogNameString",
"documentation":"<p>The name of the data catalog. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen characters.</p>"
"documentation":"<p>The name of the data catalog. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena.</p>"
},
"Description":{
"shape":"DescriptionString",
Expand All @@ -827,7 +837,7 @@
"members":{
"CatalogName":{
"shape":"CatalogNameString",
"documentation":"<p>The name of the data catalog.</p>"
"documentation":"<p>The name of the data catalog. The catalog name is unique for the Amazon Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena.</p>"
},
"Type":{
"shape":"DataCatalogType",
Expand Down Expand Up @@ -1007,6 +1017,12 @@
"max":10,
"min":0
},
"ErrorCategory":{
"type":"integer",
"box":true,
"max":3,
"min":1
},
"ErrorCode":{
"type":"string",
"documentation":"<p>The error code returned when the query execution failed to process, or when the processing request for the named query failed.</p>",
Expand Down Expand Up @@ -1819,6 +1835,10 @@
"CompletionDateTime":{
"shape":"Date",
"documentation":"<p>The date and time that the query completed.</p>"
},
"AthenaError":{
"shape":"AthenaError",
"documentation":"<p>Provides information about an Athena query error.</p>"
}
},
"documentation":"<p>The completion date, current state, submission time, and state change reason (if applicable) for the query execution.</p>"
Expand Down Expand Up @@ -2176,7 +2196,7 @@
"members":{
"Name":{
"shape":"CatalogNameString",
"documentation":"<p>The name of the data catalog to update. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen characters.</p>"
"documentation":"<p>The name of the data catalog to update. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena.</p>"
},
"Type":{
"shape":"DataCatalogType",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,11 @@
<property>Amazon.Athena.Model.UpdateWorkGroupRequest.WorkGroup</property>
<pattern>[a-zA-Z0-9._-]{1,128}</pattern>
</property-value-rule>
<property-value-rule>
<property>Amazon.Athena.Model.AthenaError.ErrorCategory</property>
<min>1</min>
<max>3</max>
</property-value-rule>
<property-value-rule>
<property>Amazon.Athena.Model.Column.Comment</property>
<min>0</min>
Expand Down
75 changes: 75 additions & 0 deletions sdk/src/Services/Athena/Generated/Model/AthenaError.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* Copyright 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.
*/

/*
* Do not modify this file. This file is generated from the athena-2017-05-18.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;

using Amazon.Runtime;
using Amazon.Runtime.Internal;

namespace Amazon.Athena.Model
{
/// <summary>
/// Provides information about an Athena query error. The <code>AthenaError</code> feature
/// provides standardized error information to help you understand failed queries and
/// take steps after a query failure occurs. <code>AthenaError</code> includes an <code>ErrorCategory</code>
/// field that specifies whether the cause of the failed query is due to system error,
/// user error, or unknown error.
/// </summary>
public partial class AthenaError
{
private int? _errorCategory;

/// <summary>
/// Gets and sets the property ErrorCategory.
/// <para>
/// An integer value that specifies the category of a query failure error. The following
/// list shows the category for each integer value.
/// </para>
///
/// <para>
/// <b>1</b> - System
/// </para>
///
/// <para>
/// <b>2</b> - User
/// </para>
///
/// <para>
/// <b>3</b> - Unknown
/// </para>
/// </summary>
[AWSProperty(Min=1, Max=3)]
public int ErrorCategory
{
get { return this._errorCategory.GetValueOrDefault(); }
set { this._errorCategory = value; }
}

// Check to see if ErrorCategory property is set
internal bool IsSetErrorCategory()
{
return this._errorCategory.HasValue;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ internal bool IsSetDescription()
/// Gets and sets the property Name.
/// <para>
/// The name of the data catalog to create. The catalog name must be unique for the Amazon
/// Web Services account and can use a maximum of 128 alphanumeric, underscore, at sign,
/// or hyphen characters.
/// Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign,
/// or hyphen characters. The remainder of the length constraint of 256 is reserved for
/// use by Athena.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1, Max=256)]
Expand Down
4 changes: 2 additions & 2 deletions sdk/src/Services/Athena/Generated/Model/DataCatalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ internal bool IsSetDescription()
/// Gets and sets the property Name.
/// <para>
/// The name of the data catalog. The catalog name must be unique for the Amazon Web Services
/// account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen
/// characters.
/// account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen
/// characters. The remainder of the length constraint of 256 is reserved for use by Athena.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1, Max=256)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public partial class DataCatalogSummary
/// <summary>
/// Gets and sets the property CatalogName.
/// <para>
/// The name of the data catalog.
/// The name of the data catalog. The catalog name is unique for the Amazon Web Services
/// account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen
/// characters. The remainder of the length constraint of 256 is reserved for use by Athena.
/// </para>
/// </summary>
[AWSProperty(Min=1, Max=256)]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*
* Copyright 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.
*/

/*
* Do not modify this file. This file is generated from the athena-2017-05-18.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;

using Amazon.Athena.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;

namespace Amazon.Athena.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for AthenaError Object
/// </summary>
public class AthenaErrorUnmarshaller : IUnmarshaller<AthenaError, XmlUnmarshallerContext>, IUnmarshaller<AthenaError, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
AthenaError IUnmarshaller<AthenaError, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context)
{
throw new NotImplementedException();
}

/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public AthenaError Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;

AthenaError unmarshalledObject = new AthenaError();

int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("ErrorCategory", targetDepth))
{
var unmarshaller = IntUnmarshaller.Instance;
unmarshalledObject.ErrorCategory = unmarshaller.Unmarshall(context);
continue;
}
}

return unmarshalledObject;
}


private static AthenaErrorUnmarshaller _instance = new AthenaErrorUnmarshaller();

/// <summary>
/// Gets the singleton.
/// </summary>
public static AthenaErrorUnmarshaller Instance
{
get
{
return _instance;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ public QueryExecutionStatus Unmarshall(JsonUnmarshallerContext context)
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("AthenaError", targetDepth))
{
var unmarshaller = AthenaErrorUnmarshaller.Instance;
unmarshalledObject.AthenaError = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("CompletionDateTime", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
Expand Down
Loading

0 comments on commit ffd636d

Please sign in to comment.