APISonar


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

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

Example 1
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);
  }
Example 2
public void testFormatValueVectorElementTimeEmptyPattern() {
    when(options.getString(ExecConstants.WEB_DISPLAY_FORMAT_TIME)).thenReturn("");
    ValueVectorElementFormatter formatter = new ValueVectorElementFormatter(options);
    String formattedValue = formatter.format(
        LocalTime.of(13, 0, 30, 120000000),
        TypeProtos.MinorType.TIME);
    assertEquals("13:00:30.120", formattedValue);
  }
Example 3
public void testTimeStampAndTime() {
    final List<TypeProtos.MinorType> inputTypes = Lists.newArrayList();
    inputTypes.add(TypeProtos.MinorType.TIME);
    inputTypes.add(TypeProtos.MinorType.TIMESTAMP);
    final TypeProtos.MinorType result = TypeCastRules.getLeastRestrictiveType(inputTypes);

    assertEquals(result, TypeProtos.MinorType.TIME);
  }