本文整理汇总了Java中org.apache.orc.TypeDescription.fromString方法的典型用法代码示例。如果您正苦于以下问题:Java TypeDescription.fromString方法的具体用法?Java TypeDescription.fromString怎么用?Java TypeDescription.fromString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.orc.TypeDescription
的用法示例。
在下文中一共展示了TypeDescription.fromString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readObject
import org.apache.orc.TypeDescription; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
batchSize = in.readInt();
org.apache.hadoop.conf.Configuration configuration = new org.apache.hadoop.conf.Configuration();
configuration.readFields(in);
if (this.conf == null) {
this.conf = configuration;
}
this.schema = TypeDescription.fromString(in.readUTF());
this.selectedFields = new int[in.readInt()];
for (int i = 0; i < selectedFields.length; i++) {
this.selectedFields[i] = in.readInt();
}
this.conjunctPredicates = new ArrayList<>();
int numPreds = in.readInt();
for (int i = 0; i < numPreds; i++) {
conjunctPredicates.add((Predicate) in.readObject());
}
}
示例2: setSchemas
import org.apache.orc.TypeDescription; //导入方法依赖的package包/类
/**
* This method is used for fetching all ORC schemas from config
*
* @param config
*/
private void setSchemas(SecorConfig config) {
Map<String, String> schemaPerTopic = config.getORCMessageSchema();
for (Entry<String, String> entry : schemaPerTopic.entrySet()) {
String topic = entry.getKey();
TypeDescription schema = TypeDescription.fromString(entry
.getValue());
topicToSchemaMap.put(topic, schema);
// If common schema is given
if ("*".equals(topic)) {
schemaForAlltopic = schema;
}
}
}
示例3: forOrcSchema
import org.apache.orc.TypeDescription; //导入方法依赖的package包/类
/**
* Sets the ORC schema of the files to read as a String.
*
* @param orcSchema The ORC schema of the files to read as a String.
* @return The builder.
*/
public Builder forOrcSchema(String orcSchema) {
Preconditions.checkNotNull(orcSchema, "ORC schema must not be null.");
this.schema = TypeDescription.fromString(orcSchema);
return this;
}
示例4: OrcRowInputFormat
import org.apache.orc.TypeDescription; //导入方法依赖的package包/类
/**
* Creates an OrcRowInputFormat.
*
* @param path The path to read ORC files from.
* @param schemaString The schema of the ORC files as String.
* @param orcConfig The configuration to read the ORC files with.
*/
public OrcRowInputFormat(String path, String schemaString, Configuration orcConfig) {
this(path, TypeDescription.fromString(schemaString), orcConfig, DEFAULT_BATCH_SIZE);
}