Github user jinfengni commented on a diff in the pull request:
https://github.com/apache/drill/pull/805#discussion_r117583114
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetGroupScan.java
---
@@ -508,21 +516,32 @@ public void populatePruningVector(ValueVector v, int
index, SchemaPath column, S
NullableVarBinaryVector varBinaryVector =
(NullableVarBinaryVector) v;
Object s = partitionValueMap.get(f).get(column);
byte[] bytes;
- if (s instanceof Binary) {
- bytes = ((Binary) s).getBytes();
- } else if (s instanceof String) {
- bytes = ((String) s).getBytes();
- } else if (s instanceof byte[]) {
- bytes = (byte[]) s;
+ if (s == null) {
+ varBinaryVector.getMutator().setNull(index);
+ return;
} else {
- throw new UnsupportedOperationException("Unable to create column
data for type: " + type);
+ bytes = getBytes(type, s);
}
varBinaryVector.getMutator().setSafe(index, bytes, 0,
bytes.length);
return;
}
case DECIMAL18: {
NullableDecimal18Vector decimalVector = (NullableDecimal18Vector)
v;
- Long value = (Long) partitionValueMap.get(f).get(column);
+ Object s = partitionValueMap.get(f).get(column);
+ byte[] bytes;
+ if (s == null) {
+ decimalVector.getMutator().setNull(index);
+ return;
+ } else if (s instanceof Integer) {
+ decimalVector.getMutator().setSafe(index, (Integer) s);
+ return;
+ } else if (s instanceof Long) {
+ decimalVector.getMutator().setSafe(index, (Long) s);
+ return;
+ } else {
+ bytes = getBytes(type, s);
--- End diff --
For DECIMAL18, under what kind scenarios, would we get a bytes from
partitionValueMap?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---