Skip to content

Conversation

@danieljbruce
Copy link
Contributor

@danieljbruce danieljbruce commented Jan 16, 2026

Description

For TIMESTAMP type fields in the table schema we can now specify timestampPrecision property so that the TIMESTAMP field can have Picosecond precision.

To support this we ran npm run types to generate all changes in this PR to types.d.ts. This automatically makes changes upstream to the createTable method adding the timestampPrecision property for fields. Then we write a system test that
makes use of the new property to verify it works as intended.

Impact

Allows users to create tables with TIMESTAMP fields that have picosecond precision.

Testing

  • Adds a test showing how precision is specified for fields of non-TIMESTAMP type.
  • Adds a test showing how precision (timestampPrecision) is specified for TIMESTAMP type.

Additional Information

An alternative considered is that we would just allow the user to specify a precision value in their table schema instead of timestampPrecision and the timestampPrecision property would be invisible to the user. However, this is not how it is done in other languages like googleapis/java-bigquery#4014 and supporting timestampPrecision this way would complicate the codebase because we would need to exclude timestampPrecision from TableField and TableSchema interfaces which would introduce a lot of changes and complexity.

The new timestampPrecision field affects ITableFieldSchema which affects ITableSchema which affects TableSchema and TableMetadata. This means the following methods now support the new timestampPrecision property too:

  • table.setMetadata
  • bigquery.mergeSchemaWithRows
  • table.createSchemaFromString
  • all methods using the ITable, IQueryResponse, IJobStatistics2, IJobConfigurationLoad, IGetQueryResultsResponse, IExternalDataConfiguration interfaces

Next Steps

  • Add support for a SQL high precision data type, query parameterization, reading rows language value types, write API support and insert all support

@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/nodejs-bigquery API. labels Jan 16, 2026
@danieljbruce danieljbruce changed the title Schema precision feat: Support createTable with TIMESTAMP fields that have Picosecond precision Jan 16, 2026
@danieljbruce danieljbruce marked this pull request as ready for review January 16, 2026 18:03
@danieljbruce danieljbruce requested review from a team as code owners January 16, 2026 18:03
@alvarowolfx
Copy link
Contributor

The discovery types are synced with an automation. We can merge this PR first #1550 instead of having such changes here.

Also we might want to rename this PR to something like test: exercise createTable with TIMESTAMP fields that have Picosecond precision since this doesn't add support for that, just exercises the feature. The feature itself is added via having the fields in sync with Discovery.

alvarowolfx
alvarowolfx previously approved these changes Jan 16, 2026
@alvarowolfx alvarowolfx added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 20, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 20, 2026
@danieljbruce danieljbruce added the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 23, 2026
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 23, 2026
Comment on lines +64 to +74
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version: 18
- run: npm install
- run: npm run docs
- uses: JustinBeckwith/linkinator-action@v1
with:
paths: docs/

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
@alvarowolfx alvarowolfx self-requested a review January 23, 2026 17:44
@danieljbruce danieljbruce added the automerge Merge the pull request once unit tests and other checks pass. label Jan 23, 2026
@gcf-merge-on-green gcf-merge-on-green bot merged commit 9f74a69 into main Jan 23, 2026
21 of 22 checks passed
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jan 23, 2026
@gcf-merge-on-green gcf-merge-on-green bot deleted the schema-precision branch January 23, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the googleapis/nodejs-bigquery API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants