[ 
https://issues.apache.org/jira/browse/BEAM-11643?focusedWorklogId=540493&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-540493
 ]

ASF GitHub Bot logged work on BEAM-11643:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/Jan/21 10:17
            Start Date: 23/Jan/21 10:17
    Worklog Time Spent: 10m 
      Work Description: nielm commented on a change in pull request #13762:
URL: https://github.com/apache/beam/pull/13762#discussion_r563065643



##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/MutationSizeEstimator.java
##########
@@ -153,6 +161,21 @@ private static long estimateArrayValue(Value v) {
         return 12L * v.getDateArray().size();
       case TIMESTAMP:
         return 12L * v.getTimestampArray().size();
+      case NUMERIC:
+        totalLength = 0;
+        for (BigDecimal n : v.getNumericArray()) {
+          if (n == null) {

Review comment:
       Yes:
   The feature to support writing NUMERIC in BEAM was added in #12818  
(BEAM-10875), but missed adding support for using java BigDecimal type support 
to the part of the code where the size of mutated values are calculated.
   This PR fixes that.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 540493)
    Time Spent: 40m  (was: 0.5h)

> SpannerIO does not support using BigDecimal for Numeric fields
> --------------------------------------------------------------
>
>                 Key: BEAM-11643
>                 URL: https://issues.apache.org/jira/browse/BEAM-11643
>             Project: Beam
>          Issue Type: Bug
>          Components: io-java-gcp
>    Affects Versions: 2.27.0
>            Reporter: Niel Markwick
>            Assignee: Niel Markwick
>            Priority: P2
>             Fix For: 2.28.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Since NUMERIC types were added to Spanner, it has been possible to assign a 
> Java BigDecimal to a column in a Spanner mutation.
> The feature to support NUMERIC in BEAM was added in 
> [PR#12818|https://github.com/apache/beam/pull/12818]  (BEAM-10875), but 
> missed adding BigDecimal support to the part of the code where the size of 
> mutated values are calculated.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to