Skip to content

Commit

Permalink
[CLEANUP] Remove ValueMeta
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewtckr committed Dec 21, 2016
1 parent 0698067 commit e013941
Show file tree
Hide file tree
Showing 72 changed files with 534 additions and 370 deletions.
12 changes: 10 additions & 2 deletions core/src/org/pentaho/di/core/RowMetaAndData.java
Expand Up @@ -25,13 +25,15 @@
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;


import org.pentaho.di.core.exception.KettlePluginException;
import org.pentaho.di.core.exception.KettleValueException; import org.pentaho.di.core.exception.KettleValueException;
import org.pentaho.di.core.injection.InjectionTypeConverter; import org.pentaho.di.core.injection.InjectionTypeConverter;
import org.pentaho.di.core.row.RowDataUtil; import org.pentaho.di.core.row.RowDataUtil;
import org.pentaho.di.core.row.RowMeta; import org.pentaho.di.core.row.RowMeta;
import org.pentaho.di.core.row.RowMetaInterface; import org.pentaho.di.core.row.RowMetaInterface;
import org.pentaho.di.core.row.ValueMeta;
import org.pentaho.di.core.row.ValueMetaInterface; import org.pentaho.di.core.row.ValueMetaInterface;
import org.pentaho.di.core.row.value.ValueMetaFactory;
import org.pentaho.di.core.row.value.ValueMetaNone;
import org.pentaho.di.repository.LongObjectId; import org.pentaho.di.repository.LongObjectId;
import org.pentaho.di.repository.ObjectId; import org.pentaho.di.repository.ObjectId;


Expand Down Expand Up @@ -134,7 +136,13 @@ public void addValue( ValueMetaInterface valueMeta, Object valueData ) {
} }


public void addValue( String valueName, int valueType, Object valueData ) { public void addValue( String valueName, int valueType, Object valueData ) {
addValue( new ValueMeta( valueName, valueType ), valueData ); ValueMetaInterface v;
try {
v = ValueMetaFactory.createValueMeta( valueName, valueType );
} catch ( KettlePluginException e ) {
v = new ValueMetaNone( valueName );
}
addValue( v, valueData );
} }


