node-athena
node-athena copied to clipboard
Retrieving results after creating a CTAS table
I would want to get query results after I have created a CTAS table with skipFetchResult = true. I tried creating a new client with a different client config, excluding the skipFetchResult setting. However, after using the new client I still do not get any results.
Sorry for the late reply.
It is the result of executing with the following sample.
const ctasClient = athena.createClient({
bucketUri: 'xxx',
skipFetchResult: true,
},{
region: 'xxx'
})
ctasClient.execute("select 1", (err, result) => console.log(result.records))
const client = athena.createClient({
bucketUri: 'xxx',
},{
region: 'xxx'
})
client.execute("select 1", (err, result) => console.log(result.records))
Result
[]
[ Row { _col0: '1' } ]
Although the above results seem to work properly, are there any samples that cause problems?
Sorry I'm not able to provide real example code right now. But the idea is to create first a table using CTAS client, eg. : CREATE TABLE test AS ( select 1 as col1 ); And afterwards try to select from it using the normal client. (because CTAS client will skip result fetch). If the query works fine then I guess I need to make a real example from my project...