Search in sources :

Example 71 with ValueMetaNumber

use of org.pentaho.di.core.row.value.ValueMetaNumber in project pentaho-kettle by pentaho.

the class JsonInputTest method testChildDot.

@Test
public void testChildDot() throws Exception {
    final String jsonInputField = getBasicTestJson();
    testSimpleJsonPath("$.store.bicycle.color", new ValueMetaString("bcol"), new Object[][] { new Object[] { jsonInputField } }, new Object[][] { new Object[] { jsonInputField, "red" } });
    testSimpleJsonPath("$.store.bicycle.price", new ValueMetaNumber("p"), new Object[][] { new Object[] { jsonInputField } }, new Object[][] { new Object[] { jsonInputField, 19.95 } });
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) ValueMetaNumber(org.pentaho.di.core.row.value.ValueMetaNumber) ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) Test(org.junit.Test)

Example 72 with ValueMetaNumber

use of org.pentaho.di.core.row.value.ValueMetaNumber in project pentaho-kettle by pentaho.

the class BlockingStep_PDI_11344_Test method createRowMetaInterface.

private static RowMetaInterface createRowMetaInterface() {
    RowMetaInterface rm = new RowMeta();
    ValueMetaInterface[] valuesMeta = { new ValueMetaString("field1"), new ValueMetaInteger("field2"), new ValueMetaNumber("field3"), new ValueMetaDate("field4"), new ValueMetaBoolean("field5"), new ValueMetaBigNumber("field6"), new ValueMetaBigNumber("field7") };
    for (ValueMetaInterface aValuesMeta : valuesMeta) {
        rm.addValueMeta(aValuesMeta);
    }
    return rm;
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) RowMeta(org.pentaho.di.core.row.RowMeta) ValueMetaNumber(org.pentaho.di.core.row.value.ValueMetaNumber) ValueMetaBigNumber(org.pentaho.di.core.row.value.ValueMetaBigNumber) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ValueMetaInteger(org.pentaho.di.core.row.value.ValueMetaInteger) ValueMetaBoolean(org.pentaho.di.core.row.value.ValueMetaBoolean) ValueMetaDate(org.pentaho.di.core.row.value.ValueMetaDate) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Example 73 with ValueMetaNumber

use of org.pentaho.di.core.row.value.ValueMetaNumber in project pentaho-kettle by pentaho.

the class GroupByIntIT method getTestRowMetaAndData.

List<RowMetaAndData> getTestRowMetaAndData(int count, Integer[] nulls) {
    List<RowMetaAndData> list = new ArrayList<RowMetaAndData>();
    RowMetaInterface rm = new RowMeta();
    rm.addValueMeta(new ValueMetaString(KEY1));
    rm.addValueMeta(new ValueMetaInteger(KEY2));
    rm.addValueMeta(new ValueMetaNumber(KEY3));
    rm.addValueMeta(new ValueMetaBigNumber(KEY4));
    Object[] row = new Object[4];
    List<Integer> nullsList = Arrays.asList(nulls);
    for (int i = 0; i < count; i++) {
        if (nullsList.contains(i)) {
            for (int j = 0; j < row.length; j++) {
                row[j] = null;
            }
        } else {
            row[0] = "";
            row[1] = 1L;
            row[2] = 2.0;
            row[3] = new BigDecimal(3);
        }
        list.add(new RowMetaAndData(rm, row));
    }
    return list;
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) RowMeta(org.pentaho.di.core.row.RowMeta) ArrayList(java.util.ArrayList) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) BigDecimal(java.math.BigDecimal) ValueMetaInteger(org.pentaho.di.core.row.value.ValueMetaInteger) RowMetaAndData(org.pentaho.di.core.RowMetaAndData) ValueMetaNumber(org.pentaho.di.core.row.value.ValueMetaNumber) ValueMetaBigNumber(org.pentaho.di.core.row.value.ValueMetaBigNumber) ValueMetaInteger(org.pentaho.di.core.row.value.ValueMetaInteger)

