com.netflix.metacat.common.type.Type.getDisplayName()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(100)

本文整理了Java中com.netflix.metacat.common.type.Type.getDisplayName()方法的一些代码示例,展示了Type.getDisplayName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Type.getDisplayName()方法的具体详情如下:
包路径:com.netflix.metacat.common.type.Type
类名称:Type
方法名:getDisplayName

Type.getDisplayName介绍

[英]get display name.
[中]获取显示名称。

代码示例

代码示例来源:origin: Netflix/metacat

/**
 * {@inheritDoc}
 */
@Override
public String getDisplayName() {
  return "map<" + keyType.getDisplayName()
    + ", " + valueType.getDisplayName() + ">";
}

代码示例来源:origin: com.netflix.metacat/metacat-common

/**
 * {@inheritDoc}
 */
@Override
public String getDisplayName() {
  return "map<" + keyType.getDisplayName()
    + ", " + valueType.getDisplayName() + ">";
}

代码示例来源:origin: Netflix/metacat

/**
   * {@inheritDoc}
   */
  @Override
  public String fromMetacatType(@Nonnull @NonNull final Type type) {
    return type.getDisplayName();
  }
}

代码示例来源:origin: com.netflix.metacat/metacat-common-server

private void writeObject(final ObjectOutputStream oos)
  throws IOException {
  oos.defaultWriteObject();
  oos.writeObject(type == null ? null : type.getDisplayName());
}

代码示例来源:origin: Netflix/metacat

private void writeObject(final ObjectOutputStream oos)
  throws IOException {
  oos.defaultWriteObject();
  oos.writeObject(type == null ? null : type.getDisplayName());
}

代码示例来源:origin: com.netflix.metacat/metacat-common-server

/**
   * {@inheritDoc}
   */
  @Override
  public String fromMetacatType(@Nonnull @NonNull final Type type) {
    return type.getDisplayName();
  }
}

代码示例来源:origin: Netflix/metacat

private String toTypeString(final Type type) {
  String result = null;
  if (isUsePigTypes) {
    result = pigTypeConverter.fromMetacatType(type);
  } else {
    result = type.getDisplayName();
  }
  return result;
}

代码示例来源:origin: Netflix/metacat

/**
 * {@inheritDoc}.
 */
@Override
public String fromMetacatType(@Nonnull @NonNull final Type type) {
  final Schema schema = new Schema(Util.translateFieldSchema(fromCanonicalTypeToPigSchema(null, type)));
  final StringBuilder result = new StringBuilder();
  try {
    Schema.stringifySchema(result, schema, DataType.GENERIC_WRITABLECOMPARABLE, Integer.MIN_VALUE);
  } catch (FrontendException e) {
    throw new IllegalArgumentException(String.format("Invalid for Pig converter: '%s'", type.getDisplayName()));
  }
  return result.toString();
}

代码示例来源:origin: Netflix/metacat

@Override
public String fromMetacatType(final Type type) {
  if (HiveTypeMapping.getCANONICAL_TO_HIVE().containsKey(type)) {
    return HiveTypeMapping.getCANONICAL_TO_HIVE().get(type);
  }
  if (type instanceof DecimalType | type instanceof CharType | type instanceof VarcharType) {
    return type.getDisplayName();
  } else if (type.getTypeSignature().getBase().equals(TypeEnum.MAP)) {
    final MapType mapType = (MapType) type;
    return "map<" + fromMetacatType(mapType.getKeyType())
      + "," + fromMetacatType(mapType.getValueType()) + ">";
  } else if (type.getTypeSignature().getBase().equals(TypeEnum.ROW)) {
    final RowType rowType = (RowType) type;
    final String typeString = rowType.getFields()
      .stream()
      .map(this::rowFieldToString)
      .collect(Collectors.joining(","));
    return "struct<" + typeString + ">";
  } else if (type.getTypeSignature().getBase().equals(TypeEnum.ARRAY)) {
    final String typeString = ((ParametricType) type).getParameters().stream().map(this::fromMetacatType)
      .collect(Collectors.joining(","));
    return "array<" + typeString + ">";
  }
  return null;
}

代码示例来源:origin: com.netflix.metacat/metacat-connector-hive

@Override
public String fromMetacatType(final Type type) {
  if (HiveTypeMapping.getCANONICAL_TO_HIVE().containsKey(type)) {
    return HiveTypeMapping.getCANONICAL_TO_HIVE().get(type);
  }
  if (type instanceof DecimalType | type instanceof CharType | type instanceof VarcharType) {
    return type.getDisplayName();
  } else if (type.getTypeSignature().getBase().equals(TypeEnum.MAP)) {
    final MapType mapType = (MapType) type;
    return "map<" + fromMetacatType(mapType.getKeyType())
      + "," + fromMetacatType(mapType.getValueType()) + ">";
  } else if (type.getTypeSignature().getBase().equals(TypeEnum.ROW)) {
    final RowType rowType = (RowType) type;
    final String typeString = rowType.getFields()
      .stream()
      .map(this::rowFieldToString)
      .collect(Collectors.joining(","));
    return "struct<" + typeString + ">";
  } else if (type.getTypeSignature().getBase().equals(TypeEnum.ARRAY)) {
    final String typeString = ((ParametricType) type).getParameters().stream().map(this::fromMetacatType)
      .collect(Collectors.joining(","));
    return "array<" + typeString + ">";
  }
  return null;
}

代码示例来源:origin: Netflix/metacat

canonicalType.getDisplayName()));

相关文章

微信公众号

最新文章

更多