-
Notifications
You must be signed in to change notification settings - Fork 210
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
Is createQueryStream removed or is it just not working in v2 #303
Comments
This is really frustrating after #120 was closed and not announced what release it would appear in. |
@nynexman4464 it was released as part of v2.0.0. You can view the release notes here. Sorry for the confusion! As for the To help us figure out what is wrong, @RubenLaube-Pohto could you provide some code showing how you're calling |
This simple example breaks with the "A SQL query string is required" message let bigquery = new BigQuery({
projectId,
keyFilename: /*omit*/,
});
const query = `
#standardSQL
SELECT country_code, name
FROM \`countries\`;`;
bigquery.createQueryStream({ query }).on('error', error => {
console.error(error);
}).on('data', row => {
console.log(row);
}).on('end', () => {
console.log('end');
}); I ended up switching to |
I was unfortunately unable to recreate the issue. I tried to recreate the basic idea of my app as simply as I could but it did run without errors. The actual app is a bit complex, maybe overly so. The issue I had instead was that on GAE the smallest instance ran out of memory with the example. My deployed app would get that too but I thought it would just be the complexity of the app. I was able to run my deployed app locally (Ubuntu 16.04 + node10 + bq v2 with Datastore saves disabled) but the deploy is the one breaking if using node10 + bq v2. const express = require('express');
const { BigQuery } = require('@google-cloud/bigquery');
const app = express();
const client = new BigQuery({
projectId
});
const validQuery;
function runQuery() {
return new Promise((resolve, reject) => {
client.createQueryStream(validQuery)
.on('error', (err) => {
console.error(err);
reject(err);
})
.on('data', (data) => {
console.log(data);
})
.on('end', () => {
console.log('complete');
resolve();
});
});
}
app.get('/',
async (req, res, next) => {
await runQuery();
res.sendStatus(200);
}
);
app.listen(process.env.PORT || 8080, () => {
console.log('server started');
}); |
v2.0.5 has just been released which should resolve this issue, sorry for the trouble! |
Just updated and the issue is not showing up anymore. Thanks! 👍 |
@kinwa91 v2.0.5 didn't fix this for me unfortunately. I ended up following what @nynexman4464 did and switched to using
This is as far as I got before resorting to manually using |
Thanks for digging-- let me take a look 🔎 |
I was using
createQueryStream
in the 1.3 version. After updating to v2 the call does not work correctly anymore. It seems to start but then something goes wrong (see pic). The query string is passed in and is valid as it can be logged before the call and v1.3 works.The v2 documentation does not mention
createQueryStream
anymore. Does that mean it was removed? The removal is not marked as a breaking change in the changelog.Environment details
@google-cloud/bigquery
version: 2Steps to reproduce
createQueryStream
in v1.3Making sure to follow these steps will guarantee the quickest resolution possible.
Thanks!
The text was updated successfully, but these errors were encountered: