Skip to content

impl(bq_driver): Picosecond support#15925

Open
Khushikathuria008 wants to merge 1 commit intogoogleapis:mainfrom
Khushikathuria008:picosecond_support
Open

impl(bq_driver): Picosecond support#15925
Khushikathuria008 wants to merge 1 commit intogoogleapis:mainfrom
Khushikathuria008:picosecond_support

Conversation

@Khushikathuria008
Copy link

@Khushikathuria008 Khushikathuria008 commented Feb 2, 2026

This change is Reviewable

@Khushikathuria008 Khushikathuria008 requested a review from a team as a code owner February 2, 2026 10:48
@gemini-code-assist
Copy link

Summary of Changes

Hello @Khushikathuria008, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant refactoring of how timestamp output formats are managed within the BigQuery minimal driver. It transitions from a simple boolean flag that dictated integer-based timestamps to a more versatile string-based configuration. This change enhances the system's flexibility, enabling support for a broader range of timestamp precisions and representations, including higher precision like picoseconds, by allowing explicit format specification.

Highlights

  • Timestamp Output Format Refactoring: The boolean flag use_int64_timestamp has been replaced with a more flexible timestamp_output_format string field across the BigQuery minimal driver components. This allows for specifying various timestamp precisions and formats.
  • Benchmark Configuration Update: The benchmark configuration now includes a new command-line flag, --timestamp-output-format=, which replaces the old --use-int64-timestamp= flag. This flag accepts a string value to define the desired timestamp output format.
  • DataFormatOptions Structure Modification: The DataFormatOptions struct has been updated to store timestamp_output_format as a std::string. It also includes two new reserved boolean fields (_reserved1, _reserved2) to maintain ABI compatibility, and the default constructor now initializes timestamp_output_format to 'FLOAT64'.
  • Debug String Method Adjustment: The DebugString method for DataFormatOptions has been modified to conditionally print the timestamp_output_format field if it is not empty, aligning with the new data structure.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for picosecond timestamps by replacing the use_int64_timestamp boolean flag with a timestamp_output_format string option. The changes affect benchmark configuration and internal request structures. My review focuses on a potential issue with the new benchmark configuration being a static member, a misleading comment about ABI compatibility, and missing input validation for the new command-line flag.

int start_index = 0;
int timeout_ms;
bool use_int64_timestamp;
static std::string timestamp_output_format;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

timestamp_output_format is declared as static, which means its value is shared across all JobConfig instances. This can lead to race conditions or incorrect results if multiple benchmarks with different configurations are run concurrently, as they would overwrite this shared setting.

To ensure each benchmark run has its own isolated configuration, please make this a non-static member variable.

  std::string timestamp_output_format;

Comment on lines 362 to 367
[this](std::string const& v) {
timestamp_output_format = v; // or validate v == "ISO8601_STRING"
}});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The parser for --timestamp-output-format accepts any string value, but the comment on line 363 (// or validate v == "ISO8601_STRING") suggests that only specific values should be allowed. To improve robustness, please add validation to ensure the provided value is one of the supported timestamp formats. An error should be reported for invalid inputs.

Comment on lines 318 to 320
// Reserved to preserve ABI / layout
bool _reserved1;
bool _reserved2;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The comment on line 318 is misleading. Replacing bool use_int64_timestamp with std::string timestamp_output_format is an ABI-breaking change due to differences in size, alignment, and the non-POD nature of std::string. The _reserved fields do not prevent this. Please remove the misleading comment to avoid confusion for future developers.

Additionally, the _reserved1 and _reserved2 members are public. If they are intended for padding or internal layout management, they should be made private to follow encapsulation principles.

@scotthart
Copy link
Member

/gcbrun

@@ -99,7 +99,7 @@ struct JobConfig : public Config {

int start_index = 0;
int timeout_ms;
bool use_int64_timestamp;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can't remove an existing variable like this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted

TracingOptions const& options,
int indent) const {
return internal::DebugFormatter(name, options, indent)
.Field("use_int64_timestamp", use_int64_timestamp)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int64 functionality should not be removed

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants