Uploaded image for project: 'Kylin'
  1. Kylin
  2. KYLIN-1396

minor bug in BigDecimalSerializer - avoidVerbose should be incremented each time when input scale is larger than given scale

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: v1.4.0
    • Fix Version/s: v1.3.0, v1.4.0, v1.5.0
    • Component/s: None
    • Labels:
      None

      Description

      avoidVerbose is used for suppressing the warning message, but it should be incremented each time when input scale is larger than given scale

      public void serialize(BigDecimal value, ByteBuffer out) {
      if (value.scale() > type.getScale()) {
      if (avoidVerbose++ % 10000 == 0)

      { logger.warn("value's scale has exceeded the " + type.getScale() + ", cut it off, to ensure encoded value do not exceed maxLength " + maxLength + " times:" + (avoidVerbose)); }

      value = value.setScale(type.getScale(), BigDecimal.ROUND_HALF_EVEN);
      }

        Attachments

          Activity

            People

            • Assignee:
              yonzhang2012 Edward Zhang
              Reporter:
              yonzhang2012 Edward Zhang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: