本文整理匯總了Java中org.pentaho.di.core.row.RowMetaInterface.removeValueMeta方法的典型用法代碼示例。如果您正苦於以下問題:Java RowMetaInterface.removeValueMeta方法的具體用法?Java RowMetaInterface.removeValueMeta怎麽用?Java RowMetaInterface.removeValueMeta使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.pentaho.di.core.row.RowMetaInterface
的用法示例。
在下文中一共展示了RowMetaInterface.removeValueMeta方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface row, String origin, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
{
ValueMetaInterface v=new ValueMeta(technicalKeyField, ValueMetaInterface.TYPE_INTEGER);
v.setLength(10);
v.setPrecision(0);
v.setOrigin(origin);
row.addValueMeta(v);
if (replaceFields)
{
for (int i=0;i<keyField.length;i++)
{
int idx = row.indexOfValue(keyField[i]);
if (idx>=0)
{
row.removeValueMeta(idx);
}
}
}
}
示例2: getDeleteFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getDeleteFields(RowMetaInterface inputRowMeta) throws KettleStepException
{
if (deleteName!=null && deleteName.length>0) // DESELECT values from the stream...
{
for (int i=0;i<deleteName.length;i++)
{
try
{
inputRowMeta.removeValueMeta(deleteName[i]);
}
catch (KettleValueException e)
{
throw new KettleStepException(e);
}
}
}
}
示例3: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
@Override
public void getFields(RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException {
// Remove the key value (there will be different entries for each output row)
//
if (fieldName != null && fieldName.length() > 0)
{
int idx = row.indexOfValue(fieldName);
if (idx < 0) {
throw new KettleStepException(Messages.getString("FlattenerMeta.Exception.UnableToLocateFieldInInputFields", fieldName )); //$NON-NLS-1$ //$NON-NLS-2$
}
ValueMetaInterface v = row.getValueMeta(idx);
row.removeValueMeta(idx);
for (int i=0;i<targetField.length;i++)
{
ValueMetaInterface value = v.clone();
value.setName(targetField[i]);
value.setOrigin(name);
row.addValueMeta(value);
}
}
else
{
throw new KettleStepException(Messages.getString("FlattenerMeta.Exception.FlattenFieldRequired")); //$NON-NLS-1$
}
}
示例4: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
@Override
public void getFields(RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException {
// Remove the key value (there will be different entries for each output row)
//
if (fieldName != null && fieldName.length() > 0)
{
int idx = row.indexOfValue(fieldName);
if (idx < 0) {
throw new KettleStepException(BaseMessages.getString(PKG, "FlattenerMeta.Exception.UnableToLocateFieldInInputFields", fieldName )); //$NON-NLS-1$ //$NON-NLS-2$
}
ValueMetaInterface v = row.getValueMeta(idx);
row.removeValueMeta(idx);
for (int i=0;i<targetField.length;i++)
{
ValueMetaInterface value = v.clone();
value.setName(targetField[i]);
value.setOrigin(name);
row.addValueMeta(value);
}
}
else
{
throw new KettleStepException(BaseMessages.getString(PKG, "FlattenerMeta.Exception.FlattenFieldRequired")); //$NON-NLS-1$
}
}
示例5: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
/***
* This Method overwrittes the fields and makes all field outputs as String
* <br>
* <i>The Params are defined from the parent class, but not all
* used</i></br>
* <b>Only for internal Use from the Pentaho Project</b> {@inheritDoc}
*
* @author Florian Wiedner
* @category Storage
* @since 1.5
* @param r
* RowMetaInterface The RowMetaInterface generated for this step
* @param origin
* String The origin (Not used)
* @param info
* RowMetaInterface[] The MetaInterfaces of the previous Steps
* @param nextStep
* StepMeta (Not used)
* @param space
* VariableSpace (not used)
* @see org.pentaho.di.trans.step.BaseStepMeta#getFields()
*/
public void getFields(RowMetaInterface r, String origin, RowMetaInterface[] info, StepMeta nextStep,
VariableSpace space) {
String[] fieldNames = r.getFieldNames();
for (int i = 0; i < fieldNames.length; i++) {
ValueMetaInterface temp = r.getValueMeta(i);
temp.getLength();
ValueMeta temp2 = new ValueMeta(fieldNames[i], ValueMeta.getType("String"), temp.getLength(),
temp.getPrecision());
try {
r.removeValueMeta(fieldNames[i]);
r.addValueMeta(i, temp2);
} catch (KettleValueException e) {
logError("Unexpected error : " + e.toString());
logError(Const.getStackTracker(e));
}
}
}
示例6: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
@Override
public void getFields(RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep,
VariableSpace space) throws KettleStepException {
// Get a unique list of the occurrences of the type
//
List<String> norm_occ = new ArrayList<String>();
List<String> field_occ = new ArrayList<String>();
int maxlen=0;
for (int i=0;i<fieldNorm.length;i++)
{
if (!norm_occ.contains(fieldNorm[i]))
{
norm_occ.add(fieldNorm[i]);
field_occ.add(fieldName[i]);
}
if (fieldValue[i].length()>maxlen) maxlen=fieldValue[i].length();
}
// Then add the type field!
//
ValueMetaInterface typefield_value = new ValueMeta(typeField, ValueMetaInterface.TYPE_STRING);
typefield_value.setOrigin(name);
typefield_value.setLength(maxlen);
row.addValueMeta(typefield_value);
// Loop over the distinct list of fieldNorm[i]
// Add the new fields that need to be created.
// Use the same data type as the original fieldname...
//
for (int i=0;i<norm_occ.size();i++)
{
String normname = (String)norm_occ.get(i);
String fieldname =(String)field_occ.get(i);
ValueMetaInterface v = row.searchValueMeta(fieldname).clone();
v.setName(normname);
v.setOrigin(name);
row.addValueMeta(v);
}
// Now remove all the normalized fields...
//
for (int i=0;i<fieldName.length;i++) {
int idx = row.indexOfValue(fieldName[i]);
if (idx>=0) row.removeValueMeta(idx);
}
}