Package org.apache.pig.impl.io

Examples of org.apache.pig.impl.io.NullableBag


    public static PigNullableWritable getWritableComparableTypes(Object o, byte keyType) throws ExecException{
        byte type = DataType.findType(o);
        switch (type) {
        case DataType.BAG:
            return new NullableBag((DataBag)o);

        case DataType.BOOLEAN:
            return new NullableBooleanWritable((Boolean)o);

        case DataType.BYTEARRAY:
            return new NullableBytesWritable(((DataByteArray)o).get());
           
        case DataType.CHARARRAY:
            return new NullableText((String)o);
           
        case DataType.DOUBLE:
            return new NullableDoubleWritable((Double)o);
          
        case DataType.FLOAT:
            return new NullableFloatWritable((Float)o);
           
        case DataType.INTEGER:
            return new NullableIntWritable((Integer)o);
          
        case DataType.LONG:
            return new NullableLongWritable((Long)o);
         
        case DataType.TUPLE:
            return new NullableTuple((Tuple)o);
        
        case DataType.MAP: {
            int errCode = 1068;
            String msg = "Using Map as key not supported.";
            throw new ExecException(msg, errCode, PigException.INPUT);
        }

        case DataType.NULL:
            switch (keyType) {
            case DataType.BAG:
                NullableBag nbag = new NullableBag();
                nbag.setNull(true);
                return nbag;
            case DataType.BOOLEAN:
                NullableBooleanWritable nboolWrit = new NullableBooleanWritable();
                nboolWrit.setNull(true);
                return nboolWrit;
View Full Code Here


        if (o==null)
            newKeyType = DataType.NULL;

        switch (newKeyType) {
        case DataType.BAG:
            return new NullableBag((DataBag)o);

        case DataType.BOOLEAN:
            return new NullableBooleanWritable((Boolean)o);

        case DataType.BYTEARRAY:
            return new NullableBytesWritable(o);

        case DataType.CHARARRAY:
            return new NullableText((String)o);

        case DataType.DOUBLE:
            return new NullableDoubleWritable((Double)o);

        case DataType.FLOAT:
            return new NullableFloatWritable((Float)o);

        case DataType.INTEGER:
            return new NullableIntWritable((Integer)o);

        case DataType.LONG:
            return new NullableLongWritable((Long)o);

        case DataType.BIGINTEGER:
            return new NullableBigIntegerWritable((BigInteger)o);

        case DataType.BIGDECIMAL:
            return new NullableBigDecimalWritable((BigDecimal)o);

        case DataType.DATETIME:
            return new NullableDateTimeWritable((DateTime)o);

        case DataType.TUPLE:
            return new NullableTuple((Tuple)o);

        case DataType.MAP: {
            int errCode = 1068;
            String msg = "Using Map as key not supported.";
            throw new ExecException(msg, errCode, PigException.INPUT);
        }

        case DataType.NULL:
            switch (keyType) {
            case DataType.BAG:
                NullableBag nbag = new NullableBag();
                nbag.setNull(true);
                return nbag;
            case DataType.BOOLEAN:
                NullableBooleanWritable nboolWrit = new NullableBooleanWritable();
                nboolWrit.setNull(true);
                return nboolWrit;
View Full Code Here

        if (o==null)
            newKeyType = DataType.NULL;
       
        switch (newKeyType) {
        case DataType.BAG:
            return new NullableBag((DataBag)o);

        case DataType.BOOLEAN:
            return new NullableBooleanWritable((Boolean)o);

        case DataType.BYTEARRAY:
            return new NullableBytesWritable(o);
           
        case DataType.CHARARRAY:
            return new NullableText((String)o);
           
        case DataType.DOUBLE:
            return new NullableDoubleWritable((Double)o);
          
        case DataType.FLOAT:
            return new NullableFloatWritable((Float)o);
           
        case DataType.INTEGER:
            return new NullableIntWritable((Integer)o);
          
        case DataType.LONG:
            return new NullableLongWritable((Long)o);

        case DataType.DATETIME:
            return new NullableDateTimeWritable((DateTime)o);

        case DataType.TUPLE:
            return new NullableTuple((Tuple)o);
        
        case DataType.MAP: {
            int errCode = 1068;
            String msg = "Using Map as key not supported.";
            throw new ExecException(msg, errCode, PigException.INPUT);
        }

        case DataType.NULL:
            switch (keyType) {
            case DataType.BAG:
                NullableBag nbag = new NullableBag();
                nbag.setNull(true);
                return nbag;
            case DataType.BOOLEAN:
                NullableBooleanWritable nboolWrit = new NullableBooleanWritable();
                nboolWrit.setNull(true);
                return nboolWrit;
View Full Code Here

    public static PigNullableWritable getWritableComparableTypes(Object o, byte keyType) throws ExecException{
        byte type = DataType.findType(o);
        switch (type) {
        case DataType.BAG:
            return new NullableBag((DataBag)o);

        case DataType.BOOLEAN:
            return new NullableBooleanWritable((Boolean)o);

        case DataType.BYTEARRAY:
            return new NullableBytesWritable(((DataByteArray)o).get());
           
        case DataType.CHARARRAY:
            return new NullableText((String)o);
           
        case DataType.DOUBLE:
            return new NullableDoubleWritable((Double)o);
          
        case DataType.FLOAT:
            return new NullableFloatWritable((Float)o);
           
        case DataType.INTEGER:
            return new NullableIntWritable((Integer)o);
          
        case DataType.LONG:
            return new NullableLongWritable((Long)o);
         
        case DataType.TUPLE:
            return new NullableTuple((Tuple)o);
        
        case DataType.MAP: {
            int errCode = 1068;
            String msg = "Using Map as key not supported.";
            throw new ExecException(msg, errCode, PigException.INPUT);
        }

        case DataType.NULL:
            switch (keyType) {
            case DataType.BAG:
                NullableBag nbag = new NullableBag();
                nbag.setNull(true);
                return nbag;
            case DataType.BOOLEAN:
                NullableBooleanWritable nboolWrit = new NullableBooleanWritable();
                nboolWrit.setNull(true);
                return nboolWrit;
View Full Code Here

        if (o==null)
            newKeyType = DataType.NULL;
       
        switch (newKeyType) {
        case DataType.BAG:
            return new NullableBag((DataBag)o);

        case DataType.BOOLEAN:
            return new NullableBooleanWritable((Boolean)o);

        case DataType.BYTEARRAY:
            return new NullableBytesWritable(o);
           
        case DataType.CHARARRAY:
            return new NullableText((String)o);
           
        case DataType.DOUBLE:
            return new NullableDoubleWritable((Double)o);
          
        case DataType.FLOAT:
            return new NullableFloatWritable((Float)o);
           
        case DataType.INTEGER:
            return new NullableIntWritable((Integer)o);
          
        case DataType.LONG:
            return new NullableLongWritable((Long)o);
         
        case DataType.TUPLE:
            return new NullableTuple((Tuple)o);
        
        case DataType.MAP: {
            int errCode = 1068;
            String msg = "Using Map as key not supported.";
            throw new ExecException(msg, errCode, PigException.INPUT);
        }

        case DataType.NULL:
            switch (keyType) {
            case DataType.BAG:
                NullableBag nbag = new NullableBag();
                nbag.setNull(true);
                return nbag;
            case DataType.BOOLEAN:
                NullableBooleanWritable nboolWrit = new NullableBooleanWritable();
                nboolWrit.setNull(true);
                return nboolWrit;
View Full Code Here

TOP

Related Classes of org.apache.pig.impl.io.NullableBag

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.