Search in sources :

Example 1 with UDFWeekOfYear

use of org.apache.hadoop.hive.ql.udf.UDFWeekOfYear in project hive by apache.

the class TestVectorDateExpressions method compareToUDFWeekOfYearDate.

private void compareToUDFWeekOfYearDate(long t, int y) {
    UDFWeekOfYear udf = new UDFWeekOfYear();
    TimestampWritable tsw = toTimestampWritable(t);
    IntWritable res = udf.evaluate(tsw);
    Assert.assertEquals(res.get(), y);
}
Also used : UDFWeekOfYear(org.apache.hadoop.hive.ql.udf.UDFWeekOfYear) TimestampWritable(org.apache.hadoop.hive.serde2.io.TimestampWritable) IntWritable(org.apache.hadoop.io.IntWritable)

Example 2 with UDFWeekOfYear

use of org.apache.hadoop.hive.ql.udf.UDFWeekOfYear in project hive by apache.

the class TestVectorTimestampExpressions method compareToUDFWeekOfYearLong.

private void compareToUDFWeekOfYearLong(Timestamp t, int y) {
    UDFWeekOfYear udf = new UDFWeekOfYear();
    TimestampWritable tsw = new TimestampWritable(t);
    IntWritable res = udf.evaluate(tsw);
    Assert.assertEquals(res.get(), y);
}
Also used : UDFWeekOfYear(org.apache.hadoop.hive.ql.udf.UDFWeekOfYear) TimestampWritable(org.apache.hadoop.hive.serde2.io.TimestampWritable) IntWritable(org.apache.hadoop.io.IntWritable)

Aggregations

UDFWeekOfYear (org.apache.hadoop.hive.ql.udf.UDFWeekOfYear)2 TimestampWritable (org.apache.hadoop.hive.serde2.io.TimestampWritable)2 IntWritable (org.apache.hadoop.io.IntWritable)2