Package org.apache.hadoop.hive.serde2.io

Examples of org.apache.hadoop.hive.serde2.io.TimestampWritable


      return result;
    }
  }

  private void compareToUDFUnixTimeStampDate(long t, long y) {
    TimestampWritable tsw = toTimestampWritable(t);
    LongWritable res = getLongWritable(tsw);
    if(res.get() != y) {
      System.out.printf("%d vs %d for %d, %d\n", res.get(), y, t,
              tsw.getTimestamp().getTime()/1000);
    }

    Assert.assertEquals(res.get(), y);
  }
View Full Code Here


    verifyUDFUnixTimeStamp(batch);
  }

  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);
  }
View Full Code Here

      ms -= 1000;
      ns += 1000*1000*1000;
    }
    Timestamp ts = new Timestamp(ms);
    ts.setNanos((int) ns);
    return new TimestampWritable(ts);
  }
View Full Code Here

    LONG2, STRING_LONG
  }

  private void compareToUDFYearLong(long t, int y) {
    UDFYear udf = new UDFYear();
    TimestampWritable tsw = toTimestampWritable(t);
    IntWritable res = udf.evaluate(tsw);
    Assert.assertEquals(res.get(), y);
  }
View Full Code Here

    Assert.assertEquals(true, lcv.isNull[0]);
  }

  private void compareToUDFDayOfMonthLong(long t, int y) {
    UDFDayOfMonth udf = new UDFDayOfMonth();
    TimestampWritable tsw = toTimestampWritable(t);
    IntWritable res = udf.evaluate(tsw);
    Assert.assertEquals(res.get(), y);
  }
View Full Code Here

    testVectorUDFDayOfMonth(TestType.STRING_LONG);
  }

  private void compareToUDFHourLong(long t, int y) {
    UDFHour udf = new UDFHour();
    TimestampWritable tsw = toTimestampWritable(t);
    IntWritable res = udf.evaluate(tsw);
    Assert.assertEquals(res.get(), y);
  }
View Full Code Here

    testVectorUDFHour(TestType.STRING_LONG);
  }

  private void compareToUDFMinuteLong(long t, int y) {
    UDFMinute udf = new UDFMinute();
    TimestampWritable tsw = toTimestampWritable(t);
    IntWritable res = udf.evaluate(tsw);
    Assert.assertEquals(res.get(), y);
  }
View Full Code Here

    testVectorUDFMinute(TestType.STRING_LONG);
  }

  private void compareToUDFMonthLong(long t, int y) {
    UDFMonth udf = new UDFMonth();
    TimestampWritable tsw = toTimestampWritable(t);
    IntWritable res = udf.evaluate(tsw);
    Assert.assertEquals(res.get(), y);
  }
View Full Code Here

    testVectorUDFMonth(TestType.STRING_LONG);
  }

  private void compareToUDFSecondLong(long t, int y) {
    UDFSecond udf = new UDFSecond();
    TimestampWritable tsw = toTimestampWritable(t);
    IntWritable res = udf.evaluate(tsw);
    Assert.assertEquals(res.get(), y);
  }
View Full Code Here

      return result;
    }
  }

  private void compareToUDFUnixTimeStampLong(long t, long y) {
    TimestampWritable tsw = toTimestampWritable(t);
    LongWritable res = getLongWritable(tsw);
    if(res.get() != y) {
      System.out.printf("%d vs %d for %d, %d\n", res.get(), y, t,
          tsw.getTimestamp().getTime()/1000);
    }

    Assert.assertEquals(res.get(), y);
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.serde2.io.TimestampWritable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.