本文整理汇总了Java中org.pentaho.di.core.row.ValueMetaInterface.getBigNumber方法的典型用法代码示例。如果您正苦于以下问题:Java ValueMetaInterface.getBigNumber方法的具体用法?Java ValueMetaInterface.getBigNumber怎么用?Java ValueMetaInterface.getBigNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.row.ValueMetaInterface
的用法示例。
在下文中一共展示了ValueMetaInterface.getBigNumber方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPrimitive
import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
public static Object getPrimitive(ValueMetaInterface valueMeta, Object valueData) throws KettleValueException
{
switch(valueMeta.getType())
{
case ValueMetaInterface.TYPE_BIGNUMBER: return valueMeta.getBigNumber(valueData);
case ValueMetaInterface.TYPE_BINARY: return valueMeta.getBinary(valueData);
case ValueMetaInterface.TYPE_BOOLEAN: return valueMeta.getBoolean(valueData);
case ValueMetaInterface.TYPE_DATE: return valueMeta.getDate(valueData);
case ValueMetaInterface.TYPE_INTEGER: valueMeta.getInteger(valueData);
case ValueMetaInterface.TYPE_NUMBER: return valueMeta.getNumber(valueData);
// case ValueMetaInterface.TYPE_SERIALIZABLE: return valueMeta.(valueData);
case ValueMetaInterface.TYPE_STRING: return valueMeta.getString(valueData);
default: return null;
}
}
示例2: writeRowToBulk
import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
private void writeRowToBulk(RowMetaInterface rowMeta, Object[] r) throws KettleException {
try {
for (int i=0;i<data.keynrs.length;i++) {
int index = data.keynrs[i];
ValueMetaInterface valueMeta = rowMeta.getValueMeta(index);
Object valueData = r[index];
switch(valueMeta.getType()) {
case ValueMetaInterface.TYPE_STRING :
data.fifoStream.write(TeraDataBulkLoaderRoutines.convertVarchar(valueMeta.getString(valueData)));
break;
case ValueMetaInterface.TYPE_INTEGER:
data.fifoStream.write(TeraDataBulkLoaderRoutines.convertLong(valueMeta.getInteger(valueData)));
break;
case ValueMetaInterface.TYPE_DATE:
Date date = valueMeta.getDate(valueData);
data.fifoStream.write(TeraDataBulkLoaderRoutines.convertDateTime(date));
break;
case ValueMetaInterface.TYPE_BOOLEAN:
Boolean b= valueMeta.getBoolean(valueData);
data.fifoStream.write(TeraDataBulkLoaderRoutines.convertBoolean(b));
break;
case ValueMetaInterface.TYPE_NUMBER:
Double d = valueMeta.getNumber(valueData);
data.fifoStream.write(TeraDataBulkLoaderRoutines.convertFloat(d));
break;
case ValueMetaInterface.TYPE_BIGNUMBER:
BigDecimal bn = valueMeta.getBigNumber(valueData);
data.fifoStream.write(TeraDataBulkLoaderRoutines.convertBignum(bn));
break;
default:
logError("This is seen when a type in the PDI stream is not handleed by the step. Type is "+valueMeta.getType());
throw new KettleException("Unsupported type in stream");
}
}
}
catch(IOException e)
{
// If something went wrong with writing to the fifo, get the underlying error from MySQL
try{
logError("IOException writing to fifo. Waiting up to " + this.threadWaitTimeText + " for the tbuild command thread to return with the error.");
}
catch (Exception loadEx){
logError("Caught Loadex error :"+ loadEx);
throw new KettleException("loadEx Error serializing rows of data to the fifo file 1", loadEx);
}
// throw the generic "Pipe" exception.
logError("Caught IO error (pipe?):"+ e);
throw new KettleException("IO Error serializing rows of data to the fifo file 2", e);
}
catch (Exception e2){
logError("Caught some error :"+ e2);
// Null pointer exceptions etc.
throw new KettleException("Error serializing rows of data to the fifo file", e2);
}
}