本文整理匯總了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
}
}
示例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;
}
示例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 );
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}