claudevdm commented on code in PR #37079:
URL: https://github.com/apache/beam/pull/37079#discussion_r2638726108
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryStorageQuerySource.java:
##########
@@ -40,6 +40,38 @@
/** A {@link org.apache.beam.sdk.io.Source} representing reading the results
of a query. */
class BigQueryStorageQuerySource<T> extends BigQueryStorageSourceBase<T> {
+ public static <T> BigQueryStorageQuerySource<T> create(
+ String stepUuid,
+ ValueProvider<String> queryProvider,
+ Boolean flattenResults,
+ Boolean useLegacySql,
+ QueryPriority priority,
+ @Nullable String location,
+ @Nullable String queryTempDataset,
+ @Nullable String queryTempProject,
+ @Nullable String kmsKey,
+ @Nullable DataFormat format,
+ SerializableFunction<SchemaAndRecord, T> parseFn,
+ Coder<T> outputCoder,
+ BigQueryServices bqServices,
+ @Nullable TimestampPrecision picosTimestampPrecision) {
Review Comment:
Initial thoughts are:
1. In BigQueryStorageQuerySource.java I think the current naming
(picosTimestampPrecision) is correct since it sets the corresponding field in
the read session. There is no equivalent for regular timestamp columns, they
are always read at microseconds and it cannot be controlled.
2. It could be feasible to add maxTimestampPrecision as the setting in
BigQueryIO as a way to control what java type is used for timestamps in
general. E.g. LogicalTypes.Timestamp.<MILLIS,MICROS,NANOS>. Is that what you
are thinking?
Will merge for now and we can discuss offline/ change this before release.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]