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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