本文整理了Java中org.apache.parquet.io.api.Binary.fromString()
方法的一些代码示例,展示了Binary.fromString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Binary.fromString()
方法的具体详情如下:
包路径:org.apache.parquet.io.api.Binary
类名称:Binary
方法名:fromString
暂无
代码示例来源:origin: apache/hive
@Override
public void write(Object value) {
String v = inspector.getPrimitiveJavaObject(value);
recordConsumer.addBinary(Binary.fromString(v));
}
}
代码示例来源:origin: apache/hive
@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: apache/hive
@Override
public void write(Object value) {
String v = inspector.getPrimitiveJavaObject(value).getValue();
recordConsumer.addBinary(Binary.fromString(v));
}
}
代码示例来源:origin: apache/hive
protected static Binary getBinaryValue(
boolean isDictionaryEncoding,
int index) {
return Binary.fromString(getStr(isDictionaryEncoding, index));
}
代码示例来源:origin: apache/hive
@Override
public void write(Object value) {
String v = inspector.getPrimitiveJavaObject(value).getStrippedValue();
recordConsumer.addBinary(Binary.fromString(v));
}
}
代码示例来源:origin: apache/hive
private void addString(String value) {
inOrder.verify(mockRecordConsumer).addBinary(Binary.fromString(value));
}
代码示例来源:origin: apache/hive
rc.addBinary(Binary.fromString("lettuce"));
rc.endField("key", 0);
rc.startField("value", 1);
rc.addBinary(Binary.fromString("kale"));
rc.endField("key", 0);
rc.addBinary(Binary.fromString("cabbage"));
rc.endField("key", 0);
rc.startField("value", 1);
代码示例来源:origin: apache/hive
rc.addBinary(Binary.fromString("green"));
rc.endField("key", 0);
rc.startField("value", 1);
rc.startGroup();
rc.startField("element", 0);
rc.addBinary(Binary.fromString("lettuce"));
rc.endField("element", 0);
rc.endGroup();
rc.startGroup();
rc.startField("element", 0);
rc.addBinary(Binary.fromString("kale"));
rc.endField("element", 0);
rc.endGroup();
rc.addBinary(Binary.fromString("brown"));
rc.endField("key", 0);
代码示例来源:origin: apache/hive
@Override
public void write(RecordConsumer rc) {
rc.startMessage();
rc.startField("votes", 0);
rc.startGroup();
rc.startField("key_value", 0);
rc.startGroup();
rc.startField("key", 0);
rc.addBinary(Binary.fromString("lettuce"));
rc.endField("key", 0);
rc.startField("value", 1);
rc.addInteger(34);
rc.endField("value", 1);
rc.endGroup();
rc.startGroup();
rc.startField("key", 0);
rc.addBinary(Binary.fromString("cabbage"));
rc.endField("key", 0);
rc.startField("value", 1);
rc.addInteger(18);
rc.endField("value", 1);
rc.endGroup();
rc.endField("key_value", 0);
rc.endGroup();
rc.endField("votes", 0);
rc.endMessage();
}
});
代码示例来源:origin: apache/hive
rc.addBinary(Binary.fromString("a"));
rc.endField("key", 0);
rc.startField("value", 1);
rc.startGroup();
rc.startField("key", 0);
rc.addBinary(Binary.fromString("b"));
rc.endField("key", 0);
rc.startField("value", 1);
rc.addBinary(Binary.fromString("b"));
rc.endField("key", 0);
rc.startField("value", 1);
rc.startGroup();
rc.startField("key", 0);
rc.addBinary(Binary.fromString("a"));
rc.endField("key", 0);
rc.startField("value", 1);
rc.startGroup();
rc.startField("key", 0);
rc.addBinary(Binary.fromString("b"));
rc.endField("key", 0);
rc.startField("value", 1);
代码示例来源:origin: apache/hive
rc.addBinary(Binary.fromString("low"));
rc.endField("key", 0);
rc.startField("value", 1);
rc.addBinary(Binary.fromString("high"));
rc.endField("key", 0);
rc.startField("value", 1);
代码示例来源:origin: org.lasersonlab.apache.parquet/parquet-column
public Group append(String fieldName, String value) {
add(fieldName, Binary.fromString(value));
return this;
}
代码示例来源:origin: org.apache.parquet/parquet-column
public Group append(String fieldName, String value) {
add(fieldName, Binary.fromString(value));
return this;
}
代码示例来源:origin: apache/apex-malhar
private Binary stringToBinary(Object value)
{
return Binary.fromString(value.toString());
}
代码示例来源:origin: org.apache.parquet/parquet-column
@Override
public void add(int fieldIndex, String value) {
add(fieldIndex, new BinaryValue(Binary.fromString(value)));
}
代码示例来源:origin: org.lasersonlab.apache.parquet/parquet-column
@Override
public void add(int fieldIndex, String value) {
add(fieldIndex, new BinaryValue(Binary.fromString(value)));
}
代码示例来源:origin: org.apache.parquet/parquet-thrift
public FieldEnumConverter(List<TProtocol> events, ThriftField field) {
this.events = events;
this.field = field;
final Iterable<EnumValue> values = ((EnumType)field.getType()).getValues();
for (EnumValue enumValue : values) {
enumLookup.put(Binary.fromString(enumValue.getName()), enumValue.getId());
}
}
代码示例来源:origin: prestosql/presto
private static BinaryStatistics stringColumnStats(String minimum, String maximum)
{
BinaryStatistics statistics = new BinaryStatistics();
statistics.setMinMax(Binary.fromString(minimum), Binary.fromString(maximum));
return statistics;
}
代码示例来源:origin: Netflix/iceberg
@Override
public void write(int repetitionLevel, CharSequence value) {
if (value instanceof Utf8) {
Utf8 utf8 = (Utf8) value;
column.writeBinary(repetitionLevel,
Binary.fromReusedByteArray(utf8.getBytes(), 0, utf8.getByteLength()));
} else {
column.writeBinary(repetitionLevel, Binary.fromString(value.toString()));
}
}
}
代码示例来源:origin: org.apache.parquet/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();
}
内容来源于网络,如有侵权,请联系作者删除!