public void clear() { public void clear() {
Expand Down
Expand Up @@ -41,6 +41,7 @@
import org.pentaho.di.core.row.RowMetaInterface; import org.pentaho.di.core.row.RowMetaInterface;
import org.pentaho.di.core.row.ValueMetaInterface; import org.pentaho.di.core.row.ValueMetaInterface;
import org.pentaho.di.core.row.value.ValueMetaNone; import org.pentaho.di.core.row.value.ValueMetaNone;
import org.pentaho.di.core.row.value.ValueMetaPluginType;


import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
Expand All @@ -60,17 +61,14 @@ public class DatabaseMetaTest {
private static final String DROP_STATEMENT = "dropStatement"; private static final String DROP_STATEMENT = "dropStatement";
private static final String DROP_STATEMENT_FALLBACK = "DROP TABLE IF EXISTS " + TABLE_NAME; private static final String DROP_STATEMENT_FALLBACK = "DROP TABLE IF EXISTS " + TABLE_NAME;


private static final String CONNECTION_TYPE_ID_MSSQL = "MSSQL";
private static final String CONNECTION_TYPE_ID_MSSQL_NATIVE = "MSSQLNATIVE";
private static final String CONNECTION_TYPE_ID_ORACLE = "ORACLE";

private DatabaseMeta databaseMeta; private DatabaseMeta databaseMeta;
private DatabaseInterface databaseInterface; private DatabaseInterface databaseInterface;


@BeforeClass @BeforeClass
public static void setUpOnce() throws KettlePluginException { public static void setUpOnce() throws KettlePluginException {
// Register Natives to create a default DatabaseMeta // Register Natives to create a default DatabaseMeta
DatabasePluginType.getInstance().searchPlugins(); DatabasePluginType.getInstance().searchPlugins();
ValueMetaPluginType.getInstance().searchPlugins();
} }


@Before @Before
Expand Down
Expand Up @@ -24,7 +24,6 @@


import org.pentaho.di.core.RowMetaAndData; import org.pentaho.di.core.RowMetaAndData;
import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.row.ValueMeta;
import org.pentaho.di.core.row.ValueMetaAndData; import org.pentaho.di.core.row.ValueMetaAndData;
import org.pentaho.di.core.row.ValueMetaInterface; import org.pentaho.di.core.row.ValueMetaInterface;
import org.pentaho.di.core.row.value.ValueMetaFactory; import org.pentaho.di.core.row.value.ValueMetaFactory;
Expand Down Expand Up @@ -55,7 +54,8 @@ public ValueMetaAndData loadValueMetaAndData( ObjectId id_value ) throws KettleE
int valtype = ValueMetaFactory.getIdForValueMeta( int valtype = ValueMetaFactory.getIdForValueMeta(
r.getString( KettleDatabaseRepository.FIELD_VALUE_VALUE_TYPE, null ) ); r.getString( KettleDatabaseRepository.FIELD_VALUE_VALUE_TYPE, null ) );
boolean isNull = r.getBoolean( KettleDatabaseRepository.FIELD_VALUE_IS_NULL, false ); boolean isNull = r.getBoolean( KettleDatabaseRepository.FIELD_VALUE_IS_NULL, false );
valueMetaAndData.setValueMeta( new ValueMeta( name, valtype ) ); ValueMetaInterface v = ValueMetaFactory.createValueMeta( name, valtype );
valueMetaAndData.setValueMeta( v );


if ( isNull ) { if ( isNull ) {
valueMetaAndData.setValueData( null ); valueMetaAndData.setValueData( null );
Expand Down Expand Up @@ -84,7 +84,7 @@ public ValueMetaAndData loadValueMetaAndData( ObjectId id_value ) throws KettleE
// OK, now comes the dirty part... // OK, now comes the dirty part...
// We want the defaults back on there... // We want the defaults back on there...
// //
valueMeta = new ValueMeta( name, valueMeta.getType() ); valueMeta = ValueMetaFactory.createValueMeta( name, valueMeta.getType() );
} }
} }


Expand Down
Expand Up @@ -34,17 +34,18 @@
import org.pentaho.di.core.util.Utils; import org.pentaho.di.core.util.Utils;
import org.pentaho.di.core.database.DatabaseMeta; import org.pentaho.di.core.database.DatabaseMeta;
import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.exception.KettlePluginException;
import org.pentaho.di.core.exception.KettleStepException; import org.pentaho.di.core.exception.KettleStepException;
import org.pentaho.di.core.exception.KettleXMLException; import org.pentaho.di.core.exception.KettleXMLException;
import org.pentaho.di.core.fileinput.FileInputList; import org.pentaho.di.core.fileinput.FileInputList;
import org.pentaho.di.core.row.RowMetaInterface; import org.pentaho.di.core.row.RowMetaInterface;
import org.pentaho.di.core.row.ValueMeta;
import org.pentaho.di.core.row.ValueMetaAndData; import org.pentaho.di.core.row.ValueMetaAndData;
import org.pentaho.di.core.row.ValueMetaInterface; import org.pentaho.di.core.row.ValueMetaInterface;
import org.pentaho.di.core.row.value.ValueMetaBoolean; import org.pentaho.di.core.row.value.ValueMetaBoolean;
import org.pentaho.di.core.row.value.ValueMetaDate; import org.pentaho.di.core.row.value.ValueMetaDate;
import org.pentaho.di.core.row.value.ValueMetaFactory; import org.pentaho.di.core.row.value.ValueMetaFactory;
import org.pentaho.di.core.row.value.ValueMetaInteger; import org.pentaho.di.core.row.value.ValueMetaInteger;
import org.pentaho.di.core.row.value.ValueMetaNone;
import org.pentaho.di.core.row.value.ValueMetaString; import org.pentaho.di.core.row.value.ValueMetaString;
import org.pentaho.di.core.variables.VariableSpace; import org.pentaho.di.core.variables.VariableSpace;
import org.pentaho.di.core.vfs.KettleVFS; import org.pentaho.di.core.vfs.KettleVFS;
Expand Down Expand Up @@ -855,7 +856,12 @@ public void getFields( RowMetaInterface r, String name, RowMetaInterface[] info,
if ( type == ValueMetaInterface.TYPE_NONE ) { if ( type == ValueMetaInterface.TYPE_NONE ) {
type = ValueMetaInterface.TYPE_STRING; type = ValueMetaInterface.TYPE_STRING;
} }
ValueMetaInterface v = new ValueMeta( space.environmentSubstitute( field.getName() ), type ); ValueMetaInterface v;
try {
v = ValueMetaFactory.createValueMeta( space.environmentSubstitute( field.getName() ), type );
} catch ( KettlePluginException e ) {
v = new ValueMetaNone( space.environmentSubstitute( field.getName() ) );
}
v.setLength( field.getLength() ); v.setLength( field.getLength() );
v.setPrecision( field.getPrecision() ); v.setPrecision( field.getPrecision() );
v.setOrigin( name ); v.setOrigin( name );
Expand Down Expand Up @@ -1317,7 +1323,12 @@ public static ValueMetaAndData getValueMetaAndData( Column c, String name, Objec
break; break;
} }


ValueMetaInterface sourceValueMeta = new ValueMeta( name == null ? c.getName() : name, sourceValueType ); ValueMetaInterface sourceValueMeta;
try {
sourceValueMeta = ValueMetaFactory.createValueMeta( name == null ? c.getName() : name, sourceValueType );
} catch ( KettlePluginException e ) {
sourceValueMeta = new ValueMetaNone( name == null ? c.getName() : name );
}
sourceValueMeta.setLength( c.getLength(), c.getPrecision() ); sourceValueMeta.setLength( c.getLength(), c.getPrecision() );


// set value meta data and return it // set value meta data and return it
Expand Down
Expand Up @@ -31,13 +31,14 @@
import org.pentaho.di.core.database.DatabaseMeta; import org.pentaho.di.core.database.DatabaseMeta;
import org.pentaho.di.core.exception.KettleDatabaseException; import org.pentaho.di.core.exception.KettleDatabaseException;
import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.exception.KettlePluginException;
import org.pentaho.di.core.exception.KettleStepException; import org.pentaho.di.core.exception.KettleStepException;
import org.pentaho.di.core.exception.KettleXMLException; import org.pentaho.di.core.exception.KettleXMLException;
import org.pentaho.di.core.row.RowMeta; import org.pentaho.di.core.row.RowMeta;
import org.pentaho.di.core.row.RowMetaInterface; import org.pentaho.di.core.row.RowMetaInterface;
import org.pentaho.di.core.row.ValueMeta;
import org.pentaho.di.core.row.ValueMetaInterface; import org.pentaho.di.core.row.ValueMetaInterface;
import org.pentaho.di.core.row.value.ValueMetaFactory; import org.pentaho.di.core.row.value.ValueMetaFactory;
import org.pentaho.di.core.row.value.ValueMetaNone;
import org.pentaho.di.core.variables.VariableSpace; import org.pentaho.di.core.variables.VariableSpace;
import org.pentaho.di.core.xml.XMLHandler; import org.pentaho.di.core.xml.XMLHandler;
import org.pentaho.di.i18n.BaseMessages; import org.pentaho.di.i18n.BaseMessages;
Expand Down Expand Up @@ -528,7 +529,13 @@ public RowMetaInterface getTableFields() {
// //
RowMetaInterface param = new RowMeta(); RowMetaInterface param = new RowMeta();
for ( int i = 0; i < parameterField.length; i++ ) { for ( int i = 0; i < parameterField.length; i++ ) {
param.addValueMeta( new ValueMeta( parameterField[i], parameterType[i] ) ); ValueMetaInterface v;
try {
v = ValueMetaFactory.createValueMeta( parameterField[i], parameterType[i] );
} catch ( KettlePluginException e ) {
v = new ValueMetaNone( parameterField[i] );
}
param.addValueMeta( v );
} }


RowMetaInterface fields = null; RowMetaInterface fields = null;
Expand Down
52 changes: 33 additions & 19 deletions engine/src/org/pentaho/di/trans/steps/dbproc/DBProcMeta.java
Expand Up @@ -31,11 +31,13 @@
import org.pentaho.di.core.database.Database; import org.pentaho.di.core.database.Database;
import org.pentaho.di.core.database.DatabaseMeta; import org.pentaho.di.core.database.DatabaseMeta;
import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.exception.KettlePluginException;
import org.pentaho.di.core.exception.KettleStepException; import org.pentaho.di.core.exception.KettleStepException;
import org.pentaho.di.core.exception.KettleXMLException; import org.pentaho.di.core.exception.KettleXMLException;
import org.pentaho.di.core.row.RowMetaInterface; import org.pentaho.di.core.row.RowMetaInterface;
import org.pentaho.di.core.row.ValueMeta;
import org.pentaho.di.core.row.ValueMetaInterface; import org.pentaho.di.core.row.ValueMetaInterface;
import org.pentaho.di.core.row.value.ValueMetaBase;
import org.pentaho.di.core.row.value.ValueMetaFactory;
import org.pentaho.di.core.variables.VariableSpace; import org.pentaho.di.core.variables.VariableSpace;
import org.pentaho.di.core.xml.XMLHandler; import org.pentaho.di.core.xml.XMLHandler;
import org.pentaho.di.i18n.BaseMessages; import org.pentaho.di.i18n.BaseMessages;
Expand Down Expand Up @@ -257,16 +259,26 @@ public void getFields( RowMetaInterface r, String name, RowMetaInterface[] info,
VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {


if ( !Utils.isEmpty( resultName ) ) { if ( !Utils.isEmpty( resultName ) ) {
ValueMetaInterface v = new ValueMeta( resultName, resultType ); ValueMetaInterface v;
v.setOrigin( name ); try {
r.addValueMeta( v ); v = ValueMetaFactory.createValueMeta( resultName, resultType );
v.setOrigin( name );
r.addValueMeta( v );
} catch ( KettlePluginException e ) {
throw new KettleStepException( e );
}
} }


for ( int i = 0; i < argument.length; i++ ) { for ( int i = 0; i < argument.length; i++ ) {
if ( argumentDirection[i].equalsIgnoreCase( "OUT" ) ) { if ( argumentDirection[i].equalsIgnoreCase( "OUT" ) ) {
ValueMetaInterface v = new ValueMeta( argument[i], argumentType[i] ); ValueMetaInterface v;
v.setOrigin( name ); try {
r.addValueMeta( v ); v = ValueMetaFactory.createValueMeta( argument[i], argumentType[i] );
v.setOrigin( name );
r.addValueMeta( v );
} catch ( KettlePluginException e ) {
throw new KettleStepException( e );
}
} }
} }


Expand All @@ -286,15 +298,16 @@ public String getXML() {
retval.append( " " ).append( XMLHandler.addTagValue( "name", argument[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "name", argument[i] ) );
retval.append( " " ).append( XMLHandler.addTagValue( "direction", argumentDirection[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "direction", argumentDirection[i] ) );
retval.append( " " ).append( retval.append( " " ).append(
XMLHandler.addTagValue( "type", ValueMeta.getTypeDesc( argumentType[i] ) ) ); XMLHandler.addTagValue( "type", ValueMetaFactory.getValueMetaName( argumentType[i] ) ) );
retval.append( " </arg>" ).append( Const.CR ); retval.append( " </arg>" ).append( Const.CR );
} }


retval.append( " </lookup>" ).append( Const.CR ); retval.append( " </lookup>" ).append( Const.CR );


retval.append( " <result>" ).append( Const.CR ); retval.append( " <result>" ).append( Const.CR );
retval.append( " " ).append( XMLHandler.addTagValue( "name", resultName ) ); retval.append( " " ).append( XMLHandler.addTagValue( "name", resultName ) );
retval.append( " " ).append( XMLHandler.addTagValue( "type", ValueMeta.getTypeDesc( resultType ) ) ); retval.append( " " ).append( XMLHandler.addTagValue( "type",
ValueMetaFactory.getValueMetaName( resultType ) ) );
retval.append( " </result>" ).append( Const.CR ); retval.append( " </result>" ).append( Const.CR );


retval.append( " " ).append( XMLHandler.addTagValue( "auto_commit", autoCommit ) ); retval.append( " " ).append( XMLHandler.addTagValue( "auto_commit", autoCommit ) );
Expand All @@ -321,12 +334,12 @@ private void readData( Node stepnode, List<? extends SharedObjectInterface> data


argument[i] = XMLHandler.getTagValue( anode, "name" ); argument[i] = XMLHandler.getTagValue( anode, "name" );
argumentDirection[i] = XMLHandler.getTagValue( anode, "direction" ); argumentDirection[i] = XMLHandler.getTagValue( anode, "direction" );
argumentType[i] = ValueMeta.getType( XMLHandler.getTagValue( anode, "type" ) ); argumentType[i] = ValueMetaFactory.getIdForValueMeta( XMLHandler.getTagValue( anode, "type" ) );
} }


resultName = XMLHandler.getTagValue( stepnode, "result", "name" ); // Optional, can be null resultName = XMLHandler.getTagValue( stepnode, "result", "name" ); // Optional, can be null
// //
resultType = ValueMeta.getType( XMLHandler.getTagValue( stepnode, "result", "type" ) ); resultType = ValueMetaFactory.getIdForValueMeta( XMLHandler.getTagValue( stepnode, "result", "type" ) );
autoCommit = !"N".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, "auto_commit" ) ); autoCommit = !"N".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, "auto_commit" ) );
} catch ( Exception e ) { } catch ( Exception e ) {
throw new KettleXMLException( BaseMessages.getString( PKG, "DBProcMeta.Exception.UnableToReadStepInfo" ), e ); throw new KettleXMLException( BaseMessages.getString( PKG, "DBProcMeta.Exception.UnableToReadStepInfo" ), e );
Expand All @@ -344,11 +357,11 @@ public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, Lis
for ( int i = 0; i < nrargs; i++ ) { for ( int i = 0; i < nrargs; i++ ) {
argument[i] = rep.getStepAttributeString( id_step, i, "arg_name" ); argument[i] = rep.getStepAttributeString( id_step, i, "arg_name" );
argumentDirection[i] = rep.getStepAttributeString( id_step, i, "arg_direction" ); argumentDirection[i] = rep.getStepAttributeString( id_step, i, "arg_direction" );
argumentType[i] = ValueMeta.getType( rep.getStepAttributeString( id_step, i, "arg_type" ) ); argumentType[i] = ValueMetaFactory.getIdForValueMeta( rep.getStepAttributeString( id_step, i, "arg_type" ) );
} }


resultName = rep.getStepAttributeString( id_step, "result_name" ); resultName = rep.getStepAttributeString( id_step, "result_name" );
resultType = ValueMeta.getType( rep.getStepAttributeString( id_step, "result_type" ) ); resultType = ValueMetaFactory.getIdForValueMeta( rep.getStepAttributeString( id_step, "result_type" ) );
autoCommit = rep.getStepAttributeBoolean( id_step, 0, "auto_commit", true ); autoCommit = rep.getStepAttributeBoolean( id_step, 0, "auto_commit", true );
} catch ( Exception e ) { } catch ( Exception e ) {
throw new KettleException( BaseMessages.getString( throw new KettleException( BaseMessages.getString(
Expand All @@ -364,12 +377,13 @@ public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transform
for ( int i = 0; i < argument.length; i++ ) { for ( int i = 0; i < argument.length; i++ ) {
rep.saveStepAttribute( id_transformation, id_step, i, "arg_name", argument[i] ); rep.saveStepAttribute( id_transformation, id_step, i, "arg_name", argument[i] );
rep.saveStepAttribute( id_transformation, id_step, i, "arg_direction", argumentDirection[i] ); rep.saveStepAttribute( id_transformation, id_step, i, "arg_direction", argumentDirection[i] );
rep rep.saveStepAttribute( id_transformation, id_step, i, "arg_type",
.saveStepAttribute( id_transformation, id_step, i, "arg_type", ValueMeta.getTypeDesc( argumentType[i] ) ); ValueMetaFactory.getValueMetaName( argumentType[i] ) );
} }


rep.saveStepAttribute( id_transformation, id_step, "result_name", resultName ); rep.saveStepAttribute( id_transformation, id_step, "result_name", resultName );
rep.saveStepAttribute( id_transformation, id_step, "result_type", ValueMeta.getTypeDesc( resultType ) ); rep.saveStepAttribute( id_transformation, id_step, "result_type",
ValueMetaFactory.getValueMetaName( resultType ) );
rep.saveStepAttribute( id_transformation, id_step, "auto_commit", autoCommit ); rep.saveStepAttribute( id_transformation, id_step, "auto_commit", autoCommit );


// Also, save the step-database relationship! // Also, save the step-database relationship!
Expand Down Expand Up @@ -412,14 +426,14 @@ public void check( List<CheckResultInterface> remarks, TransMeta transMeta, Step
} else { } else {
// Argument exists in input stream: same type? // Argument exists in input stream: same type?


if ( v.getType() != argumentType[i] && !( v.isNumeric() && ValueMeta.isNumeric( argumentType[i] ) ) ) { if ( v.getType() != argumentType[i] && !( v.isNumeric() && ValueMetaBase.isNumeric( argumentType[i] ) ) ) {
error_found = true; error_found = true;
error_message += error_message +=
"\t\t" "\t\t"
+ argument[i] + argument[i]
+ BaseMessages.getString( + BaseMessages.getString(
PKG, "DBProcMeta.CheckResult.WrongTypeArguments", v.getTypeDesc(), ValueMeta PKG, "DBProcMeta.CheckResult.WrongTypeArguments", v.getTypeDesc(),
.getTypeDesc( argumentType[i] ) ) + Const.CR; ValueMetaFactory.getValueMetaName( argumentType[i] ) ) + Const.CR;
} }
} }
} }
Expand Down
Expand Up @@ -33,6 +33,7 @@
import org.pentaho.di.core.util.Utils; import org.pentaho.di.core.util.Utils;
import org.pentaho.di.core.database.DatabaseMeta; import org.pentaho.di.core.database.DatabaseMeta;
import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.exception.KettlePluginException;
import org.pentaho.di.core.exception.KettleStepException; import org.pentaho.di.core.exception.KettleStepException;
import org.pentaho.di.core.exception.KettleXMLException; import org.pentaho.di.core.exception.KettleXMLException;
import org.pentaho.di.core.fileinput.FileInputList; import org.pentaho.di.core.fileinput.FileInputList;
Expand All @@ -41,12 +42,12 @@
import org.pentaho.di.core.injection.InjectionSupported; import org.pentaho.di.core.injection.InjectionSupported;
import org.pentaho.di.core.row.RowMeta; import org.pentaho.di.core.row.RowMeta;
import org.pentaho.di.core.row.RowMetaInterface; import org.pentaho.di.core.row.RowMetaInterface;
import org.pentaho.di.core.row.ValueMeta;
import org.pentaho.di.core.row.ValueMetaInterface; import org.pentaho.di.core.row.ValueMetaInterface;
import org.pentaho.di.core.row.value.ValueMetaBoolean; import org.pentaho.di.core.row.value.ValueMetaBoolean;
import org.pentaho.di.core.row.value.ValueMetaDate; import org.pentaho.di.core.row.value.ValueMetaDate;
import org.pentaho.di.core.row.value.ValueMetaFactory; import org.pentaho.di.core.row.value.ValueMetaFactory;
import org.pentaho.di.core.row.value.ValueMetaInteger; import org.pentaho.di.core.row.value.ValueMetaInteger;
import org.pentaho.di.core.row.value.ValueMetaNone;
import org.pentaho.di.core.row.value.ValueMetaString; import org.pentaho.di.core.row.value.ValueMetaString;
import org.pentaho.di.core.variables.VariableSpace; import org.pentaho.di.core.variables.VariableSpace;
import org.pentaho.di.core.vfs.KettleVFS; import org.pentaho.di.core.vfs.KettleVFS;
Expand Down Expand Up @@ -1344,7 +1345,12 @@ public void check( List<CheckResultInterface> remarks, TransMeta transMeta, Step
public RowMetaInterface getEmptyFields() { public RowMetaInterface getEmptyFields() {
RowMetaInterface row = new RowMeta(); RowMetaInterface row = new RowMeta();
for ( int i = 0; i < field.length; i++ ) { for ( int i = 0; i < field.length; i++ ) {
ValueMetaInterface v = new ValueMeta( field[i].getName(), field[i].getType() ); ValueMetaInterface v;
try {
v = ValueMetaFactory.createValueMeta( field[i].getName(), field[i].getType() );
} catch ( KettlePluginException e ) {
v = new ValueMetaNone( field[i].getName() );
}
row.addValueMeta( v ); row.addValueMeta( v );
} }


Expand Down

0 comments on commit e013941

Please sign in to comment.