本文整理了Java中cascading.tuple.TupleEntry.getBoolean()
方法的一些代码示例,展示了TupleEntry.getBoolean()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TupleEntry.getBoolean()
方法的具体详情如下:
包路径:cascading.tuple.TupleEntry
类名称:TupleEntry
方法名:getBoolean
[英]Method getBoolean returns the element for the given field name or position as a boolean. If the value is (case ignored) the string 'true', a true value will be returned. false if null.
fieldName may optionally be a Fields instance. Only the first field name or position will be considered.
[中]方法getBoolean将给定字段名或位置的元素作为布尔值返回。如果该值(大小写被忽略)为字符串“true”,则将返回一个true值。如果为空,则为false。
fieldName也可以是Fields实例。只考虑第一个字段名或位置。
代码示例来源:origin: com.twitter/scalding-parquet
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: org.apache.parquet/parquet-cascading3
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.twitter/scalding-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.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");
}
}
}
内容来源于网络,如有侵权,请联系作者删除!