@Test
  public void testPatternShort() {
    final String[] patterns = {"MM:dd:ss", "HH:mm"};

    final TimestampParser tsp = new TimestampParser(patterns);

    Assert.assertEquals(Timestamp.valueOf("1970-01-01 05:06:00"),
        tsp.parseTimestamp("05:06"));

    Assert.assertEquals(Timestamp.valueOf("1970-05-06 00:00:07"),
        tsp.parseTimestamp("05:06:07"));

    Assert.assertEquals(Timestamp.valueOf("1945-12-31 23:59:59"),
        tsp.parseTimestamp("1945-12-31T23:59:59"));
  }
Test for pattern that does not contain all date fields.
common/src/test/org/apache/hive/common/util/TestTimestampParser.java