Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-13269

Data exceeds database column capacity error while inserting in fixed length string column

Details

    • Bug
    • Status: Resolved
    • P1
    • Resolution: Fixed
    • 2.33.0
    • 2.35.0
    • io-java-jdbc
    • None

    Description

       

      The bug in org.apache.beam.sdk.io.jdbc.JdbcUtil#validateLogicalTypeLength

      if (length >= maxLimit) {
        throw new RuntimeException(
            String.format(
                "Length of Schema.Field[%s] data exceeds database column capacity",
                field.getName()));
      }

      Should be

      if (length > maxLimit) { 

      How to reproduce:

      • Create column with type VARCHAR(4).
      • Try to insert "Test"

      ER: Success

      AR: Error "Length of Schema.Field[%s] data exceeds database column capacity"

      Attachments

        Issue Links

          Activity

            People

              Vitaly Ivanov Vitaly Ivanov
              Vitaly Ivanov Vitaly Ivanov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m