本文整理了Java中org.apache.pinot.common.utils.JsonUtils.extractValue()
方法的一些代码示例,展示了JsonUtils.extractValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JsonUtils.extractValue()
方法的具体详情如下:
包路径:org.apache.pinot.common.utils.JsonUtils
类名称:JsonUtils
方法名:extractValue
暂无
代码示例来源:origin: apache/incubator-pinot
@Override
public GenericRow decode(byte[] payload, GenericRow destination) {
try {
JsonNode message = JsonUtils.bytesToJsonNode(payload);
for (FieldSpec fieldSpec : schema.getAllFieldSpecs()) {
String column = fieldSpec.getName();
destination.putField(column, JsonUtils.extractValue(message.get(column), fieldSpec));
}
return destination;
} catch (Exception e) {
LOGGER.error("Caught exception while decoding row, discarding row.", e);
return null;
}
}
代码示例来源:origin: apache/incubator-pinot
@Override
public PinotRecord serialize(T t) {
_record.clear();
JsonNode jsonRecord = JsonUtils.objectToJsonNode(t);
for (FieldSpec fieldSpec : _schema.getAllFieldSpecs()) {
String column = fieldSpec.getName();
_record.putField(column, JsonUtils.extractValue(jsonRecord.get(column), fieldSpec));
}
return _record;
}
内容来源于网络,如有侵权,请联系作者删除!