Github user jinfengni commented on a diff in the pull request:

    https://github.com/apache/drill/pull/546#discussion_r71630181
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/flatten/FlattenRecordBatch.java
 ---
    @@ -129,11 +129,21 @@ private void setFlattenVector() {
         try {
           final TypedFieldId typedFieldId = 
incoming.getValueVectorId(popConfig.getColumn());
           final MaterializedField field = 
incoming.getSchema().getColumn(typedFieldId.getFieldIds()[0]);
    -      final RepeatedValueVector vector = 
RepeatedValueVector.class.cast(incoming.getValueAccessorById(
    -          field.getValueClass(), 
typedFieldId.getFieldIds()).getValueVector());
    +      RepeatedValueVector vector = null;
    +      try {
    +        vector = 
RepeatedValueVector.class.cast(incoming.getValueAccessorById(
    +            field.getValueClass(), 
typedFieldId.getFieldIds()).getValueVector());
    +      } catch(ClassCastException ex) {
    --- End diff --
    
    In stead of catch ClassCastException, you may check if the input value 
vector is an instance of RepeatedValueVector.  Using try{} catch{} seems a bit 
over-kill for this case. 



---
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.
---

Reply via email to