Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-12532

BigQueryUtils fromBeamField omits ":00" from times with 0 seconds

Details

    • Bug
    • Status: Resolved
    • P2
    • Resolution: Fixed
    • 2.30.0
    • 2.32.0
    • io-java-gcp
    • None

    Description

      If a value in a Beam Row is of the SqlTypes.TIME data type, BigQueryUtils uses `toString()` to print out the time value [1]. `toString()` tries to optimize the string length by omitting nanoseconds if it is zero, and seconds if it is also zero [2]. However the BigQuery time type requires seconds to always be there even if it's zero [3].

      [1] https://github.com/apache/beam/blob/58e2ea9c40fd08e24f23183852970f566b17d6cd/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryUtils.java#L551
      [2] https://docs.oracle.com/javase/8/docs/api/java/time/LocalTime.html#toString--
      [3] https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#time_type

      Attachments

        Issue Links

          Activity

            People

              mouyang Matthew Ouyang
              mouyang Matthew Ouyang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h 10m
                  3h 10m