[
https://issues.apache.org/jira/browse/BEAM-4646?focusedWorklogId=116716&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-116716
]
ASF GitHub Bot logged work on BEAM-4646:
----------------------------------------
Author: ASF GitHub Bot
Created on: 28/Jun/18 01:27
Start Date: 28/Jun/18 01:27
Worklog Time Spent: 10m
Work Description: amaliujia commented on a change in pull request #5792:
[BEAM-4646][SQL] Improve BigQuery write integration test
URL: https://github.com/apache/beam/pull/5792#discussion_r198683425
##########
File path:
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryUtils.java
##########
@@ -172,18 +177,30 @@ public static TableRow toTableRow(Row row) {
Field schemaField = row.getSchema().getField(i);
TypeName type = schemaField.getType().getTypeName();
- if (TypeName.ARRAY == type) {
- type = schemaField.getType().getCollectionElementType().getTypeName();
- if (TypeName.ROW == type) {
- List<Row> rows = (List<Row>) value;
- List<TableRow> tableRows = new ArrayList<TableRow>(rows.size());
- for (int j = 0; j < rows.size(); j++) {
- tableRows.add(toTableRow(rows.get(j)));
+ switch (type) {
+ case ARRAY:
+ type =
schemaField.getType().getCollectionElementType().getTypeName();
+ if (TypeName.ROW == type) {
+ List<Row> rows = (List<Row>) value;
+ List<TableRow> tableRows = new ArrayList<TableRow>(rows.size());
+ for (int j = 0; j < rows.size(); j++) {
+ tableRows.add(toTableRow(rows.get(j)));
+ }
+ value = tableRows;
}
- value = tableRows;
- }
- } else if (TypeName.ROW == type) {
- value = toTableRow((Row) value);
+ break;
+ case ROW:
+ value = toTableRow((Row) value);
+ break;
+ case DATETIME:
+ DateTimeFormatter patternFormat = new DateTimeFormatterBuilder()
+ .appendPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZZ")
Review comment:
Changing to `yyyy-MM-dd'T'HH:mm:ss.SSSSSSZ`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 116716)
Time Spent: 3h (was: 2h 50m)
> Improve SQL's BigQuery write integration test
> ---------------------------------------------
>
> Key: BEAM-4646
> URL: https://issues.apache.org/jira/browse/BEAM-4646
> Project: Beam
> Issue Type: Improvement
> Components: dsl-sql
> Reporter: Rui Wang
> Assignee: Rui Wang
> Priority: Major
> Time Spent: 3h
> Remaining Estimate: 0h
>
> Right now SQL's BigQuery write integration test only tests VARCHAR, ARRAY and
> BIGINT, it might be better to test other SQL types which Beam SQL/Calcite is
> supporting.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)