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

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • v1.4.0
    • v1.3.0, v1.4.0, v1.5.0
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: