Skip to content
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

[firestore-bigquery-export] Add DATETIME support to gen-schema-view #829

Open
jasonberryman opened this issue Dec 10, 2021 · 4 comments
Open
Labels
extension: firestore-bigquery-export Related to firestore-bigquery-export extension good first issue Good for newcomers needs: author feedback Pending additional information from the author

Comments

@jasonberryman
Copy link

This feature request is for extension: "firestore-bigquery-export"

Convert a ISO8601 date/time string to a DATETIME field in the BigQuery gen-schema-view utility. The timezone offset is not required, as this is simply to show the local time for the user.

This would be used for reporting when the date/time are required for the local time of the event, rather than the "moment in time" that the event happened.

@dackers86 dackers86 added the good first issue Good for newcomers label Dec 13, 2021
@dackers86 dackers86 added this to Under consideration in Extension Update Tracker via automation Dec 13, 2021
@i14h
Copy link
Member

i14h commented Dec 21, 2021

@dackers86 lets investigate this a bit more

@dackers86 dackers86 moved this from Under consideration to Accepted in Extension Update Tracker Jan 12, 2022
@dackers86
Copy link
Member

Hi @jasonberryman

Would a specific DATETIME field type resolve this issue for the schema generation?

We also currently use timestamp: new Date(0).toISOString() for Timestamps, could this be the field you are referring to?

@dackers86 dackers86 added the needs: author feedback Pending additional information from the author label Jan 13, 2022
@dackers86 dackers86 moved this from Accepted to Blocked in Extension Update Tracker Jan 13, 2022
@jasonberryman
Copy link
Author

Hi @dackers86

A Timestamp denotes a point in time, specified in UTC. The requirement here is to capture the user's local time.

@dackers86
Copy link
Member

Thanks @jasonberryman

Before starting PR there are still some things I want to clarify.

According to a developer comment on the the Big Query Change Tracker...

  // The timestamp represented in ISO format.
  // Date is not appropriate because it only has millisecond precision.
  // Cloud Firestore timestamps have microsecond precision.
  timestamp: string;

For backwards compatibility, an option could be added to choose which format the timestamp field should be created in - we could for example allow the user to select the timeStampFormatas either DATETIME or TIMESTAMP depending on the user selection.

Additional tests would show how this would affect the data.

@pr-Mais pr-Mais added the extension: firestore-bigquery-export Related to firestore-bigquery-export extension label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension: firestore-bigquery-export Related to firestore-bigquery-export extension good first issue Good for newcomers needs: author feedback Pending additional information from the author
Projects
Development

No branches or pull requests

4 participants