本文整理匯總了Java中org.pentaho.di.core.row.RowMetaInterface.searchValueMeta方法的典型用法代碼示例。如果您正苦於以下問題:Java RowMetaInterface.searchValueMeta方法的具體用法?Java RowMetaInterface.searchValueMeta怎麽用?Java RowMetaInterface.searchValueMeta使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.pentaho.di.core.row.RowMetaInterface
的用法示例。
在下文中一共展示了RowMetaInterface.searchValueMeta方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: analyseImpact
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void analyseImpact(List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String input[], String output[], RowMetaInterface info) throws KettleStepException
{
if (prev != null)
{
/* DEBUG CHECK THIS */
// Insert dateMask fields : read/write
for (int i = 0; i < fieldTable.length; i++)
{
ValueMetaInterface v = prev.searchValueMeta(fieldStream[i]);
DatabaseImpact ii = new DatabaseImpact(DatabaseImpact.TYPE_IMPACT_READ_WRITE, transMeta.getName(), stepMeta.getName(), databaseMeta
.getDatabaseName(), transMeta.environmentSubstitute(tableName), fieldTable[i], fieldStream[i], v!=null?v.getOrigin():"?", "", "Type = " + v.toStringMeta()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
impact.add(ii);
}
}
}
示例2: analyseImpact
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void analyseImpact(List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input,
String[] output, RowMetaInterface info)
throws KettleStepException
{
if (prev != null)
{
// Lookup: we do a lookup on the natural keys
for (int i = 0; i < keyLookup.length; i++)
{
ValueMetaInterface v = prev.searchValueMeta(keyStream[i]);
DatabaseImpact ii = new DatabaseImpact(DatabaseImpact.TYPE_IMPACT_DELETE, transMeta.getName(), stepMeta.getName(), databaseMeta
.getDatabaseName(), tableName, keyLookup[i], keyStream[i], v!=null?v.getOrigin():"?", "", "Type = " + v.toStringMeta()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
impact.add(ii);
}
}
}
示例3: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space)
{
// No values are added to the row in this type of step
// However, in case of Fixed length records,
// the field precisions and lengths are altered!
for (int i = 0; i < outputFields.length; i++)
{
XMLField field = outputFields[i];
ValueMetaInterface v = row.searchValueMeta(field.getFieldName());
if (v != null)
{
v.setLength(field.getLength(), field.getPrecision());
}
}
}
示例4: analyseImpact
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void analyseImpact(List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String input[], String output[], RowMetaInterface info) throws KettleStepException
{
if (prev != null)
{
/* DEBUG CHECK THIS */
// Insert dateMask fields : read/write
for (int i = 0; i < fieldTable.length; i++)
{
ValueMetaInterface v = prev.searchValueMeta(fieldStream[i]);
DatabaseImpact ii = new DatabaseImpact(DatabaseImpact.TYPE_IMPACT_READ_WRITE, transMeta.getName(), stepMeta.getName(), databaseMeta.getDatabaseName(),
transMeta.environmentSubstitute(tableName), fieldTable[i], fieldStream[i], v!=null?v.getOrigin():"?", "", "Type = " + v.toStringMeta()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
impact.add(ii);
}
}
}
示例5: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
{
// No values are added to the row in this type of step
// However, in case of Fixed length records,
// the field precisions and lengths are altered!
for (int i=0;i<outputFields.length;i++)
{
TextFileField field = outputFields[i];
ValueMetaInterface v = row.searchValueMeta(field.getName());
if (v!=null)
{
v.setLength(field.getLength());
v.setPrecision(field.getPrecision());
v.setConversionMask(field.getFormat());
v.setDecimalSymbol(field.getDecimalSymbol());
v.setGroupingSymbol(field.getGroupingSymbol());
v.setCurrencySymbol(field.getCurrencySymbol());
v.setOutputPaddingEnabled( isPadded() );
v.setTrimType(field.getTrimType());
if ( ! Const.isEmpty(getEncoding()) )
{
v.setStringEncoding(getEncoding());
}
// enable output padding by default to be compatible with v2.5.x
//
v.setOutputPaddingEnabled(true);
}
}
}
示例6: isInputLayoutValid
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
/**
* Checks whether incoming rows are join compatible. This essentially
* means that the keys being compared should be of the same datatype
* and both rows should have the same number of keys specified
* @param row1 Reference row
* @param row2 Row to compare to
*
* @return true when templates are compatible.
*/
protected boolean isInputLayoutValid(RowMetaInterface row1, RowMetaInterface row2)
{
if (row1!=null && row2!=null)
{
// Compare the key types
String keyFields1[] = meta.getKeyFields1();
int nrKeyFields1 = keyFields1.length;
String keyFields2[] = meta.getKeyFields2();
int nrKeyFields2 = keyFields2.length;
if (nrKeyFields1 != nrKeyFields2)
{
logError("Number of keys do not match " + nrKeyFields1 + " vs " + nrKeyFields2);
return false;
}
for (int i=0;i<nrKeyFields1;i++)
{
ValueMetaInterface v1 = row1.searchValueMeta(keyFields1[i]);
if (v1 == null)
{
return false;
}
ValueMetaInterface v2 = row2.searchValueMeta(keyFields2[i]);
if (v2 == null)
{
return false;
}
if ( v1.getType()!=v2.getType() )
{
return false;
}
}
}
// we got here, all seems to be ok.
return true;
}
示例7: getSQLStatements
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public SQLStatement getSQLStatements(TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, Repository repository) throws KettleStepException
{
SQLStatement retval = new SQLStatement(stepMeta.getName(), databaseMeta, null); // default: nothing to do!
if (databaseMeta!=null)
{
if (prev!=null && prev.size()>0)
{
// Copy the row
RowMetaInterface tableFields = new RowMeta();
// Now change the field names
for (int i=0;i<fieldTable.length;i++)
{
ValueMetaInterface v = prev.searchValueMeta(fieldStream[i]);
if (v!=null)
{
ValueMetaInterface tableField = v.clone();
tableField.setName(fieldTable[i]);
tableFields.addValueMeta(tableField);
}
else
{
throw new KettleStepException("Unable to find field ["+fieldStream[i]+"] in the input rows");
}
}
if (!Const.isEmpty(tableName))
{
Database db = new Database(loggingObject, databaseMeta);
db.shareVariablesWith(transMeta);
try
{
db.connect();
String schemaTable = databaseMeta.getQuotedSchemaTableCombination(transMeta.environmentSubstitute(schemaName),
transMeta.environmentSubstitute(tableName));
String cr_table = db.getDDL(schemaTable,
tableFields,
null,
false,
null,
true
);
String sql = cr_table;
if (sql.length()==0) retval.setSQL(null); else retval.setSQL(sql);
}
catch(KettleException e)
{
retval.setError(BaseMessages.getString(PKG, "TeraDataBulkLoaderMeta.GetSQL.ErrorOccurred")+e.getMessage());
}
}
else
{
retval.setError(BaseMessages.getString(PKG, "TeraDataBulkLoaderMeta.GetSQL.NoTableDefinedOnConnection"));
}
}
else
{
retval.setError(BaseMessages.getString(PKG, "TeraDataBulkLoaderMeta.GetSQL.NotReceivingAnyFields"));
}
}
else
{
retval.setError(BaseMessages.getString(PKG, "TeraDataBulkLoaderMeta.GetSQL.NoConnectionDefined"));
}
return retval;
}
示例8: getPrevStepFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
/**
* Find the fields that are entering a certain step.
*
* @param stepMeta The step queried
* @param monitor The progress monitor for progress dialog. (null if not used!)
* @return A row containing the fields (w/ origin) entering the step
*/
public RowMetaInterface getPrevStepFields(StepMeta stepMeta, ProgressMonitorListener monitor) throws KettleStepException
{
clearStepFieldsCachce();
RowMetaInterface row = new RowMeta();
if (stepMeta == null) { return null; }
if(log.isDebug()) log.logDebug(BaseMessages.getString(PKG, "TransMeta.Log.FromStepALookingAtPreviousStep", stepMeta.getName(), String.valueOf(findNrPrevSteps(stepMeta)) )); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
for (int i = 0; i < findNrPrevSteps(stepMeta); i++)
{
StepMeta prevStepMeta = findPrevStep(stepMeta, i);
if (monitor != null)
{
monitor.subTask(BaseMessages.getString(PKG, "TransMeta.Monitor.CheckingStepTask.Title", prevStepMeta.getName() )); //$NON-NLS-1$ //$NON-NLS-2$
}
RowMetaInterface add = getStepFields(prevStepMeta, stepMeta, monitor);
if(log.isDebug()) log.logDebug(BaseMessages.getString(PKG, "TransMeta.Log.FoundFieldsToAdd2") + add.toString()); //$NON-NLS-1$
if (i == 0) // we expect all input streams to be of the same layout!
{
row.addRowMeta(add); // recursive!
}
else
{
// See if the add fields are not already in the row
for (int x = 0; x < add.size(); x++)
{
ValueMetaInterface v = add.getValueMeta(x);
ValueMetaInterface s = row.searchValueMeta(v.getName());
if (s == null)
{
row.addValueMeta(v);
}
}
}
}
return row;
}
示例9: getSQLStatements
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public SQLStatement getSQLStatements(TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev) throws KettleStepException
{
SQLStatement retval = new SQLStatement(stepMeta.getName(), databaseMeta, null); // default: nothing to do!
if (databaseMeta!=null)
{
if (prev!=null && prev.size()>0)
{
// Copy the row
RowMetaInterface tableFields = new RowMeta();
// Now change the field names
for (int i=0;i<fieldTable.length;i++)
{
ValueMetaInterface v = prev.searchValueMeta(fieldStream[i]);
if (v!=null)
{
ValueMetaInterface tableField = v.clone();
tableField.setName(fieldTable[i]);
tableFields.addValueMeta(tableField);
}
else
{
throw new KettleStepException("Unable to find field ["+fieldStream[i]+"] in the input rows");
}
}
if (!Const.isEmpty(tableName))
{
Database db = new Database(loggingObject, databaseMeta);
db.shareVariablesWith(transMeta);
try
{
db.connect();
String schemaTable = databaseMeta.getQuotedSchemaTableCombination(transMeta.environmentSubstitute(schemaName),
transMeta.environmentSubstitute(tableName));
String sql = db.getDDL(schemaTable,
tableFields,
null,
false,
null,
true
);
if (sql.length()==0) retval.setSQL(null); else retval.setSQL(sql);
}
catch(KettleException e)
{
retval.setError(BaseMessages.getString(PKG, "OraBulkLoaderMeta.GetSQL.ErrorOccurred")+e.getMessage()); //$NON-NLS-1$
}
}
else
{
retval.setError(BaseMessages.getString(PKG, "OraBulkLoaderMeta.GetSQL.NoTableDefinedOnConnection")); //$NON-NLS-1$
}
}
else
{
retval.setError(BaseMessages.getString(PKG, "OraBulkLoaderMeta.GetSQL.NotReceivingAnyFields")); //$NON-NLS-1$
}
}
else
{
retval.setError(BaseMessages.getString(PKG, "OraBulkLoaderMeta.GetSQL.NoConnectionDefined")); //$NON-NLS-1$
}
return retval;
}
示例10: getSQLStatements
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public SQLStatement getSQLStatements(TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev) throws KettleStepException
{
SQLStatement retval = new SQLStatement(stepMeta.getName(), databaseMeta, null); // default: nothing to do!
if (databaseMeta!=null)
{
if (prev!=null && prev.size()>0)
{
// Copy the row
RowMetaInterface tableFields = new RowMeta();
// Now change the field names
for (int i=0;i<fieldTable.length;i++)
{
ValueMetaInterface v = prev.searchValueMeta(fieldStream[i]);
if (v!=null)
{
ValueMetaInterface tableField = v.clone();
tableField.setName(fieldTable[i]);
tableFields.addValueMeta(tableField);
}
else
{
throw new KettleStepException("Unable to find field ["+fieldStream[i]+"] in the input rows");
}
}
if (!Const.isEmpty(tableName))
{
Database db = new Database(loggingObject, databaseMeta);
db.shareVariablesWith(transMeta);
try
{
db.connect();
String schemaTable = databaseMeta.getQuotedSchemaTableCombination(transMeta.environmentSubstitute(schemaName),
transMeta.environmentSubstitute(tableName));
String sql = db.getDDL(schemaTable,
tableFields,
null,
false,
null,
true
);
if (sql.length()==0) retval.setSQL(null); else retval.setSQL(sql);
}
catch(KettleException e)
{
retval.setError(BaseMessages.getString(PKG, "GPBulkLoaderMeta.GetSQL.ErrorOccurred")+e.getMessage()); //$NON-NLS-1$
}
}
else
{
retval.setError(BaseMessages.getString(PKG, "GPBulkLoaderMeta.GetSQL.NoTableDefinedOnConnection")); //$NON-NLS-1$
}
}
else
{
retval.setError(BaseMessages.getString(PKG, "GPBulkLoaderMeta.GetSQL.NotReceivingAnyFields")); //$NON-NLS-1$
}
}
else
{
retval.setError(BaseMessages.getString(PKG, "GPBulkLoaderMeta.GetSQL.NoConnectionDefined")); //$NON-NLS-1$
}
return retval;
}
示例11: getPrevStepFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
/**
* Find the fields that are entering a certain step.
*
* @param stepMeta The step queried
* @param monitor The progress monitor for progress dialog. (null if not used!)
* @return A row containing the fields (w/ origin) entering the step
*/
public RowMetaInterface getPrevStepFields(StepMeta stepMeta, ProgressMonitorListener monitor) throws KettleStepException
{
clearStepFieldsCachce();
RowMetaInterface row = new RowMeta();
if (stepMeta == null) { return null; }
if(log.isDebug()) log.logDebug(toString(), Messages.getString("TransMeta.Log.FromStepALookingAtPreviousStep", stepMeta.getName(), String.valueOf(findNrPrevSteps(stepMeta)) )); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
for (int i = 0; i < findNrPrevSteps(stepMeta); i++)
{
StepMeta prevStepMeta = findPrevStep(stepMeta, i);
if (monitor != null)
{
monitor.subTask(Messages.getString("TransMeta.Monitor.CheckingStepTask.Title", prevStepMeta.getName() )); //$NON-NLS-1$ //$NON-NLS-2$
}
RowMetaInterface add = getStepFields(prevStepMeta, stepMeta, monitor);
if(log.isDebug()) log.logDebug(toString(), Messages.getString("TransMeta.Log.FoundFieldsToAdd2") + add.toString()); //$NON-NLS-1$
if (i == 0) // we expect all input streams to be of the same layout!
{
row.addRowMeta(add); // recursive!
}
else
{
// See if the add fields are not already in the row
for (int x = 0; x < add.size(); x++)
{
ValueMetaInterface v = add.getValueMeta(x);
ValueMetaInterface s = row.searchValueMeta(v.getName());
if (s == null)
{
row.addValueMeta(v);
}
}
}
}
return row;
}
示例12: getSQLStatements
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public SQLStatement getSQLStatements(TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev) throws KettleStepException
{
SQLStatement retval = new SQLStatement(stepMeta.getName(), databaseMeta, null); // default: nothing to do!
if (databaseMeta!=null)
{
if (prev!=null && prev.size()>0)
{
// Copy the row
RowMetaInterface tableFields = new RowMeta();
// Now change the field names
for (int i=0;i<fieldTable.length;i++)
{
ValueMetaInterface v = prev.searchValueMeta(fieldStream[i]);
if (v!=null)
{
ValueMetaInterface tableField = v.clone();
tableField.setName(fieldTable[i]);
tableFields.addValueMeta(tableField);
}
else
{
throw new KettleStepException("Unable to find field ["+fieldStream[i]+"] in the input rows");
}
}
if (!Const.isEmpty(tableName))
{
Database db = new Database(loggingObject, databaseMeta);
db.shareVariablesWith(transMeta);
try
{
db.connect();
String schemaTable = databaseMeta.getQuotedSchemaTableCombination(transMeta.environmentSubstitute(schemaName),
transMeta.environmentSubstitute(tableName));
String sql = db.getDDL(schemaTable,
tableFields,
null,
false,
null,
true
);
if (Const.isEmpty(sql)) {
retval.setSQL(null);
} else {
retval.setSQL(sql);
}
}
catch(KettleException e)
{
retval.setError(BaseMessages.getString(PKG, "LucidDBBulkLoaderMeta.GetSQL.ErrorOccurred")+e.getMessage()); //$NON-NLS-1$
}
}
else
{
retval.setError(BaseMessages.getString(PKG, "LucidDBBulkLoaderMeta.GetSQL.NoTableDefinedOnConnection")); //$NON-NLS-1$
}
}
else
{
retval.setError(BaseMessages.getString(PKG, "LucidDBBulkLoaderMeta.GetSQL.NotReceivingAnyFields")); //$NON-NLS-1$
}
}
else
{
retval.setError(BaseMessages.getString(PKG, "LucidDBBulkLoaderMeta.GetSQL.NoConnectionDefined")); //$NON-NLS-1$
}
return retval;
}
示例13: getSQLStatements
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public SQLStatement getSQLStatements(TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev) throws KettleStepException
{
SQLStatement retval = new SQLStatement(stepMeta.getName(), databaseMeta, null); // default: nothing to do!
if (databaseMeta!=null)
{
if (prev!=null && prev.size()>0)
{
// Copy the row
RowMetaInterface tableFields = new RowMeta();
// Now change the field names
for (int i=0;i<fieldTable.length;i++)
{
ValueMetaInterface v = prev.searchValueMeta(fieldStream[i]);
if (v!=null)
{
ValueMetaInterface tableField = v.clone();
tableField.setName(fieldTable[i]);
tableFields.addValueMeta(tableField);
}
else
{
throw new KettleStepException("Unable to find field ["+fieldStream[i]+"] in the input rows");
}
}
if (!Const.isEmpty(tableName))
{
Database db = new Database(loggingObject, databaseMeta);
db.shareVariablesWith(transMeta);
try
{
db.connect();
String schemaTable = databaseMeta.getQuotedSchemaTableCombination(transMeta.environmentSubstitute(schemaName),
transMeta.environmentSubstitute(tableName));
String cr_table = db.getDDL(schemaTable,
tableFields,
null,
false,
null,
true
);
String sql = cr_table;
if (sql.length()==0) retval.setSQL(null); else retval.setSQL(sql);
}
catch(KettleException e)
{
retval.setError(BaseMessages.getString(PKG, "MySQLBulkLoaderMeta.GetSQL.ErrorOccurred")+e.getMessage()); //$NON-NLS-1$
}
}
else
{
retval.setError(BaseMessages.getString(PKG, "MySQLBulkLoaderMeta.GetSQL.NoTableDefinedOnConnection")); //$NON-NLS-1$
}
}
else
{
retval.setError(BaseMessages.getString(PKG, "MySQLBulkLoaderMeta.GetSQL.NotReceivingAnyFields")); //$NON-NLS-1$
}
}
else
{
retval.setError(BaseMessages.getString(PKG, "MySQLBulkLoaderMeta.GetSQL.NoConnectionDefined")); //$NON-NLS-1$
}
return retval;
}