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.