本文整理匯總了Java中org.pentaho.di.core.row.RowMetaInterface.getValueMetaList方法的典型用法代碼示例。如果您正苦於以下問題:Java RowMetaInterface.getValueMetaList方法的具體用法?Java RowMetaInterface.getValueMetaList怎麽用?Java RowMetaInterface.getValueMetaList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.pentaho.di.core.row.RowMetaInterface
的用法示例。
在下文中一共展示了RowMetaInterface.getValueMetaList方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: determineInputFieldScriptFieldSplit
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
/**
* Given a fully defined output row metadata structure, determine which of the output fields are being copied from
* the input fields and which must be the output of the script.
*
* @param fullOutputRowMeta the fully defined output row metadata structure
* @param scriptFields row meta that will hold script only fields
* @param inputPresentInOutput row meta that will hold input fields being copied
* @param infos the array of info row metas
* @param stepName the name of the step
*/
protected void determineInputFieldScriptFieldSplit( RowMetaInterface fullOutputRowMeta, RowMetaInterface scriptFields,
RowMetaInterface inputPresentInOutput, RowMetaInterface[] infos, String stepName ) {
scriptFields.clear();
inputPresentInOutput.clear();
RowMetaInterface consolidatedInputFields = new RowMeta();
for ( RowMetaInterface r : infos ) {
consolidatedInputFields.addRowMeta( r );
}
for ( ValueMetaInterface vm : fullOutputRowMeta.getValueMetaList() ) {
int index = consolidatedInputFields.indexOfValue( vm.getName() );
if ( index >= 0 ) {
inputPresentInOutput.addValueMeta( vm );
} else {
// must be a script output (either a variable name field or data frame column name
scriptFields.addValueMeta( vm );
}
}
}
示例2: initializeColumns
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void initializeColumns(RowMetaInterface inputRowMeta) {
if(inputRowMeta == null) {
BaseMessages.getString(PKG, "RulesData.InitializeColumns.InputRowMetaIsNull");
return;
}
// Create objects for insertion into the rules engine
List<ValueMetaInterface> columns = inputRowMeta.getValueMetaList();
// This array must 1-1 match the row[] feteched by getRow()
columnList = new Rules.Column[columns.size()];
for(int i = 0; i < columns.size(); i++) {
ValueMetaInterface column = columns.get(i);
Rules.Column c = new Rules.Column(true);
c.setName(column.getName());
c.setType(column.getTypeDesc());
c.setPayload(null);
columnList[i] = c;
}
}
示例3: calculateLineage
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
/**
* Calculate the lineage for the specified step only...
* @param stepMeta The step to calculate the lineage for.
* @throws KettleStepException In case there is an exception calculating the lineage.
* This is usually caused by unavailable data sources etc.
*/
private void calculateLineage(StepMeta stepMeta) throws KettleStepException {
RowMetaInterface outputMeta = transMeta.getStepFields(stepMeta);
// The lineage is basically a calculation of origin for each output of a certain step.
//
for (ValueMetaInterface valueMeta : outputMeta.getValueMetaList()) {
StepMeta originStepMeta = transMeta.findStep(valueMeta.getOrigin(), stepMeta);
if (originStepMeta!=null) {
/*List<StepMeta> list = */ fieldStepsMap.get(originStepMeta);
}
}
}
示例4: rowsToCSV
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
protected static StringBuilder rowsToCSV( RowMetaInterface meta, List<Object[]> rows ) throws KettleValueException {
StringBuilder builder = new StringBuilder();
// header row
int i = 0;
for ( ValueMetaInterface v : meta.getValueMetaList() ) {
String name = quote( v.getName() );
builder.append( i > 0 ? "," : "" ).append( name );
i++;
}
builder.append( "\n" );
for ( Object[] row : rows ) {
for ( i = 0; i < meta.size(); i++ ) {
String value;
ValueMetaInterface vm = meta.getValueMeta( i );
if ( row[i] == null || Const.isEmpty( vm.getString( row[i] ) ) ) {
value = "?";
} else {
//switch ( meta.getValueMetaList().get( i ).getType() ) {
switch ( vm.getType() ) {
case ValueMetaInterface.TYPE_NUMBER:
case ValueMetaInterface.TYPE_INTEGER:
case ValueMetaInterface.TYPE_BIGNUMBER:
value = vm.getString( row[i] );
break;
case ValueMetaInterface.TYPE_DATE:
int offset = TZ.getOffset( vm.getDate( row[i] ).getTime() );
value = "" + ( vm.getDate( row[i] ).getTime() + offset );
break;
case ValueMetaInterface.TYPE_TIMESTAMP:
offset = TZ.getOffset( vm.getDate( row[i] ).getTime() );
value = "" + ( vm.getDate( row[i] ).getTime() + offset );
break;
case ValueMetaInterface.TYPE_BOOLEAN:
value = "" + ( vm.getBoolean( row[i] ) ? "1" : "0" );
break;
// TODO throw an exception for Serializable/Binary
default:
value = quote( vm.getString( row[i] ) );
}
}
builder.append( i > 0 ? "," : "" ).append( value );
}
builder.append( "\n" );
}
return builder;
}