Я попытался добавить раздел athena через aws sdk nodejs.
const AWS = require('aws-sdk');
const athena = new AWS.Athena({apiVersion: '2017-05-18'});
let queryParams = {
QueryString: `ALTER TABLE table_name ADD PARTITION (year='2018',month='10',day='10') location 's3://bucket-name/2018/10/10/'`,
ResultConfiguration: {
OutputLocation: 's3://bucket-name/result-logs'
},
QueryExecutionContext: {
Database: 'database_name'
}
}
athena.startQueryExecution(queryParams, (err, data) => {
console.log('start query');
console.log('err : ' , err);
console.log('data : ' , data);
});
, однако я получил следующие журналы ошибок.
{ InvalidRequestException: line 1:28: missing 'COLUMN' at 'PARTITION'
at Request.extractError (/project/node_modules/aws-sdk/lib/protocol/json.js:48:27)
at Request.callListeners (/project/node_modules/aws-sdk/lib/sequential_executor.js:109:20)
at Request.emit (/project/node_modules/aws-sdk/lib/sequential_executor.js:81:10)
at Request.emit (/project/node_modules/aws-sdk/lib/request.js:683: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:685:12)
at Request.callListeners (/project/node_modules/aws-sdk/lib/sequential_executor.js:119:18)
message: 'line 1:28: missing \'COLUMN\' at \'PARTITION\'',
code: 'InvalidRequestException',
time: 2018-10-11T02:03:48.979Z,
requestId: 'xxxxxxx',
statusCode: 400,
retryable: false,
retryDelay: 81.3136245913281 }
Я не смог найти параметры COLUMN и PARTITION в aws docs
как определить COLUMN и PARTITION в параметрах json?