org.apache.pig.impl.util.Utils.parseSchema()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(71)

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

Utils.parseSchema介绍

暂无

代码示例

代码示例来源:origin: org.apache.pig/pig

public JsonLoader(String schemaString) throws IOException {
  schema = new ResourceSchema(Utils.parseSchema(schemaString));
}

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

/**
 * Converts to presto type.
 * @param pigType pig type
 * @param typeManager type manager
 * @return presto type
 */
public Type toType(final String pigType, final TypeManager typeManager) {
  try {
    final LogicalSchema schema = Utils.parseSchema(pigType);
    final LogicalSchema.LogicalFieldSchema field = schema.getField(0);
    return toPrestoType(field);
  } catch (Exception e) {
    LOG.warn("Pig Parsing failed for signature {}", pigType, e);
    throw new IllegalArgumentException(String.format("Bad type signature: '%s'", pigType));
  }
}

代码示例来源:origin: org.apache.pig/pig

/**
 * @param schemaString a String representation of the Schema <b>without</b>
 *                     any enclosing curly-braces.<b>Not</b> for use with
 *                     <code>Schema#toString</code>
 * @return Schema instance
 * @throws ParserException
 */
public static Schema getSchemaFromString(String schemaString) throws ParserException {
  LogicalSchema schema = parseSchema(schemaString);
  Schema result = org.apache.pig.newplan.logical.Util.translateSchema(schema);
  Schema.setSchemaDefaultType(result, DataType.BYTEARRAY);
  return result;
}

相关文章

微信公众号

最新文章

更多