Skip to content

cannot perform query with parentheses #372

Description

@ef7475

Hello,
We are using gcloud with NodeJS server to perform queries a Google BigQuery db.
Our server runs on Amazon Beanstalk.

We are running the following query:

var bigquery = gcloud.bigquery({
  projectId: 'XXX',
  keyFilename: 'YYY'
});
var query = "SELECT COUNT(id) FROM AAA.BBB";
bigquery.query(query, function(err, rows) {
    if (err) {
      handleError(res,err);
    }
    else {
      res.send(200,rows);
    }
  });

it works fine on the development environment, but when installing on Beanstalk, we get the following error:

"errors": [
        {
            "domain": "global",
            "reason": "invalidQuery",
            "message": "Encountered \" \"%\" \"% \"\" at line 1, column 18.\nWas expecting:\n    <EOF> \n    ",
            "locationType": "other",
            "location": "query"
        }
    ],
    "code": 400,
    "message": "Encountered \" \"%\" \"% \"\" at line 1, column 18.\nWas expecting:\n    <EOF> \n    "

My guess is that somehow the parenthesis in the query are being escaped (because queries without parenthesis works ok). We cannot figure out how to solve this.

Your help will be appreciated.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.api: bigqueryIssues related to the BigQuery API.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions