parquet.io.api.Binary.fromString()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(122)

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

Binary.fromString介绍

暂无

代码示例

代码示例来源:origin: apache/incubator-gobblin

@Override
BinaryValue convertField(JsonElement value) {
 return new BinaryValue(Binary.fromString(value.getAsString()));
}

代码示例来源:origin: prestodb/presto

private static BinaryStatistics stringColumnStats(String minimum, String maximum)
{
  BinaryStatistics statistics = new BinaryStatistics();
  statistics.setMinMax(Binary.fromString(minimum), Binary.fromString(maximum));
  return statistics;
}

代码示例来源:origin: apache/incubator-gobblin

public void add(int fieldIndex, String value) {
 this.add(fieldIndex, new BinaryValue(Binary.fromString(value)));
}

代码示例来源:origin: prestodb/presto

case STRING:
  String v = ((StringObjectInspector) inspector).getPrimitiveJavaObject(value);
  recordConsumer.addBinary(Binary.fromString(v));
  break;
case CHAR:
  String vChar = ((HiveCharObjectInspector) inspector).getPrimitiveJavaObject(value).getStrippedValue();
  recordConsumer.addBinary(Binary.fromString(vChar));
  break;
case VARCHAR:
  String vVarchar = ((HiveVarcharObjectInspector) inspector).getPrimitiveJavaObject(value).getValue();
  recordConsumer.addBinary(Binary.fromString(vVarchar));
  break;
case BINARY:

代码示例来源:origin: com.twitter/parquet-thrift

private void writeStringToRecordConsumer(String str) {
 recordConsumer.addBinary(Binary.fromString(str));
}

代码示例来源:origin: org.apache.gobblin/gobblin-parquet

@Override
BinaryValue convertField(JsonElement value) {
 return new BinaryValue(Binary.fromString(value.getAsString()));
}

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

public Group append(String fieldName, String value) {
 add(fieldName, Binary.fromString(value));
 return this;
}

代码示例来源:origin: asakusafw/asakusafw

@Override
  public void write(Object value, RecordConsumer consumer) {
    consumer.addBinary(Binary.fromString(toString(value)));
  }
}

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

@Override
public void add(int fieldIndex, String value) {
 add(fieldIndex, new BinaryValue(Binary.fromString(value)));
}

代码示例来源:origin: org.apache.gobblin/gobblin-parquet

public void add(int fieldIndex, String value) {
 this.add(fieldIndex, new BinaryValue(Binary.fromString(value)));
}

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

@Override
 public FilterPredicate buildPredict(Operator op, Object constant,
                   String columnName) throws Exception{
  switch (op) {
   case LESS_THAN:
    return lt(binaryColumn(columnName), Binary.fromString((String) constant));
   case IS_NULL:
   case EQUALS:
   case NULL_SAFE_EQUALS:
    return eq(binaryColumn(columnName),
     (constant == null) ? null : Binary.fromString((String) constant));
   case LESS_THAN_EQUALS:
    return ltEq(binaryColumn(columnName), Binary.fromString((String) constant));
   default:
    // should never be executed
    throw new RuntimeException("Unknown PredicateLeaf Operator type: " + op);
  }
 }
}

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

private static BinaryStatistics stringColumnStats(String minimum, String maximum)
{
  BinaryStatistics statistics = new BinaryStatistics();
  statistics.setMinMax(Binary.fromString(minimum), Binary.fromString(maximum));
  return statistics;
}

代码示例来源:origin: asakusafw/asakusafw

@Override
  public void write(Object value, RecordConsumer consumer) {
    StringOption option = (StringOption) value;
    Text text = option.get();
    byte[] bytes = text.getBytes();
    int length = text.getLength();
    if (length > limit) {
      // if byte-length > limit, the string may code-point-count >= limit
      String stripped = HiveBaseChar.getPaddedValue(text.toString(), limit);
      consumer.addBinary(Binary.fromString(stripped));
    } else {
      consumer.addBinary(Binary.fromByteArray(bytes, 0, length));
    }
  }
}

代码示例来源:origin: uk.co.nichesolutions.presto/presto-hive

private static BinaryStatistics stringColumnStats(String minimum, String maximum)
  {
    BinaryStatistics statistics = new BinaryStatistics();
    statistics.setMinMax(Binary.fromString(minimum), Binary.fromString(maximum));
    return statistics;
  }
}

代码示例来源:origin: com.twitter/parquet-thrift

@Override
public void writeI32(int i32) throws TException {
 start();
 EnumValue value = type.getEnumValueById(i32);
 if (value == null) {
  throw new ParquetEncodingException("Can not find enum value of index " + i32 + " for field:" + columnIO.toString());
 }
 recordConsumer.addBinary(Binary.fromString(value.getName()));
 end();
}

代码示例来源:origin: com.twitter/parquet-cascading

private void writePrimitive(TupleEntry record, PrimitiveType field) {
  switch (field.getPrimitiveTypeName()) {
   case BINARY:
    recordConsumer.addBinary(Binary.fromString(record.getString(field.getName())));
    break;
   case BOOLEAN:
    recordConsumer.addBoolean(record.getBoolean(field.getName()));
    break;
   case INT32:
    recordConsumer.addInteger(record.getInteger(field.getName()));
    break;
   case INT64:
    recordConsumer.addLong(record.getLong(field.getName()));
    break;
   case DOUBLE:
    recordConsumer.addDouble(record.getDouble(field.getName()));
    break;
   case FLOAT:
    recordConsumer.addFloat(record.getFloat(field.getName()));
    break;
   case FIXED_LEN_BYTE_ARRAY:
    throw new UnsupportedOperationException("Fixed len byte array type not implemented");
   case INT96:
    throw new UnsupportedOperationException("Int96 type not implemented");
   default:
    throw new UnsupportedOperationException(field.getName() + " type not implemented");
  }
 }
}

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

case STRING:
 String v = ((StringObjectInspector) inspector).getPrimitiveJavaObject(value);
 recordConsumer.addBinary(Binary.fromString(v));
 break;
case CHAR:
 String vChar = ((HiveCharObjectInspector) inspector).getPrimitiveJavaObject(value).getStrippedValue();
 recordConsumer.addBinary(Binary.fromString(vChar));
 break;
case VARCHAR:
 String vVarchar = ((HiveVarcharObjectInspector) inspector).getPrimitiveJavaObject(value).getValue();
 recordConsumer.addBinary(Binary.fromString(vVarchar));
 break;
case BINARY:

代码示例来源:origin: org.apache.tajo/tajo-storage

case CHAR:
case TEXT:
 recordConsumer.addBinary(Binary.fromString(datum.asChars()));
 break;
case PROTOBUF:

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

case STRING:
  String v = ((StringObjectInspector) inspector).getPrimitiveJavaObject(value);
  recordConsumer.addBinary(Binary.fromString(v));
  break;
case CHAR:
  String vChar = ((HiveCharObjectInspector) inspector).getPrimitiveJavaObject(value).getStrippedValue();
  recordConsumer.addBinary(Binary.fromString(vChar));
  break;
case VARCHAR:
  String vVarchar = ((HiveVarcharObjectInspector) inspector).getPrimitiveJavaObject(value).getValue();
  recordConsumer.addBinary(Binary.fromString(vVarchar));
  break;
case BINARY:

相关文章