当前位置: 首页>>代码示例>>Java>>正文


Java ValueMetaInterface.getBigNumber方法代码示例

本文整理汇总了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;
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:16,代码来源:RowForumulaContext.java

示例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);
    	}
	}
 
开发者ID:jbleuel,项目名称:pdi-teradata-tpt-plugin,代码行数:62,代码来源:TeraDataBulkLoader.java


注:本文中的org.pentaho.di.core.row.ValueMetaInterface.getBigNumber方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。