Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-1220

NullPointerException in PArrayDataType.toObject() when baseType is CHAR or BINARY

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Not A Problem
    • None
    • None
    • None
    • None

    Description

      We now assume that for PDataType, if isFixedLength() returns true, we can use getByteSize() to get the byte array length of this type. But with BINARY and CHAR types, isFixedLength() returns true while getByteSize() returns null, and that's why we would get an NPE if we write code like:

      PArrayDataType.createPhoenixArray()
              if (!baseDataType.isFixedWidth()) {
                  ...
              } else {
                  int elemLength = (maxLength == null ? baseDataType.getByteSize() : maxLength);
                  ...
              }
      

      There are more than one occurrences of such code besides this one.

      Attachments

        Activity

          People

            Unassigned Unassigned
            maryannxue Wei Xue
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified