@Test
  // Load a BytesColumnVector by copying in large data, enough to force
  // the buffer to expand.
  public void testLoadBytesColumnVectorByValueLargeData()  {
    BytesColumnVector bcv = new BytesColumnVector(VectorizedRowBatch.DEFAULT_SIZE);
    bcv.initBuffer(10); // initialize with estimated element size 10
    // Record initial buffer size
    int initialBufferSize = bcv.bufferSize();
    String s = "0123456789";
    while (s.length() < 500) {
      s += s;
    }
    byte[] b = s.getBytes(StandardCharsets.UTF_8);

    for (int i = 0; i != VectorizedRowBatch.DEFAULT_SIZE; i++) {
      bcv.setVal(i, b, 0, b.length);
    }
    // Current buffer size should be larger than initial size
    Assert.assertTrue(bcv.bufferSize() > initialBufferSize);
  }
Test vectorized expression and filter evaluation for strings.
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorStringExpressions.java