本文整理汇总了Java中org.apache.hadoop.hive.serde2.lazy.LazyFloat类的典型用法代码示例。如果您正苦于以下问题:Java LazyFloat类的具体用法?Java LazyFloat怎么用?Java LazyFloat使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LazyFloat类属于org.apache.hadoop.hive.serde2.lazy包,在下文中一共展示了LazyFloat类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extractPigTypeFromHiveType
import org.apache.hadoop.hive.serde2.lazy.LazyFloat; //导入依赖的package包/类
/**
* Converts from a hive type to a pig type
*
* @param value
* Object hive type
* @return Object pig type
*/
public static Object extractPigTypeFromHiveType(Object value) {
if (value instanceof org.apache.hadoop.hive.serde2.lazy.LazyArray) {
value = parseLazyArrayToPigArray((org.apache.hadoop.hive.serde2.lazy.LazyArray) value);
} else if (value instanceof org.apache.hadoop.hive.serde2.lazy.LazyMap) {
value = parseLazyMapToPigMap((org.apache.hadoop.hive.serde2.lazy.LazyMap) value);
} else {
if (value instanceof LazyString) {
value = ((LazyString) value).getWritableObject().toString();
} else if (value instanceof LazyInteger) {
value = ((LazyInteger) value).getWritableObject().get();
} else if (value instanceof LazyLong) {
value = ((LazyLong) value).getWritableObject().get();
} else if (value instanceof LazyFloat) {
value = ((LazyFloat) value).getWritableObject().get();
} else if (value instanceof LazyDouble) {
value = ((LazyDouble) value).getWritableObject().get();
} else if (value instanceof LazyBoolean) {
boolean boolvalue = ((LazyBoolean) value).getWritableObject()
.get();
value = (boolvalue) ? 1 : 0;
} else if (value instanceof LazyByte) {
value = (int) ((LazyByte) value).getWritableObject().get();
} else if (value instanceof LazyShort) {
value = ((LazyShort) value).getWritableObject().get();
}
}
return value;
}