APISonar


org.apache.calcite.sql.type.SqlTypeName.TIME

> org > apache > calcite > sql > type > SqlTypeName > TIME
org APIs apache APIs calcite APIs sql APIs type APIs SqlTypeName APIs TIME APIs

Example 1
@Test public void testTime() {
    SqlTypeName tn =
        SqlTypeName.getNameForJdbcType(Types.TIME);
    assertEquals(
        "TIME did not map to TIME",
        SqlTypeName.TIME,
        tn);
  }
Example 2
public RexLiteral makeTimeLiteral(TimeString time, int precision) {
    return makeLiteral(Objects.requireNonNull(time),
        typeFactory.createSqlType(SqlTypeName.TIME, precision),
        SqlTypeName.TIME);
  }
Example 3
public void test() {
    List<BeamSqlExpression> operands = new ArrayList<>();
    assertEquals(SqlTypeName.TIME,
        new BeamSqlCurrentTimeExpression(operands).evaluate(row, null).getOutputType());
  }
Example 4
private SqlTypeName stripLocalTimeZoneDef(SqlTypeName typeName) {
    switch (typeName) {
    case TIME_WITH_LOCAL_TIME_ZONE:
      return SqlTypeName.TIME;
    case TIMESTAMP_WITH_LOCAL_TIME_ZONE:
      return SqlTypeName.TIMESTAMP;
    default:
      throw new AssertionError(typeName);
    }
  }
Example 5
@Test public void testNewInstanceProperties() {
    Set<SqlTypeName> from = ImmutableSet.of(SqlTypeName.FLOAT, SqlTypeName.TIME);
    SqlTypeName to = SqlTypeName.BOOLEAN;
    Function<BeamSqlPrimitive, BeamSqlPrimitive> mockConversionFunction = mock(Function.class);

    ReinterpretConversion conversion = ReinterpretConversion.builder()
        .from(from)
        .to(to)
        .convert(mockConversionFunction)
        .build();

    assertEquals(from, conversion.from());
    assertEquals(to, conversion.to());
  }
Example 6
SqlTimeLiteral(TimeString t, int precision, boolean hasTimeZone,
      SqlParserPos pos) {
    super(t, hasTimeZone, SqlTypeName.TIME, precision, pos);
    Preconditions.checkArgument(this.precision >= 0);
  }