| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| /* | ||
| * Copyright 2025 Google LLC | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package com.google.cloud.bigquery; | ||
|
|
||
| import com.google.auto.value.AutoValue; | ||
| import java.io.Serializable; | ||
|
|
||
| /** | ||
| * Google BigQuery DataFormatOptions. Configures the output format for data types returned from | ||
| * BigQuery. | ||
| */ | ||
| @AutoValue | ||
| public abstract class DataFormatOptions implements Serializable { | ||
| public enum TimestampFormatOptions { | ||
| TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED("TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED"), | ||
| FLOAT64("FLOAT64"), | ||
| INT64("INT64"), | ||
| ISO8601_STRING("ISO8601_STRING"); | ||
|
|
||
| private final String format; | ||
|
|
||
| TimestampFormatOptions(String format) { | ||
| this.format = format; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return format; | ||
| } | ||
| } | ||
|
|
||
| public abstract boolean useInt64Timestamp(); | ||
|
|
||
| public abstract TimestampFormatOptions timestampFormatOptions(); | ||
|
|
||
| public static Builder newBuilder() { | ||
| return new AutoValue_DataFormatOptions.Builder() | ||
| .useInt64Timestamp(false) | ||
| .timestampFormatOptions(TimestampFormatOptions.TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED); | ||
| } | ||
|
|
||
| public abstract Builder toBuilder(); | ||
|
|
||
| @AutoValue.Builder | ||
| public abstract static class Builder { | ||
| public abstract Builder useInt64Timestamp(boolean useInt64Timestamp); | ||
|
|
||
| public abstract Builder timestampFormatOptions(TimestampFormatOptions timestampFormatOptions); | ||
|
|
||
| public abstract DataFormatOptions build(); | ||
| } | ||
|
|
||
| com.google.api.services.bigquery.model.DataFormatOptions toPb() { | ||
| com.google.api.services.bigquery.model.DataFormatOptions request = | ||
| new com.google.api.services.bigquery.model.DataFormatOptions(); | ||
| request.setUseInt64Timestamp(useInt64Timestamp()); | ||
| request.setTimestampOutputFormat(timestampFormatOptions().toString()); | ||
| return request; | ||
| } | ||
| } |
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityIs there a reason you would prefer @ObsoleteApi over @Deprecated?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality@Deprecated could result downstream customer's CI jobs failing based on their compiler settings. We prefer @ObsoleteApi as a first warning and then moving to @Deprecated in a future major version.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.