-
Notifications
You must be signed in to change notification settings - Fork 210
feat: Support createTable with TIMESTAMP fields that have Picosecond precision #1588
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
Conversation
|
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 |
| 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
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 typesto generate all changes in this PR totypes.d.ts. This automatically makes changes upstream to thecreateTablemethod adding thetimestampPrecisionproperty for fields. Then we write a system test thatmakes 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
Additional Information
An alternative considered is that we would just allow the user to specify a
precisionvalue in their table schema instead of timestampPrecision and thetimestampPrecisionproperty would be invisible to the user. However, this is not how it is done in other languages like googleapis/java-bigquery#4014 and supportingtimestampPrecisionthis way would complicate the codebase because we would need to excludetimestampPrecisionfromTableFieldandTableSchemainterfaces 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:
Next Steps