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
[BEAM-13990] support date and timestamp fields #17404
Conversation
@liu-du I copied your PR and made some changes to integrate it with recent changes - hope that's ok! |
R: @liu-du |
Codecov Report
@@ Coverage Diff @@
## master #17404 +/- ##
=======================================
Coverage 73.85% 73.85%
=======================================
Files 690 690
Lines 90843 90843
=======================================
+ Hits 67092 67095 +3
+ Misses 22538 22535 -3
Partials 1213 1213
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Run Java PreCommit |
Run Python PreCommit |
R: @yirutang |
friendly ping! |
@chamikaramj @yirutang - Could you please review this PR? |
@@ -523,14 +523,6 @@ public void testTimePartitioning() throws Exception { | |||
testTimePartitioning(method); | |||
} | |||
|
|||
@Test | |||
public void testTimePartitioningStorageApi() throws Exception { |
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.
Why remove this?
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.
AFAICT is was just duplicating the above test
@@ -84,10 +143,10 @@ public static class SchemaDoesntMatchException extends SchemaConversionException | |||
.put("NUMERIC", Type.TYPE_STRING) // Pass through the JSON encoding. | |||
.put("BIGNUMERIC", Type.TYPE_STRING) // Pass through the JSON encoding. | |||
.put("GEOGRAPHY", Type.TYPE_STRING) // Pass through the JSON encoding. | |||
.put("DATE", Type.TYPE_STRING) // Pass through the JSON encoding. | |||
.put("DATE", Type.TYPE_INT32) | |||
.put("TIME", Type.TYPE_STRING) // Pass through the JSON encoding. | |||
.put("DATETIME", Type.TYPE_STRING) // Pass through the JSON encoding. |
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.
TIME and DATETIME can be Int64 so that the encoding size is smaller. Shouldn't block this PR:
https://github.com/googleapis/java-bigquerystorage/blob/main/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/JsonToProtoMessage.java#L334
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.
done
if (value instanceof String) { | ||
return value; | ||
} else if (value instanceof BigDecimal) { | ||
return ((BigDecimal) value).toPlainString(); |
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.
We do provide encoding here:
https://github.com/googleapis/java-bigquerystorage/blob/main/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BigDecimalByteStringEncoder.java
So that they can be pass in more efficiently. Not blocking this PR.
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.
done
.set("timeValue", LocalTime.parse("00:52:07.123456")) | ||
.set("datetimeValue", LocalDateTime.parse("2019-08-16T00:52:07.123456")) | ||
.set("dateValue", LocalDate.parse("2019-08-16")) | ||
.set("numericValue", new BigDecimal("23.4")) |
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.
bignumeric test?
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.
int and double timestamp value test?
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.
added
@yirutang comments addressed |
8195ce6
to
2774b8a
Compare
.put("timestampvalue", 43L) | ||
.put("timevalue", "00:52:07.123456") | ||
.put("datetimevalue", "2019-08-16T00:52:07.123456") | ||
.put("datevalue", (int) LocalDate.parse("2019-08-16").toEpochDay()) | ||
.put("numericvalue", "23.4") |
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.
Could we test repeated byte string? I always had some problems with it.
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.
@yirutang added extra test
Run GoPortable PreCommit |
Sorry for the delay, will try to get to it today.
…On Thu, Apr 28, 2022 at 10:47 AM Ahmet Altay ***@***.***> wrote:
@chamikaramj <https://github.com/chamikaramj> @yirutang
<https://github.com/yirutang> - Could you please review this PR?
—
Reply to this email directly, view it on GitHub
<#17404 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHGYVEUWXOABSWB6TZZH27TVHLFLRANCNFSM5T22M6VA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Thanks.
Yiru
|
No description provided.