@Override
  public int[] transformToIntValuesSV(ValueBlock valueBlock) {
    int numDocs = valueBlock.getNumDocs();
    initIntValuesSV(numDocs);
    long[] timestamps = _mainTransformFunction.transformToLongValuesSV(valueBlock);
    IntStream.range(0, numDocs).forEach(i -> _intValuesSV[i] = DateTimeUtils.extract(_field, timestamps[i]));
    return _intValuesSV;
  }
@Test(dataProvider = "testCases")
  public void testExtractTransformFunction(String field, LongToIntFunction expected) {
    // NOTE: functionality of ExtractTransformFunction is covered in ExtractTransformFunctionTest
    // SELECT EXTRACT(YEAR FROM '2017-10-10')

    ExpressionContext expression =
        RequestContextUtils.getExpression(String.format("extract(%s FROM %s)", field, TIMESTAMP_COLUMN));

    TransformFunction transformFunction = TransformFunctionFactory.get(expression, _dataSourceMap);
    Assert.assertTrue(transformFunction instanceof ExtractTransformFunction);
    int[] value = transformFunction.transformToIntValuesSV(_projectionBlock);
    for (int i = 0; i < _projectionBlock.getNumDocs(); i++) {
      assertEquals(value[i], expected.applyAsInt(_timeValues[i]));
    }
  }