gpt4 book ai didi

org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableStringObjectInspector类的使用及代码示例

转载 作者:知者 更新时间:2024-03-27 16:09:05 27 4
gpt4 key购买 nike

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

WritableStringObjectInspector介绍

[英]A WritableStringObjectInspector inspects a Text Object.
[中]WritableStringObjectInspector检查文本对象。

代码示例

代码示例来源:origin: apache/hive

private static SampleRec deserializeInner(Object row, StructObjectInspector inspector) {
 List<? extends StructField> fields = inspector.getAllStructFieldRefs();
 WritableStringObjectInspector f0ins = (WritableStringObjectInspector) fields.get(0).getFieldObjectInspector();
 WritableIntObjectInspector f1ins = (WritableIntObjectInspector) fields.get(1).getFieldObjectInspector();
 WritableStringObjectInspector f2ins = (WritableStringObjectInspector) fields.get(2).getFieldObjectInspector();
 String f0 = f0ins.getPrimitiveJavaObject(inspector.getStructFieldData(row, fields.get(0)));
 int f1 = f1ins.get(inspector.getStructFieldData(row, fields.get(1)));
 String f2 = f2ins.getPrimitiveJavaObject(inspector.getStructFieldData(row, fields.get(2)));
 return new SampleRec(f0, f1, f2);
}

代码示例来源:origin: apache/drill

t = new Text((String) value);
} else {
 t = ((WritableStringObjectInspector) outputOI).getPrimitiveWritableObject(value);

代码示例来源:origin: apache/hive

return writableOI.create((String) object);
} else {
 return writableOI.copyObject(object);

代码示例来源:origin: com.facebook.presto.hive/hive-apache

StringExtractorByValue(int columnIndex) {
 super(columnIndex);
 object = PrimitiveObjectInspectorFactory.writableStringObjectInspector.create(StringUtils.EMPTY);
 text = new Text();
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

@Override
 Object extract(int batchIndex) {
  int adjustedIndex = (colVector.isRepeating ? 0 : batchIndex);
  if (colVector.noNulls || !colVector.isNull[adjustedIndex]) {
   byte[] value = colVector.vector[adjustedIndex];
   int start = colVector.start[adjustedIndex];
   int length = colVector.length[adjustedIndex];
   // Use org.apache.hadoop.io.Text as our helper to go from byte[] to String.
   text.set(value, start, length);
   PrimitiveObjectInspectorFactory.writableStringObjectInspector.set(object, text);
   return object;
  } else {
   return null;
  }
 }
}

代码示例来源:origin: apache/hive

private static SampleRec deserializeInner(Object row, StructObjectInspector inspector) {
 List<? extends StructField> fields = inspector.getAllStructFieldRefs();
 WritableStringObjectInspector f0ins = (WritableStringObjectInspector) fields.get(0).getFieldObjectInspector();
 WritableIntObjectInspector f1ins = (WritableIntObjectInspector) fields.get(1).getFieldObjectInspector();
 WritableStringObjectInspector f2ins = (WritableStringObjectInspector) fields.get(2).getFieldObjectInspector();
 String f0 = f0ins.getPrimitiveJavaObject(inspector.getStructFieldData(row, fields.get(0)));
 int f1 = f1ins.get(inspector.getStructFieldData(row, fields.get(1)));
 String f2 = f2ins.getPrimitiveJavaObject(inspector.getStructFieldData(row, fields.get(2)));
 return new SampleRec(f0, f1, f2);
}

代码示例来源:origin: apache/hive

WritableStringObjectInspector woi = (WritableStringObjectInspector) oi;
 return JavaDataModel.get().lengthForStringOfLength(
   woi.getPrimitiveWritableObject(value).getLength());
} else if (oi instanceof WritableBinaryObjectInspector) {
 WritableBinaryObjectInspector woi = (WritableBinaryObjectInspector) oi;

代码示例来源:origin: apache/hive

return object;
} else {
 return ((WritableStringObjectInspector) objectInspector).getPrimitiveJavaObject(object);

代码示例来源:origin: apache/drill

WritableStringObjectInspector woi = (WritableStringObjectInspector) oi;
 return JavaDataModel.get().lengthForStringOfLength(
   woi.getPrimitiveWritableObject(value).getLength());
} else if (oi instanceof WritableBinaryObjectInspector) {
 WritableBinaryObjectInspector woi = (WritableBinaryObjectInspector) oi;

代码示例来源:origin: Quetzal-RDF/quetzal

postMethod.setParameter(inputColumns.get(i),
    PrimitiveObjectInspectorFactory.writableStringObjectInspector
        .getPrimitiveJavaObject(arg0[i]));

代码示例来源:origin: com.facebook.presto.hive/hive-apache

t = new Text((String) value);
} else {
 t = ((WritableStringObjectInspector) outputOI).getPrimitiveWritableObject(value);

代码示例来源:origin: org.apache.hivemall/hivemall-core

@Override
public void merge(@SuppressWarnings("deprecation") AggregationBuffer agg, Object partial)
    throws HiveException {
  if (partial == null) {
    return;
  }
  Object tpObj = internalMergeOI.getStructFieldData(partial, tpField);
  Object totalActualObj = internalMergeOI.getStructFieldData(partial, totalActualField);
  Object totalPredictedObj =
      internalMergeOI.getStructFieldData(partial, totalPredictedField);
  Object betaObj = internalMergeOI.getStructFieldData(partial, betaOptionField);
  Object averageObj = internalMergeOI.getStructFieldData(partial, averageOptionFiled);
  long tp = PrimitiveObjectInspectorFactory.writableLongObjectInspector.get(tpObj);
  long totalActual =
      PrimitiveObjectInspectorFactory.writableLongObjectInspector.get(totalActualObj);
  long totalPredicted = PrimitiveObjectInspectorFactory.writableLongObjectInspector.get(
    totalPredictedObj);
  double beta =
      PrimitiveObjectInspectorFactory.writableDoubleObjectInspector.get(betaObj);
  String average =
      PrimitiveObjectInspectorFactory.writableStringObjectInspector.getPrimitiveJavaObject(
        averageObj);
  FMeasureAggregationBuffer myAggr = (FMeasureAggregationBuffer) agg;
  myAggr.merge(tp, totalActual, totalPredicted, beta, average);
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

WritableStringObjectInspector woi = (WritableStringObjectInspector) oi;
 return JavaDataModel.get().lengthForStringOfLength(
   woi.getPrimitiveWritableObject(value).getLength());
} else if (oi instanceof WritableBinaryObjectInspector) {
 WritableBinaryObjectInspector woi = (WritableBinaryObjectInspector) oi;

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com