title: Getting org.apache.hadoop.hive.ql.exec.vector.DecimalColumnVector cannot be cast to org.apache.hadoop.hive.ql.exec.vector.LongColumnVector
body: <pre><code>// column: bigint
            if (getTypes(column, struct).equalsIgnoreCase(&quot;bigint&quot;)) {
              if (!lineArray[column].isEmpty()) {
                  try {
                      ((LongColumnVector) batch.cols[column]).vector[row] = Long.parseLong(lineArray[column]);
                  } catch (NumberFormatException e) {
                      HiveDecimal hiveDecimal = HiveDecimal.create(lineArray[column]);
                      batch.cols[column]=new DecimalColumnVector(lineArray[column].length(), 0);
                      ((DecimalColumnVector) batch.cols[column]).vector[row] = (new HiveDecimalWritable(hiveDecimal));
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
                  } else {
                         ((LongColumnVector) batch.cols[column]).noNulls = false;
                         ((LongColumnVector) batch.cols[column]).isNull[row] = true;
                         ((LongColumnVector) batch.cols[column]).vector[row] = LongColumnVector.NULL_VALUE;
                         // ((CustomLongColumnVector) batch.cols[column]).fillWithNulls();
                  }
  
            }
  </code></pre>
  <p>I am trying to execute the above code snippet . <code>lineArray</code> is a String Array. But it is failing with <code>java.lang.ClassCastException: org.apache.hadoop.hive.ql.exec.vector.DecimalColumnVector cannot be cast to org.apache.hadoop.hive.ql.exec.vector.LongColumnVector</code>. Please help.</p>