本文整理匯總了Java中org.pentaho.di.core.row.RowMetaInterface.mergeRowMeta方法的典型用法代碼示例。如果您正苦於以下問題:Java RowMetaInterface.mergeRowMeta方法的具體用法?Java RowMetaInterface.mergeRowMeta怎麽用?Java RowMetaInterface.mergeRowMeta使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.pentaho.di.core.row.RowMetaInterface
的用法示例。
在下文中一共展示了RowMetaInterface.mergeRowMeta方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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 {
if (info!=null && isPassingThruFields() && isFileNameInField){
boolean found=false;
for (int i=0;i<info.length && !found;i++){
if (info[i]!=null){
row.mergeRowMeta(info[i]);
found=true;
}
}
}
if (!isFileNameInField()){
FileInputList fileList = getFileList(space);
if (fileList.nrOfFiles()==0)
throw new KettleStepException(Messages.getString("KMLFileInputMeta.Exception.NoFilesFoundToProcess")); //$NON-NLS-1$
row.clear();
row.addRowMeta( getOutputFields(fileList, name));
}
}
示例2: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
{
// We don't have any input fields here in "r" as they are all info fields.
// So we just merge in the info fields.
//
if (info!=null)
{
boolean found=false;
for (int i=0;i<info.length && !found;i++)
{
if (info[i]!=null)
{
r.mergeRowMeta(info[i]);
found=true;
}
}
}
if (Const.isEmpty(flagField)) throw new KettleStepException(Messages.getString("MergeRowsMeta.Exception.FlagFieldNotSpecified"));
ValueMetaInterface flagFieldValue = new ValueMeta(flagField, ValueMetaInterface.TYPE_STRING);
flagFieldValue.setOrigin(name);
r.addValueMeta(flagFieldValue);
}
示例3: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException{
if (info!=null){
for (int i=0;i<info.length;i++){
if (info[i]!=null){
r.mergeRowMeta(info[i]);
}
}
}
// Output field (Geometry)
if (!Const.isEmpty(resultfieldName)) {
ValueMetaInterface v = new ValueMeta(space.environmentSubstitute(resultfieldName),
ValueMeta.TYPE_GEOMETRY);
v.setOrigin(name);
r.addValueMeta(v);
}
}
示例4: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
{
// We don't have any input fields here in "r" as they are all info fields.
// So we just merge in the info fields.
//
if (info!=null)
{
for (int i=0;i<info.length;i++)
{
if (info[i]!=null)
{
r.mergeRowMeta(info[i]);
}
}
}
for (int i=0;i<r.size();i++) r.getValueMeta(i).setOrigin(name);
return;
}
示例5: 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 {
if (info!=null && isPassingThruFields() && isFileNameInField){
boolean found=false;
for (int i=0;i<info.length && !found;i++){
if (info[i]!=null){
row.mergeRowMeta(info[i]);
found=true;
}
}
}
if (!isFileNameInField()){
FileInputList fileList = getFileList(space);
if (fileList.nrOfFiles()==0)
throw new KettleStepException(Messages.getString("GISFileInputMeta.Exception.NoFilesFoundToProcess")); //$NON-NLS-1$
row.clear();
row.addRowMeta( getOutputFields(fileList, name));
}
}
示例6: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface row, String origin, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
{
List<CheckResultInterface> remarks = new ArrayList<CheckResultInterface>();
RowMetaAndData rowMetaAndData = RowGenerator.buildRow(this, remarks, origin);
if (!remarks.isEmpty()) {
StringBuffer stringRemarks = new StringBuffer();
for (CheckResultInterface remark : remarks) {
stringRemarks.append(remark.toString()).append(Const.CR);
}
throw new KettleStepException(stringRemarks.toString());
}
for (ValueMetaInterface valueMeta : rowMetaAndData.getRowMeta().getValueMetaList()) {
valueMeta.setOrigin(origin);
}
row.mergeRowMeta(rowMetaAndData.getRowMeta());
}
示例7: 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 {
if (info!=null && isPassingThruFields() && isFileNameInField){
boolean found=false;
for (int i=0;i<info.length && !found;i++){
if (info[i]!=null){
row.mergeRowMeta(info[i]);
found=true;
}
}
}
if (!isFileNameInField()){
FileInputList fileList = getFileList(space);
if (fileList.nrOfFiles()==0)
throw new KettleStepException(Messages.getString("GMLFileInputMeta.Exception.NoFilesFoundToProcess")); //$NON-NLS-1$
row.clear();
row.addRowMeta( getOutputFields(fileList, name));
}
}
示例8: 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 {
if (info!=null && isPassingThruFields() && (isSourceInField || isLayerNameInField)){
boolean found=false;
for (int i=0;i<info.length && !found;i++){
if (info[i]!=null){
row.mergeRowMeta(info[i]);
found=true;
}
}
}
if (!isSourceInField() && !isLayerNameInField()){
FileInputList fileList = null;
List<String> cnxStrings = null;
if(isFileSource){
fileList = getFileList(space);
if (fileList.nrOfFiles()==0)
throw new KettleStepException(Messages.getString("OGRFileInputMeta.Exception.NoFilesFoundToProcess")); //$NON-NLS-1$
}else
cnxStrings = Arrays.asList(source);
List<String> layernames = Arrays.asList(layerName);
row.clear();
row.addRowMeta( getOutputFields(fileList, cnxStrings, layernames, name));
}
}
示例9: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
{
// We don't have any input fields here in "r" as they are all info fields.
// So we just merge in the info fields.
//
if (info!=null)
{
boolean found=false;
for (int i=0;i<info.length && !found;i++)
{
if (info[i]!=null)
{
r.mergeRowMeta(info[i]);
found=true;
}
}
}
if (Const.isEmpty(flagField)) throw new KettleStepException(BaseMessages.getString(PKG, "MergeRowsMeta.Exception.FlagFieldNotSpecified"));
ValueMetaInterface flagFieldValue = new ValueMeta(flagField, ValueMetaInterface.TYPE_STRING);
flagFieldValue.setOrigin(name);
r.addValueMeta(flagFieldValue);
}
示例10: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
// determine the maximum length
int length = -1;
for ( int i = 0; i < fieldName.length; i++ ) {
if ( variableName[ i ] != null ) {
String string = space.environmentSubstitute( variableName[ i ] );
if ( string.length() > length ) {
length = string.length();
}
}
}
RowMetaInterface row = new RowMeta();
for ( int i = 0; i < fieldName.length; i++ ) {
ValueMetaInterface valueMeta = new ValueMeta( fieldName[ i ], fieldType[ i ] );
if ( fieldLength[ i ] < 0 ) {
valueMeta.setLength( length );
} else {
valueMeta.setLength( fieldLength[ i ] );
}
if ( fieldPrecision[ i ] >= 0 ) {
valueMeta.setPrecision( fieldPrecision[ i ] );
}
valueMeta.setConversionMask( fieldFormat[ i ] );
valueMeta.setGroupingSymbol( group[ i ] );
valueMeta.setDecimalSymbol( decimal[ i ] );
valueMeta.setCurrencySymbol( currency[ i ] );
valueMeta.setTrimType( trimType[ i ] );
valueMeta.setOrigin( name );
row.addValueMeta( valueMeta );
}
inputRowMeta.mergeRowMeta( row );
}
示例11: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
{
RowMetaAndData add = ExecSQL.getResultRow(new Result(), getUpdateField(), getInsertField(), getDeleteField(),
getReadField());
r.mergeRowMeta(add.getRowMeta());
}
示例12: createOutputRowMeta
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
private RowMetaInterface createOutputRowMeta(RowMetaInterface[] fileRowMeta)
{
RowMetaInterface outputRowMeta = new RowMeta();
for (int i=0;i<data.fileRowMeta.length;i++)
{
outputRowMeta.mergeRowMeta(data.fileRowMeta[i]);
}
return outputRowMeta;
}
示例13: getStepFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public RowMetaInterface getStepFields(StepMeta[] stepMeta) throws KettleStepException
{
RowMetaInterface fields = new RowMeta();
for (int i = 0; i < stepMeta.length; i++)
{
RowMetaInterface flds = getStepFields(stepMeta[i]);
if (flds != null) fields.mergeRowMeta(flds);
}
return fields;
}
示例14: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space)
throws KettleStepException
{
GZIPInputStream fis = null;
DataInputStream dis = null;
try
{
InputStream is = KettleVFS.getInputStream(space.environmentSubstitute(filename), space);
fis = new GZIPInputStream(is);
dis = new DataInputStream(fis);
RowMetaInterface add = new RowMeta(dis);
for (int i=0;i<add.size();i++)
{
add.getValueMeta(i).setOrigin(name);
}
r.mergeRowMeta(add);
}
catch(KettleFileException kfe)
{
throw new KettleStepException(BaseMessages.getString(PKG, "CubeInputMeta.Exception.UnableToReadMetaData"), kfe); //$NON-NLS-1$
}
catch(IOException e)
{
throw new KettleStepException(BaseMessages.getString(PKG, "CubeInputMeta.Exception.ErrorOpeningOrReadingCubeFile"), e); //$NON-NLS-1$
}
finally
{
try
{
if (fis!=null) fis.close();
if (dis!=null) dis.close();
}
catch(IOException ioe)
{
throw new KettleStepException(BaseMessages.getString(PKG, "CubeInputMeta.Exception.UnableToCloseCubeFile"), ioe); //$NON-NLS-1$
}
}
}
示例15: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface r, String name, RowMetaInterface info[], StepMeta nextStep, VariableSpace space) throws KettleStepException
{
// We don't have any input fields here in "r" as they are all info fields.
// So we just take the info fields.
//
if (info!=null)
{
if ( info.length > 0 && info[0]!=null) {
r.mergeRowMeta(info[0]);
}
}
}