當前位置: 首頁>>代碼示例>>Java>>正文


Java RowMeta類代碼示例

本文整理匯總了Java中org.pentaho.di.core.row.RowMeta的典型用法代碼示例。如果您正苦於以下問題:Java RowMeta類的具體用法?Java RowMeta怎麽用?Java RowMeta使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RowMeta類屬於org.pentaho.di.core.row包,在下文中一共展示了RowMeta類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testAddFieldToRow

import org.pentaho.di.core.row.RowMeta; //導入依賴的package包/類
@Test
public void testAddFieldToRow() throws KettleStepException {
  ZendeskInputMeta meta = new ZendeskInputUsersMeta();

  RowMetaInterface row = new RowMeta();
  assertTrue( row.isEmpty() );

  meta.addFieldToRow( row, "field1", ValueMetaInterface.TYPE_STRING );
  assertEquals( 1, row.size() );
  assertEquals( "field1", row.getValueMeta( 0 ).getName() );
  assertEquals( ValueMetaInterface.TYPE_STRING, row.getValueMeta( 0 ).getType() );

  meta.addFieldToRow( row, "", ValueMetaInterface.TYPE_INTEGER );
  assertEquals( 1, row.size() );

  meta.addFieldToRow( row, null, ValueMetaInterface.TYPE_INTEGER );
  assertEquals( 1, row.size() );

  try {
    meta.addFieldToRow( row, "field2", Integer.MIN_VALUE );
    fail();
  } catch( KettleStepException expected ) {
    // OK
  }
}
 
開發者ID:matthewtckr,項目名稱:pdi-zendesk-plugin,代碼行數:26,代碼來源:ZendeskInputMetaTest.java

示例2: determineOutputRowMeta

import org.pentaho.di.core.row.RowMeta; //導入依賴的package包/類
public RowMetaInterface determineOutputRowMeta( RowMetaInterface[] info, VariableSpace space )
    throws KettleException {

  List<RowMetaInterface> incomingMetas = new ArrayList<RowMetaInterface>();
  RowMetaInterface rmi = new RowMeta();

  // possibly multiple incoming row sets
  for ( RowMetaInterface r : info ) {
    if ( r != null ) {
      incomingMetas.add( r );
    }
  }

  PythonSession.RowMetaAndRows
      scriptRM =
      CPythonScriptExecutorData.determineOutputMetaSingleVariable( this, incomingMetas, this, getLog(), space );

  return scriptRM.m_rowMeta;
}
 
開發者ID:pentaho-labs,項目名稱:pentaho-cpython-plugin,代碼行數:20,代碼來源:CPythonScriptExecutorMeta.java

示例3: determineInputFieldScriptFieldSplit

import org.pentaho.di.core.row.RowMeta; //導入依賴的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 );
    }
  }
}
 
開發者ID:pentaho-labs,項目名稱:pentaho-cpython-plugin,代碼行數:31,代碼來源:CPythonScriptExecutorMeta.java

示例4: getTestObject

import org.pentaho.di.core.row.RowMeta; //導入依賴的package包/類
@Override public RowMetaInterface getTestObject() {
  int size = random.nextInt( 10 ) + 1;
  RowMetaInterface result = new RowMeta();

  for ( int i = 0; i < size; i++ ) {
    try {
      ValueMetaInterface vm =
          ValueMetaFactory.createValueMeta( "field" + i,
              i % 2 == 0 ? ValueMetaInterface.TYPE_STRING : ValueMetaInterface.TYPE_NUMBER );
      result.addValueMeta( vm );
    } catch ( KettlePluginException e ) {
      throw new RuntimeException( e );
    }
  }

  return result;
}
 
開發者ID:pentaho-labs,項目名稱:pentaho-cpython-plugin,代碼行數:18,代碼來源:CPythonRowMetaInterfaceValidator.java

示例5: createResultRowMetaInterface1

