return NullDatum.class; default: throw new TajoRuntimeException(new UnsupportedDataTypeException(type.name()));
private static void registerMethod(Method method, String [] names, UDFInvocationDesc udfInvocation, FunctionDescBuilder builder, List<FunctionDesc> list) { try { TajoDataTypes.DataType retType = WritableTypeConverter.convertWritableToTajoType((Class<? extends Writable>) method.getReturnType()); TajoDataTypes.DataType[] params = convertTajoParamterTypes(method.getParameterTypes()); builder.setReturnType(retType).setParams(params); for (String name : names) { builder.setName(name); builder.setUDF(udfInvocation); list.add(builder.build()); } } catch (UnsupportedDataTypeException e) { LOG.error(String.format("Hive UDF '%s' is not registered because of unsupported type: %s", names[0], e.getMessage())); } }
return NullDatum.class; default: throw new TajoRuntimeException(new UnsupportedDataTypeException(type.name()));
public static Datum createFromInt4(DataType type, int val) { switch (type.getType()) { case INT4: return new Int4Datum(val); case DATE: return new DateDatum(val); default: throw new TajoRuntimeException(new UnsupportedDataTypeException(type.getType().name())); } }
public static Datum createFromInt4(DataType type, int val) { switch (type.getType()) { case INT4: return new Int4Datum(val); case DATE: return new DateDatum(val); default: throw new TajoRuntimeException(new UnsupportedDataTypeException(type.getType().name())); } }
public static Datum createFromInt8(DataType type, long val) { switch (type.getType()) { case INT8: return new Int8Datum(val); case TIMESTAMP: return new TimestampDatum(val); case TIME: return createTime(val); default: throw new TajoRuntimeException(new UnsupportedDataTypeException(type.getType().name())); } }
public static Datum createFromInt8(DataType type, long val) { switch (type.getType()) { case INT8: return new Int8Datum(val); case TIMESTAMP: return new TimestampDatum(val); case TIME: return createTime(val); default: throw new TajoRuntimeException(new UnsupportedDataTypeException(type.getType().name())); } }
public static Datum convertWritable2Datum(Writable value) throws UnsupportedDataTypeException { if (value == null) { return NullDatum.get(); } DataType type = convertWritableToTajoType(value.getClass()); switch(type.getType()) { case INT1: return new Int2Datum(((ByteWritable)value).get()); case INT2: return new Int2Datum(((ShortWritable)value).get()); case INT4: return new Int4Datum(((IntWritable)value).get()); case INT8: return new Int8Datum(((LongWritable)value).get()); case FLOAT4: return new Float4Datum(((FloatWritable)value).get()); case FLOAT8: return new Float8Datum(((DoubleWritable)value).get()); case DATE: return new DateDatum(((DateWritable)value).getDays() + DateTimeConstants.UNIX_EPOCH_JDATE); case TIMESTAMP: return new TimestampDatum(DateTimeUtil.javaTimeToJulianTime( ((TimestampWritable)value).getTimestamp().getTime())); case CHAR: return new CharDatum(value.toString()); case TEXT: return new TextDatum(value.toString()); case VARBINARY: return new BlobDatum(((BytesWritable)value).getBytes()); } throw new TajoRuntimeException(new UnsupportedDataTypeException(value.getClass().getTypeName())); } }
throw new UnsupportedDataTypeException(writableClass.getSimpleName());
break; default: throw new TajoInternalError(new UnsupportedDataTypeException(c.getDataType().getType().name()));
return 8; default: throw new TajoRuntimeException(new UnsupportedDataTypeException(col.getDataType().toString()));
return 8; default: throw new TajoRuntimeException(new UnsupportedDataTypeException(col.getDataType().toString()));
break; default: throw new TajoInternalError(new UnsupportedDataTypeException(c.getDataType().getType().name()));
return createBlob(value); default: throw new TajoRuntimeException(new UnsupportedDataTypeException(dataType.toString()));
throw new TajoRuntimeException(new UnsupportedDataTypeException(d.type().toString()));
throw new TajoRuntimeException(new UnsupportedDataTypeException(d.type().name()));
return createInet4(value); default: throw new TajoRuntimeException(new UnsupportedDataTypeException(dataType.toString()));
throw new TajoRuntimeException(new UnsupportedDataTypeException(dataType.toString()));
throw new TajoRuntimeException(new UnsupportedDataTypeException(dataType.toString()));
throw new TajoRuntimeException(new UnsupportedDataTypeException(desc.getDataType().getType().name()));