APISonar


org.apache.drill.common.types.TypeProtos.MinorType.DATE

> org > apache > drill > common > types > TypeProtos > MinorType > DATE
org APIs apache APIs drill APIs common APIs types APIs TypeProtos APIs MinorType APIs DATE APIs

Example 1
public void testFormatValueVectorElementDateValidPattern() {
    when(options.getString(ExecConstants.WEB_DISPLAY_FORMAT_DATE)).thenReturn("EEE, MMM d, yyyy");
    ValueVectorElementFormatter formatter = new ValueVectorElementFormatter(options);
    String formattedValue = formatter.format(
        LocalDate.of(2012, 11, 5),
        TypeProtos.MinorType.DATE);
    assertEquals("Mon, Nov 5, 2012", formattedValue);
  }
Example 2
public void testTimeTypes() throws Exception {
    TupleMetadata schema = new SchemaBuilder()
      .addNullable("time_col", TypeProtos.MinorType.TIME)
      .addNullable("time_prec_col", TypeProtos.MinorType.TIME, 3)
      .add("date_col", TypeProtos.MinorType.DATE)
      .addNullable("timestamp_col", TypeProtos.MinorType.TIMESTAMP)
      .addNullable("timestamp_prec_col", TypeProtos.MinorType.TIMESTAMP, 3)
      .buildSchema();

    checkSchema("time_col time, time_prec_col time(3), date_col date not null, " +
        "timestamp_col timestamp, timestamp_prec_col timestamp(3)", schema);
  }