import org.pentaho.di.core.row.RowMeta; //導入依賴的package包/類
public RowMetaInterface createResultRowMetaInterface1()
{
	RowMetaInterface rm = new RowMeta();
	
	ValueMetaInterface[] valuesMeta = {			    
		    new ValueMeta("PARAM1", ValueMeta.TYPE_STRING),
		    new ValueMeta("PARAM2", ValueMeta.TYPE_STRING),
    };

	for (int i=0; i < valuesMeta.length; i++ )
	{
		rm.addValueMeta(valuesMeta[i]);
	}
	
	return rm;
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:17,代碼來源:ParameterSimpleTransTest.java

示例6: getPluginInformationRowMeta

import org.pentaho.di.core.row.RowMeta; //導入依賴的package包/類
public static RowMetaInterface getPluginInformationRowMeta()
{
	RowMetaInterface row = new RowMeta();
	
	row.addValueMeta(new ValueMeta(Messages.getString("StepPlugin.Information.Type.Label"), ValueMetaInterface.TYPE_STRING));
	row.addValueMeta(new ValueMeta(Messages.getString("StepPlugin.Information.ID.Label"), ValueMetaInterface.TYPE_STRING));
	row.addValueMeta(new ValueMeta(Messages.getString("StepPlugin.Information.Description.Label"), ValueMetaInterface.TYPE_STRING));
	row.addValueMeta(new ValueMeta(Messages.getString("StepPlugin.Information.ToolTip.Label"), ValueMetaInterface.TYPE_STRING));
	row.addValueMeta(new ValueMeta(Messages.getString("StepPlugin.Information.Directory.Label"), ValueMetaInterface.TYPE_STRING));
	row.addValueMeta(new ValueMeta(Messages.getString("StepPlugin.Information.JarFiles.Label"), ValueMetaInterface.TYPE_STRING));
	row.addValueMeta(new ValueMeta(Messages.getString("StepPlugin.Information.IconFile.Label"), ValueMetaInterface.TYPE_STRING));
	row.addValueMeta(new ValueMeta(Messages.getString("StepPlugin.Information.ClassName.Label"), ValueMetaInterface.TYPE_STRING));
	row.addValueMeta(new ValueMeta(Messages.getString("StepPlugin.Information.Category.Label"), ValueMetaInterface.TYPE_STRING));
	row.addValueMeta(new ValueMeta(Messages.getString("StepPlugin.Information.ErrorHelpFile.Label"), ValueMetaInterface.TYPE_STRING));
	row.addValueMeta(new ValueMeta(Messages.getString("StepPlugin.Information.SeparateClassloader.Label"), ValueMetaInterface.TYPE_BOOLEAN));

    return row;
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:19,代碼來源:JobPlugin.java

示例7: getFields

import org.pentaho.di.core.row.RowMeta; //導入依賴的package包/類
public void getFields(RowMetaInterface r, String origin, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space)
{
	// re-assemble a new row of metadata
	//
   	RowMetaInterface fields = new RowMeta();
   	
   	// Add existing values
   	fields.addRowMeta(r);
       
       
       // add analytic values
       for (int i = 0 ; i < number_of_fields; i ++ ){
       	int index_of_subject = -1;
       	index_of_subject = r.indexOfValue(subjectField[i]);
       	ValueMetaInterface vmi = r.getValueMeta(index_of_subject).clone();
       	vmi.setOrigin(origin);
       	vmi.setName(aggregateField[i]);
       	fields.addValueMeta(r.size() + i, vmi);
       }
       
       r.clear();
       // Add back to Row Meta
       r.addRowMeta(fields);
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:25,代碼來源:AnalyticQueryMeta.java

示例8: getFields

import org.pentaho.di.core.row.RowMeta; //導入依賴的package包/類
public void getFields(RowMetaInterface row, String origin, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException 
   {
   	// The output for the closure table is:
   	//
   	// - parentId
   	// - childId
   	// - distance
   	//
   	// Nothing else.
   	//
   	RowMetaInterface result = new RowMeta();
   	ValueMetaInterface parentValueMeta = row.searchValueMeta(parentIdFieldName);
   	if (parentValueMeta!=null) result.addValueMeta(parentValueMeta);
   	
   	ValueMetaInterface childValueMeta = row.searchValueMeta(childIdFieldName);
   	if (childValueMeta!=null) result.addValueMeta(childValueMeta);

   	ValueMetaInterface distanceValueMeta = new ValueMeta(distanceFieldName, ValueMetaInterface.TYPE_INTEGER);
   	distanceValueMeta.setLength(ValueMetaInterface.DEFAULT_INTEGER_LENGTH);
   	result.addValueMeta(distanceValueMeta);

   	row.clear();
   	row.addRowMeta(result);
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:25,代碼來源:ClosureGeneratorMeta.java

示例9: processRow

import org.pentaho.di.core.row.RowMeta; //導入依賴的package包/類
public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException
{
	if (data.resultFilesList == null || getLinesRead() >= data.resultFilesList.size())
	{
		setOutputDone();
		return false;
	}

	ResultFile resultFile = (ResultFile) data.resultFilesList.get((int) getLinesRead());
	RowMetaAndData r = resultFile.getRow();

	if (first) {
		first=false;
		data.outputRowMeta = new RowMeta();
		smi.getFields(data.outputRowMeta, getStepname(), null, null, this);
	}
	incrementLinesRead();

	putRow(data.outputRowMeta, r.getData()); // copy row to possible alternate
									// rowset(s).

	if (checkFeedback(getLinesRead()))
		logBasic(BaseMessages.getString(PKG, "FilesFromResult.Log.LineNumber") + getLinesRead()); //$NON-NLS-1$

	return true;
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:27,代碼來源:FilesFromResult.java

示例10: getLogFields

import org.pentaho.di.core.row.RowMeta; //導入依賴的package包/類
public static final RowMetaInterface getLogFields(String comm)
{
    RowMetaInterface r = new RowMeta();
    ValueMetaInterface sname = new ValueMeta(Messages.getString("BaseStep.ColumnName.Stepname"), ValueMetaInterface.TYPE_STRING); //$NON-NLS-1$ //$NON-NLS-2$
    sname.setLength(256);
    r.addValueMeta(sname);

    r.addValueMeta(new ValueMeta(Messages.getString("BaseStep.ColumnName.Copy"), ValueMetaInterface.TYPE_NUMBER)); //$NON-NLS-1$
    r.addValueMeta(new ValueMeta(Messages.getString("BaseStep.ColumnName.LinesReaded"), ValueMetaInterface.TYPE_NUMBER)); //$NON-NLS-1$
    r.addValueMeta(new ValueMeta(Messages.getString("BaseStep.ColumnName.LinesWritten"), ValueMetaInterface.TYPE_NUMBER)); //$NON-NLS-1$
    r.addValueMeta(new ValueMeta(Messages.getString("BaseStep.ColumnName.LinesUpdated"), ValueMetaInterface.TYPE_NUMBER)); //$NON-NLS-1$
    r.addValueMeta(new ValueMeta(Messages.getString("BaseStep.ColumnName.LinesSkipped"), ValueMetaInterface.TYPE_NUMBER)); //$NON-NLS-1$
    r.addValueMeta(new ValueMeta(Messages.getString("BaseStep.ColumnName.Errors"), ValueMetaInterface.TYPE_NUMBER)); //$NON-NLS-1$
    r.addValueMeta(new ValueMeta(Messages.getString("BaseStep.ColumnName.StartDate"), ValueMetaInterface.TYPE_DATE)); //$NON-NLS-1$
    r.addValueMeta(new ValueMeta(Messages.getString("BaseStep.ColumnName.EndDate"), ValueMetaInterface.TYPE_DATE)); //$NON-NLS-1$

    for (int i = 0; i < r.size(); i++)
    {
        r.getValueMeta(i).setOrigin(comm);
    }

    return r;
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:24,代碼來源:BaseStep.java

示例11: createRowMetaInterface

import org.pentaho.di.core.row.RowMeta; //導入依賴的package包/類
public RowMetaInterface createRowMetaInterface()
{
	RowMetaInterface rm = new RowMeta();
	
	ValueMetaInterface[] valuesMeta = {
		    new ValueMeta("field1", ValueMeta.TYPE_STRING),
		    new ValueMeta("field2", ValueMeta.TYPE_INTEGER),
		    new ValueMeta("field3", ValueMeta.TYPE_NUMBER),
		    new ValueMeta("field5", ValueMeta.TYPE_BOOLEAN),
		    new ValueMeta("field6", ValueMeta.TYPE_BIGNUMBER), 
    };

	for (int i=0; i < valuesMeta.length; i++ )
	{
		rm.addValueMeta(valuesMeta[i]);
	}
	
	return rm;
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:20,代碼來源:DetectLastRowStepTest.java

示例12: createResultRowMetaInterface

import org.pentaho.di.core.row.RowMeta; //導入依賴的package包/類
public RowMetaInterface createResultRowMetaInterface()
{
	RowMetaInterface rm = new RowMeta();
	
	ValueMetaInterface[] valuesMeta = {
		    new ValueMeta("field1", ValueMeta.TYPE_STRING),
		    new ValueMeta("field2", ValueMeta.TYPE_INTEGER),
		    new ValueMeta("field3", ValueMeta.TYPE_NUMBER),
		    new ValueMeta("field5", ValueMeta.TYPE_BOOLEAN),
		    new ValueMeta("field6", ValueMeta.TYPE_BIGNUMBER),
		    new ValueMeta("result", ValueMeta.TYPE_BOOLEAN),
    };

	for (int i=0; i < valuesMeta.length; i++ )
	{
		rm.addValueMeta(valuesMeta[i]);
	}
	
	return rm;
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:21,代碼來源:DetectLastRowStepTest.java

示例13: createRowMetaInterface3

import org.pentaho.di.core.row.RowMeta; //導入依賴的package包/類
public RowMetaInterface createRowMetaInterface3()
{
	RowMetaInterface rm = new RowMeta();

	ValueMetaInterface valuesMeta[] = {
			new ValueMeta("int_in",    ValueMeta.TYPE_INTEGER),
		    new ValueMeta("number_in", ValueMeta.TYPE_NUMBER),
		    new ValueMeta("string_in", ValueMeta.TYPE_STRING),
    };

	for (int i=0; i < valuesMeta.length; i++ )
	{
		rm.addValueMeta(valuesMeta[i]);
	}

	return rm;
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:18,代碼來源:JavaScriptSpecialTest.java

示例14: createRowMetaInterface4

import org.pentaho.di.core.row.RowMeta; //導入依賴的package包/類
public RowMetaInterface createRowMetaInterface4()
{
	RowMetaInterface rm = new RowMeta();

	ValueMetaInterface valuesMeta[] = {
			new ValueMeta("int_in",    ValueMeta.TYPE_INTEGER),
		    new ValueMeta("number_in", ValueMeta.TYPE_NUMBER),
		    new ValueMeta("string_in", ValueMeta.TYPE_STRING),
			new ValueMeta("long1",     ValueMeta.TYPE_INTEGER),
		    new ValueMeta("number1",   ValueMeta.TYPE_NUMBER),
		    new ValueMeta("string1",   ValueMeta.TYPE_STRING),
			new ValueMeta("long2",     ValueMeta.TYPE_INTEGER),
		    new ValueMeta("number2",   ValueMeta.TYPE_NUMBER),
		    new ValueMeta("string2",   ValueMeta.TYPE_STRING),			    
    };

	for (int i=0; i < valuesMeta.length; i++ )
	{
		rm.addValueMeta(valuesMeta[i]);
	}

	return rm;
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:24,代碼來源:JavaScriptSpecialTest.java

示例15: createRowMetaInterfaceResult1

import org.pentaho.di.core.row.RowMeta; //導入依賴的package包/類
/**
 * Create the meta data for the results (ltrim/rtrim/trim).
 */
public RowMetaInterface createRowMetaInterfaceResult1()
{
	RowMetaInterface rm = new RowMeta();
	
	ValueMetaInterface valuesMeta[] = {
		    new ValueMeta("string",   ValueMeta.TYPE_STRING),
		    new ValueMeta("original", ValueMeta.TYPE_STRING),
		    new ValueMeta("ltrimStr", ValueMeta.TYPE_STRING),
		    new ValueMeta("rtrimStr", ValueMeta.TYPE_STRING),
		    new ValueMeta("trimStr",  ValueMeta.TYPE_STRING),
    };

	for (int i=0; i < valuesMeta.length; i++ )
	{
		rm.addValueMeta(valuesMeta[i]);
	}
	
	return rm;
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:23,代碼來源:JavaScriptStringTest.java


注:本文中的org.pentaho.di.core.row.RowMeta類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。