InputColumns error: Allowed types for S3 physical table are [String]

0

I am creating a DataSet from a CSV in QuickSight using the javascript SDK. Some of the columns are of string type, and others are integer. When using InputColumns in createDataSet, an error is thrown saying the only allowed types are string. When changing all types to string, the creation works. The documentation says "INTEGER" is an allowed type ( https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/QuickSight.html#createDataSet-property ), Can anyone help? I have attached the relevant code segment, an example csv and the error it throws when ran on the example dataset. The sdk version is 2.927.0.

Code:
PhysicalTableMap: {
[this.config.dataSourceId]: {
S3Source: {
DataSourceArn: arn,
InputColumns: [{
Name: "ID",
Type: "INTEGER"
}, {
Name: "Name",
Type: "STRING"
}, {
Name: "COUNT",
Type: "INTEGER"
}],
}
}

Here is an example csv file which throws the error:

"ID","NAME","COUNT"
3435458,"JOHN",10034
2345352,"JACK",23014

The error:
InvalidParameterValueException: Input column ID in physical table example has invalid type. Allowed types for S3 physical table are [String]
at Object.extractError (/project/node_modules/aws-sdk/lib/protocol/json.js:52:27)
at Request.extractError (/project/node_modules/aws-sdk/lib/protocol/rest_json.js:55:8)
at Request.callListeners (/project/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/project/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/project/node_modules/aws-sdk/lib/request.js:688:14)
at Request.transition (/project/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/project/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /project/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/project/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/project/node_modules/aws-sdk/lib/request.js:690:12)

Thanks for the help.

Edited by: tstannett on Jun 14, 2021 7:49 AM

質問済み 3年前360ビュー
1回答
0

Fix:
Create set of integer columns.
During createDataSet force all columns in InputColumn parameter to STRING, and use a LogicalTableMap in the function call as follows:

LogicalTableMap: {
[demo-logical]: {
Alias: "Test",
Source: {
PhysicalTableId: demo-physical
},
DataTransforms: Array.from(integerColumns, (c) => ({
CastColumnTypeOperation: {
ColumnName: c, /** required /
NewColumnType: "INTEGER", /
required **/
}
}))
}
},

回答済み 3年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