impl(bq_driver): Picosecond support#15925
impl(bq_driver): Picosecond support#15925Khushikathuria008 wants to merge 1 commit intogoogleapis:mainfrom
Conversation
Summary of ChangesHello @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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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;| [this](std::string const& v) { | ||
| timestamp_output_format = v; // or validate v == "ISO8601_STRING" | ||
| }}); |
There was a problem hiding this comment.
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.
| // Reserved to preserve ABI / layout | ||
| bool _reserved1; | ||
| bool _reserved2; |
There was a problem hiding this comment.
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.
|
/gcbrun |
| @@ -99,7 +99,7 @@ struct JobConfig : public Config { | |||
|
|
|||
| int start_index = 0; | |||
| int timeout_ms; | |||
| bool use_int64_timestamp; | |||
There was a problem hiding this comment.
we can't remove an existing variable like this
| TracingOptions const& options, | ||
| int indent) const { | ||
| return internal::DebugFormatter(name, options, indent) | ||
| .Field("use_int64_timestamp", use_int64_timestamp) |
There was a problem hiding this comment.
int64 functionality should not be removed
b2db209 to
11437db
Compare
This change is