- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableConstantIntObjectInspector.getWritableConstantValue()
方法的一些代码示例,展示了WritableConstantIntObjectInspector.getWritableConstantValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WritableConstantIntObjectInspector.getWritableConstantValue()
方法的具体详情如下:
包路径:org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableConstantIntObjectInspector
类名称:WritableConstantIntObjectInspector
方法名:getWritableConstantValue
暂无
代码示例来源:origin: apache/hive
IntWritable value = ((WritableConstantIntObjectInspector) arg).getWritableConstantValue();
代码示例来源:origin: apache/hive
IntWritable value = ((WritableConstantIntObjectInspector)arg).getWritableConstantValue();
代码示例来源:origin: apache/hive
@Override
public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException {
if (arguments.length == 1) {
sourceOI = arguments[0];
return objectInspectorConverter.convert(sourceOI);
}
if (arguments.length == 2 && (arguments[0] instanceof UnionObjectInspector)
&& (arguments[1] instanceof WritableConstantIntObjectInspector)) {
tag = ((WritableConstantIntObjectInspector) arguments[1]).getWritableConstantValue().get();
unionOI = (UnionObjectInspector) arguments[0];
List<ObjectInspector> fieldOIs = ((UnionObjectInspector) arguments[0]).getObjectInspectors();
if (tag < 0 || tag >= fieldOIs.size()) {
throw new UDFArgumentException(
"int constant must be a valid union tag for " + unionOI.getTypeName() + ". Expected 0-"
+ (fieldOIs.size() - 1) + " got: " + tag);
}
return fieldOIs.get(tag);
}
String argumentTypes = "nothing";
if (arguments.length > 0) {
List<String> typeNames = new ArrayList<>();
for (ObjectInspector oi : arguments) {
typeNames.add(oi.getTypeName());
}
argumentTypes = typeNames.toString();
}
throw new UDFArgumentException(
"Unsupported arguments. Expected a type containing a union or a union and an int constant, got: "
+ argumentTypes);
}
代码示例来源:origin: apache/drill
IntWritable value = ((WritableConstantIntObjectInspector) arg).getWritableConstantValue();
代码示例来源:origin: apache/drill
IntWritable value = ((WritableConstantIntObjectInspector)arg).getWritableConstantValue();
代码示例来源:origin: apache/hive
@Test(expected = UDFArgumentException.class)
public void initialize_NegativeTagThrowsException() throws UDFArgumentException {
when(tagOI.getWritableConstantValue()).thenReturn(new IntWritable(-1));
underTest.initialize(new ObjectInspector[] { unionOI, tagOI });
}
代码示例来源:origin: apache/drill
@Override
public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException {
if (arguments.length == 1) {
sourceOI = arguments[0];
return objectInspectorConverter.convert(sourceOI);
}
if (arguments.length == 2 && (arguments[0] instanceof UnionObjectInspector)
&& (arguments[1] instanceof WritableConstantIntObjectInspector)) {
tag = ((WritableConstantIntObjectInspector) arguments[1]).getWritableConstantValue().get();
unionOI = (UnionObjectInspector) arguments[0];
List<ObjectInspector> fieldOIs = ((UnionObjectInspector) arguments[0]).getObjectInspectors();
if (tag < 0 || tag >= fieldOIs.size()) {
throw new UDFArgumentException(
"int constant must be a valid union tag for " + unionOI.getTypeName() + ". Expected 0-"
+ (fieldOIs.size() - 1) + " got: " + tag);
}
return fieldOIs.get(tag);
}
String argumentTypes = "nothing";
if (arguments.length > 0) {
List<String> typeNames = new ArrayList<>();
for (ObjectInspector oi : arguments) {
typeNames.add(oi.getTypeName());
}
argumentTypes = typeNames.toString();
}
throw new UDFArgumentException(
"Unsupported arguments. Expected a type containing a union or a union and an int constant, got: "
+ argumentTypes);
}
代码示例来源:origin: apache/hive
@Test(expected = UDFArgumentException.class)
public void initialize_OutOfBoundsTagThrowsException() throws UDFArgumentException {
when(unionOI.getObjectInspectors()).thenReturn(
ImmutableList.<ObjectInspector> of(
PrimitiveObjectInspectorFactory.writableStringObjectInspector,
PrimitiveObjectInspectorFactory.writableLongObjectInspector));
when(tagOI.getWritableConstantValue()).thenReturn(new IntWritable(2));
underTest.initialize(new ObjectInspector[] { unionOI, tagOI });
}
代码示例来源:origin: apache/hive
@Test
public void initialize_UnionAndTagArguments() throws UDFArgumentException {
when(unionOI.getObjectInspectors()).thenReturn(
ImmutableList.<ObjectInspector> of(
PrimitiveObjectInspectorFactory.writableStringObjectInspector,
PrimitiveObjectInspectorFactory.writableLongObjectInspector));
when(tagOI.getWritableConstantValue()).thenReturn(new IntWritable(0));
ObjectInspector result = underTest.initialize(new ObjectInspector[] { unionOI, tagOI });
assertThat(result, is((ObjectInspector) PrimitiveObjectInspectorFactory.writableStringObjectInspector));
}
代码示例来源:origin: apache/hive
writeIdBits = ((WritableConstantIntObjectInspector)arguments[0]).getWritableConstantValue().get();
taskIdBits = ((WritableConstantIntObjectInspector)arguments[1]).getWritableConstantValue().get();
rowIdBits = 64 - (writeIdBits + taskIdBits);
代码示例来源:origin: apache/hive
@Test
public void evaluate_UnionAndTagArguments_NotMatchesTag() throws HiveException {
when(unionOI.getObjectInspectors()).thenReturn(
ImmutableList.<ObjectInspector> of(
PrimitiveObjectInspectorFactory.writableStringObjectInspector,
PrimitiveObjectInspectorFactory.writableLongObjectInspector));
when(tagOI.getWritableConstantValue()).thenReturn(new IntWritable(0));
when(deferredObject.get()).thenReturn(value);
when(unionOI.getTag(value)).thenReturn((byte) 1);
underTest.initialize(new ObjectInspector[] { unionOI, tagOI });
Object result = underTest.evaluate(new DeferredObject[] { deferredObject });
assertThat(result, is(nullValue()));
}
代码示例来源:origin: apache/hive
@Test
public void evaluate_UnionAndTagArguments_MatchesTag() throws HiveException {
when(unionOI.getObjectInspectors()).thenReturn(
ImmutableList.<ObjectInspector> of(
PrimitiveObjectInspectorFactory.writableStringObjectInspector,
PrimitiveObjectInspectorFactory.writableLongObjectInspector));
when(tagOI.getWritableConstantValue()).thenReturn(new IntWritable(0));
when(deferredObject.get()).thenReturn(value);
when(unionOI.getTag(value)).thenReturn((byte) 0);
when(unionOI.getField(value)).thenReturn("foo");
underTest.initialize(new ObjectInspector[] { unionOI, tagOI });
Object result = underTest.evaluate(new DeferredObject[] { deferredObject });
assertThat(result, is((Object) "foo"));
}
代码示例来源:origin: apache/drill
@Override
public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException {
if (arguments.length != 2) {
throw new UDFArgumentLengthException(
"grouping() requires 2 argument, got " + arguments.length);
}
if (arguments[0].getCategory() != Category.PRIMITIVE) {
throw new UDFArgumentTypeException(0, "The first argument to grouping() must be primitive");
}
PrimitiveObjectInspector arg1OI = (PrimitiveObjectInspector) arguments[0];
if (arg1OI.getPrimitiveCategory() != PrimitiveCategory.INT) {
throw new UDFArgumentTypeException(0, "The first argument to grouping() must be an integer");
}
groupingIdOI = (IntObjectInspector) arguments[0];
PrimitiveObjectInspector arg2OI = (PrimitiveObjectInspector) arguments[1];
if (!(arg2OI instanceof WritableConstantIntObjectInspector)) {
throw new UDFArgumentTypeException(1, "The second argument to grouping() must be a constant");
}
index = ((WritableConstantIntObjectInspector)arg2OI).getWritableConstantValue().get();
return PrimitiveObjectInspectorFactory.writableByteObjectInspector;
}
代码示例来源:origin: apache/drill
throw new UDFArgumentTypeException(1, getFuncName().toUpperCase() + " second argument only takes constant");
scale = ((WritableConstantIntObjectInspector)scaleOI).getWritableConstantValue().get();
break;
case LONG:
代码示例来源:origin: apache/hive
case INT:
if (scaleOI instanceof WritableConstantIntObjectInspector) {
scale = ((WritableConstantIntObjectInspector)scaleOI).getWritableConstantValue().get();
} else {
constantScale = false;
代码示例来源:origin: klout/brickhouse
if (parameters[2] instanceof WritableConstantIntObjectInspector) {
WritableConstantIntObjectInspector nvOI = (WritableConstantIntObjectInspector) parameters[2];
numValues = nvOI.getWritableConstantValue().get();
LOG.info(" Setting number of values to " + numValues);
} else {
代码示例来源:origin: com.facebook.presto.hive/hive-apache
throw new UDFArgumentTypeException(1, "ROUND second argument only takes constant");
scale = ((WritableConstantIntObjectInspector)scaleOI).getWritableConstantValue().get();
break;
case LONG:
我有一个使用the #[serde(default)] container attribute的结构。 但是,应该有一个字段是必需的(如果输入数据中不存在该字段,则反序列化器应该出错,而不是退回到默认
我正在尝试使用 actix-web 服务器作为通往小型堆栈的网关,以保证堆栈内部的数据格式严格,同时为用户提供一些自由。 为此,我想将 JSON 字符串反序列化为结构,然后对其进行验证、再次序列化并将
正在使用 apache-hive-0.13.1。在创建表配置单元时抛出如下错误 FAILED: Execution Error, return code 1 from org.apache.hadoo
我想添加一个简单的版本方案 + 检查我的结构: #[derive(Serialize, Deserialize)] struct Versioned { version: u32, o
我正在尝试使用 Serde 加载一个 Toml 文件,它包含多个 bool 值,如果在文本文件中找不到,我想将它们全部默认为 false。 我目前的实现是: #[derive(serde::Deser
如何使用 Serde 为远程类型创建序列化程序代理对象?这是一个最小的例子(playground): use serde; // 1.0.104 use serde_json; // 1.0.48 s
我有一个枚举: #[derive(Serialize, Deserialize)] enum Action { Join, Leave, } 和一个结构: #[derive(Seria
我有一个枚举: #[derive(Serialize, Deserialize)] enum Action { Join, Leave, } 和一个结构: #[derive(Seria
在 Rust 中,我从 websocket 接收数据。为简单起见,它看起来像这样: [1, {"a": ["1.2345", 5, "9.8765"]}] 我从 websocket 获得的字符串确实
我的程序解析足够大的 json 文档(30MB),在 CPU 较慢的机器上需要 70 毫秒,我想加快这个过程,我发现 27% 的解析发生在我的 foo_document_type_deserializ
我正在尝试在配置单元中创建一个正则表达式 serde 来读取一些日志文件,但是在让它工作时遇到了问题... 日志文件看起来像这样...... 14.196.202.16:9123 11329 2
我正在使用映射列的 JSON-Serde 功能来重命名我的 json 文档中的列 'Customer ID' -> 'customer_id。我使用映射函数的原因是因为 HQL 不允许在 CREATE
我有一个包含 Text 键和 DoubleWritable 值的序列文件。当我将文件加载为外部表时 Create external table t (id String, data Double) S
假设我有这个结构: use serde::{Serialize, Deserialize}; #[derive(Deserialize)] struct MyStruct { field_1:
这段代码完全按照我的意愿序列化了一个 32 字节的数组: #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOr
我正在使用 event_emmiter_rs用于我的应用程序中的事件处理。该库允许您订阅带有回调的事件并触发这些事件。事件采用 (strings, value) 的形式,回调采用接受值参数的闭包形式。
给定这个枚举定义: #[repr(u8)] #[derive(Debug, Serialize)] pub enum AnimalType { #[serde(rename = "cat")]
我目前正在使用 Rocket 开发一个 Web API,它使用以下结构进行错误响应: #[derive(Serialize, Deserialize)] pub struct ErrorRespons
我想解析这个日志样本 May 3 11:52:54 cdh-dn03 init: tty (/dev/tty6) main process (1208) killed by TERM signal M
我想从访问日志中提取(ip、requestUrl、timeStamp)以加载到 hive 数据库。访问日志中的一行如下。 66.249.68.6 - - [14/Jan/2012:06:25:03 -
我是一名优秀的程序员,十分优秀!