Details
-
Improvement
-
Status: Patch Available
-
Trivial
-
Resolution: Unresolved
-
3.1.2
-
None
-
None
Description
case STRING: case CHAR: case VARCHAR: { BytesColumnVector bcv = (BytesColumnVector) cols[colIndex]; String sVal = value.toString(); if (sVal == null) { bcv.noNulls = false; bcv.isNull[0] = true; bcv.isRepeating = true; } else { bcv.fill(sVal.getBytes()); } } break;
The above code snippet seems assuming that sVal can be null, but didn't handle the case where value is null. However, if value is not null, it's unlikely that value.toString() returns null.
We treat partition column value for default partition of string types as null, not as "_HIVE_DEFAULT_PARTITION_", which Hive assumes. Thus, we actually hit the problem that sVal is null.
I propose a harmless fix, as shown in the attached patch.