Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieving results after creating a CTAS table #47

Open
saulimus opened this issue Feb 26, 2019 · 2 comments
Open

Retrieving results after creating a CTAS table #47

saulimus opened this issue Feb 26, 2019 · 2 comments

Comments

@saulimus
Copy link

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.

@KoteiIto
Copy link
Owner

KoteiIto commented Apr 11, 2019

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?

@saulimus
Copy link
Author

saulimus commented Apr 11, 2019

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants