@Override public NumericDatum inverseSign() { return new Int2Datum((short) -val); } }
@Override public NumericDatum inverseSign() { return new Int2Datum((short) -val); } }
private void setNodeSequence(int nodeSequence) { this.nodeSequence = nodeSequence; this.nodeSequenceDatum = new Int2Datum((short)nodeSequence); }
private void setNodeSequence(int nodeSequence) { this.nodeSequence = nodeSequence; this.nodeSequenceDatum = new Int2Datum((short)nodeSequence); }
public static Int2Datum createInt2(short val) { return new Int2Datum(val); }
public static Int2Datum createInt2(short val) { return new Int2Datum(val); }
public static Int2Datum createInt2(String val) { return new Int2Datum(Short.valueOf(val)); }
public static Int2Datum createInt2(String val) { return new Int2Datum(Short.valueOf(val)); }
datums[index++] = new Int2Datum((short) getJavaSqlType(eachType)); //DATA_TYPE datums[index++] = new Int4Datum(getPrecision(eachType)); //PRECISION datums[index++] = new TextDatum(getLiteralPrefix(eachType)); //LITERAL_PREFIX datums[index++] = new TextDatum(getLiteralPrefix(eachType)); //LITERAL_SUFFIX datums[index++] = new TextDatum(""); //CREATE_PARAMS datums[index++] = new Int2Datum((short) DatabaseMetaData.typeNullable); //NULLABLE datums[index++] = new Int2Datum(getSearchable(eachType)); //SEARCHABLE datums[index++] = new Int2Datum((short) 0); //MINIMUM_SCALE datums[index++] = new Int2Datum((short) 0); //MAXIMUM_SCALE
datums[index++] = new Int2Datum((short) getJavaSqlType(eachType)); //DATA_TYPE datums[index++] = new Int4Datum(getPrecision(eachType)); //PRECISION datums[index++] = new TextDatum(getLiteralPrefix(eachType)); //LITERAL_PREFIX datums[index++] = new TextDatum(getLiteralPrefix(eachType)); //LITERAL_SUFFIX datums[index++] = new TextDatum(""); //CREATE_PARAMS datums[index++] = new Int2Datum((short) DatabaseMetaData.typeNullable); //NULLABLE datums[index++] = new Int2Datum(getSearchable(eachType)); //SEARCHABLE datums[index++] = new Int2Datum((short) 0); //MINIMUM_SCALE datums[index++] = new Int2Datum((short) 0); //MAXIMUM_SCALE
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())); } }