Example 74 with ValueMetaNumber

use of org.pentaho.di.core.row.value.ValueMetaNumber in project pentaho-kettle by pentaho.

the class JaninoStepIT method createRowMetaInterface.

public RowMetaInterface createRowMetaInterface() {
    RowMetaInterface rm = new RowMeta();
    ValueMetaInterface[] valuesMeta = { new ValueMetaString("string"), new ValueMetaInteger("integer"), new ValueMetaNumber("number"), new ValueMetaBigNumber("bigdecimal"), new ValueMetaDate("date"), new ValueMetaBinary("binary"), new ValueMetaBoolean("bool"), new ValueMetaTimestamp("timestamp"), new ValueMetaInternetAddress("inetaddress") };
    for (int i = 0; i < valuesMeta.length; i++) {
        rm.addValueMeta(valuesMeta[i]);
    }
    return rm;
}
Also used : ValueMetaTimestamp(org.pentaho.di.core.row.value.ValueMetaTimestamp) ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) RowMeta(org.pentaho.di.core.row.RowMeta) ValueMetaInternetAddress(org.pentaho.di.core.row.value.ValueMetaInternetAddress) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ValueMetaBoolean(org.pentaho.di.core.row.value.ValueMetaBoolean) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface) ValueMetaBinary(org.pentaho.di.core.row.value.ValueMetaBinary) ValueMetaNumber(org.pentaho.di.core.row.value.ValueMetaNumber) ValueMetaBigNumber(org.pentaho.di.core.row.value.ValueMetaBigNumber) ValueMetaInteger(org.pentaho.di.core.row.value.ValueMetaInteger) ValueMetaDate(org.pentaho.di.core.row.value.ValueMetaDate)

Example 75 with ValueMetaNumber

use of org.pentaho.di.core.row.value.ValueMetaNumber in project pentaho-kettle by pentaho.

the class JavaScriptSpecialIT method createRowMetaInterface3.

public RowMetaInterface createRowMetaInterface3() {
    RowMetaInterface rm = new RowMeta();
    ValueMetaInterface[] valuesMeta = { new ValueMetaInteger("int_in"), new ValueMetaNumber("number_in"), new ValueMetaString("string_in") };
    for (int i = 0; i < valuesMeta.length; i++) {
        rm.addValueMeta(valuesMeta[i]);
    }
    return rm;
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) RowMeta(org.pentaho.di.core.row.RowMeta) ValueMetaNumber(org.pentaho.di.core.row.value.ValueMetaNumber) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ValueMetaInteger(org.pentaho.di.core.row.value.ValueMetaInteger) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Aggregations

ValueMetaNumber (org.pentaho.di.core.row.value.ValueMetaNumber)95 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)75 ValueMetaInteger (org.pentaho.di.core.row.value.ValueMetaInteger)52 Test (org.junit.Test)51 RowMeta (org.pentaho.di.core.row.RowMeta)39 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)34 ValueMetaDate (org.pentaho.di.core.row.value.ValueMetaDate)34 ValueMetaBoolean (org.pentaho.di.core.row.value.ValueMetaBoolean)32 ValueMetaBigNumber (org.pentaho.di.core.row.value.ValueMetaBigNumber)30 ValueMetaInterface (org.pentaho.di.core.row.ValueMetaInterface)25 ValueMetaBinary (org.pentaho.di.core.row.value.ValueMetaBinary)20 ValueMetaTimestamp (org.pentaho.di.core.row.value.ValueMetaTimestamp)16 ValueMetaInternetAddress (org.pentaho.di.core.row.value.ValueMetaInternetAddress)15 KettleException (org.pentaho.di.core.exception.KettleException)12 RowMetaAndData (org.pentaho.di.core.RowMetaAndData)11 KettleStepException (org.pentaho.di.core.exception.KettleStepException)7 ArrayList (java.util.ArrayList)6 Date (java.util.Date)6 RowSet (org.pentaho.di.core.RowSet)6 RowAdapter (org.pentaho.di.trans.step.RowAdapter)6