Skip to content
This repository was archived by the owner on Feb 7, 2026. It is now read-only.
This repository was archived by the owner on Feb 7, 2026. It is now read-only.

ARRAY<TIMESTAMP> not passed to BQ API #392

@dinvlad

Description

@dinvlad

Environment details

  • OS: High Sierra (10.13.6)
  • Node.js version: 8.15.1
  • npm version: 6.9.0
  • @google-cloud/bigquery version: 2.1.0

Steps to reproduce

  1. Create a query with a param of type ARRAY<TIMESTAMP>, e.g.
SELECT *
FROM `bigquery-public-data.san_francisco.street_trees`
WHERE plant_date IN UNNEST(@plant_date) LIMIT 1
  1. Verify that the results from nodejs-bigquery are empty:
const [rows] = await bq.query({
  query,
  params: {
    plant_date: [bq.timestamp('2001-04-25T00:00:00.000Z')],
  },
});
console.log(rows); // prints []
  1. Run the same query in gcloud SDK and verify that the results are NOT empty:
bq --location=US query --use_legacy_sql=false \
  --parameter='plant_date:ARRAY<TIMESTAMP>:["2001-04-25T00:00:00.000Z"]' \
  '<query>'
  1. Check job object for (2) via BigQuery API, which reports:
"queryParameters": [
  {
    "name": "plant_date",
    "parameterType": {
      "type": "ARRAY",
      "arrayType": {
        "type": "TIMESTAMP"
      }
    },
    "parameterValue": {}
  }
]

Note that "parameterValue": {} for (2), but

"parameterValue": {
  "arrayValues": [
    {
      "value": "2001-04-25T00:00:00.000Z"
    }
  ]
}

for (3). So it appears that the ARRAY<TIMESTAMP> value is not passed correctly to BQ API from nodejs-bigquery.

Thanks!

Metadata

Metadata

Labels

🚨This issue needs some love.api: bigqueryIssues related to the googleapis/nodejs-bigquery API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.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