Beispiel #1
0
  @Inject
  public TypeRegistry(Set<Type> types) {
    requireNonNull(types, "types is null");

    // Manually register UNKNOWN type without a verifyTypeClass call since it is a special type that
    // can not be used by functions
    this.types.put(UNKNOWN.getTypeSignature(), UNKNOWN);

    // always add the built-in types; Presto will not function without these
    addType(BOOLEAN);
    addType(BIGINT);
    addType(DOUBLE);
    addType(VARCHAR);
    addType(VARBINARY);
    addType(DATE);
    addType(TIME);
    addType(TIME_WITH_TIME_ZONE);
    addType(TIMESTAMP);
    addType(TIMESTAMP_WITH_TIME_ZONE);
    addType(INTERVAL_YEAR_MONTH);
    addType(INTERVAL_DAY_TIME);
    addType(HYPER_LOG_LOG);
    addType(P4_HYPER_LOG_LOG);
    addType(REGEXP);
    addType(LIKE_PATTERN);
    addType(JSON_PATH);
    addType(COLOR);
    addType(JSON);
    addParametricType(ROW);
    addParametricType(ARRAY);
    addParametricType(MAP);
    addParametricType(FUNCTION);

    for (Type type : types) {
      addType(type);
    }
  }