Search in sources :

Example 11 with BaseException

use of com.sap.hadoop.ds.BaseException in project SQLWindowing by hbutani.

the class Utils method createLazySimpleSerDe.

public static LazySimpleSerDe createLazySimpleSerDe(String columns, String types, String fieldDelim) throws BaseException {
    try {
        Properties p = new Properties();
        p.put(Constants.FIELD_DELIM, fieldDelim);
        p.put(Constants.LIST_COLUMNS, columns);
        p.put(Constants.LIST_COLUMN_TYPES, types);
        LazySimpleSerDe sd = new LazySimpleSerDe();
        sd.initialize(null, p);
        return sd;
    } catch (SerDeException se) {
        throw new BaseException(se);
    }
}
Also used : BaseException(com.sap.hadoop.ds.BaseException) LazySimpleSerDe(org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe) Properties(java.util.Properties) SerDeException(org.apache.hadoop.hive.serde2.SerDeException)

Example 12 with BaseException

use of com.sap.hadoop.ds.BaseException in project SQLWindowing by hbutani.

the class ByteBasedList method get.

public void get(int i, Writable wObj) throws BaseException {
    LockUtils.lock(lock.readLock());
    try {
        i = index(i);
        DataIStream dis = Streams.dis.get();
        ByteArrayIS bis = dis.getUnderlyingStream();
        bis.setBuffer(bytes, offsetsArray[i], offsetsArray[i + 1]);
        wObj.readFields(dis);
    } catch (IOException ie) {
        throw new BaseException(ie);
    } finally {
        lock.readLock().unlock();
    }
}
Also used : BaseException(com.sap.hadoop.ds.BaseException) DataIStream(com.sap.hadoop.ds.streams.Streams.DataIStream) IOException(java.io.IOException) ByteArrayIS(com.sap.hadoop.ds.streams.Streams.ByteArrayIS)

Aggregations

BaseException (com.sap.hadoop.ds.BaseException)12 IOException (java.io.IOException)11 ByteArrayIS (com.sap.hadoop.ds.streams.Streams.ByteArrayIS)4 ByteArrayOS (com.sap.hadoop.ds.streams.Streams.ByteArrayOS)4 DataIStream (com.sap.hadoop.ds.streams.Streams.DataIStream)4 DataOStream (com.sap.hadoop.ds.streams.Streams.DataOStream)4 File (java.io.File)2 Properties (java.util.Properties)1 SerDeException (org.apache.hadoop.hive.serde2.SerDeException)1 LazySimpleSerDe (org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe)1