use of org.pentaho.di.core.row.value.ValueMetaDate in project pentaho-kettle by pentaho.
the class MemoryGroupByMetaTest method getInputRowMeta.
private RowMetaInterface getInputRowMeta() {
RowMetaInterface rm = new RowMeta();
rm.addValueMeta(new ValueMetaString("myGroupField2"));
rm.addValueMeta(new ValueMetaString("myGroupField1"));
rm.addValueMeta(new ValueMetaString("myString"));
rm.addValueMeta(new ValueMetaInteger("myInteger"));
rm.addValueMeta(new ValueMetaNumber("myNumber"));
rm.addValueMeta(new ValueMetaBigNumber("myBigNumber"));
rm.addValueMeta(new ValueMetaBinary("myBinary"));
rm.addValueMeta(new ValueMetaBoolean("myBoolean"));
rm.addValueMeta(new ValueMetaDate("myDate"));
rm.addValueMeta(new ValueMetaTimestamp("myTimestamp"));
rm.addValueMeta(new ValueMetaInternetAddress("myInternetAddress"));
return rm;
}
use of org.pentaho.di.core.row.value.ValueMetaDate in project pentaho-kettle by pentaho.
the class NullIfTest method getInputRowMeta2.
private RowMeta getInputRowMeta2() {
RowMeta inputRowMeta = new RowMeta();
ValueMetaDate vmd1 = new ValueMetaDate("value1");
vmd1.setConversionMask("yyyyMMdd");
inputRowMeta.addValueMeta(vmd1);
ValueMetaDate vmd2 = new ValueMetaDate("value2");
vmd2.setConversionMask("yyyy/MM/dd HH:mm:ss.SSS");
inputRowMeta.addValueMeta(vmd2);
ValueMetaDate vmd3 = new ValueMetaDate("value3");
vmd3.setConversionMask("yyyyMMdd");
inputRowMeta.addValueMeta(vmd3);
ValueMetaDate vmd4 = new ValueMetaDate("value4");
vmd4.setConversionMask("yyyy/MM/dd HH:mm:ss.SSS");
inputRowMeta.addValueMeta(vmd4);
return inputRowMeta;
}
use of org.pentaho.di.core.row.value.ValueMetaDate in project pentaho-kettle by pentaho.
the class GroupByMetaGetFieldsTest method getFieldsWithSubject_NoFormat.
@Test
public void getFieldsWithSubject_NoFormat() {
ValueMetaDate valueMeta = new ValueMetaDate();
valueMeta.setName("date");
doReturn(valueMeta).when(rowMeta).searchValueMeta("date");
groupByMeta.setSubjectField(new String[] { "date" });
groupByMeta.setGroupField(new String[] {});
groupByMeta.setAggregateField(new String[] { "minDate" });
groupByMeta.setAggregateType(new int[] { TYPE_GROUP_MIN });
groupByMeta.getFields(rowMeta, "Group by", mockInfo, mockNextStep, mockSpace, null, mockIMetaStore);
verify(rowMeta, times(1)).clear();
verify(rowMeta, times(1)).addRowMeta(any());
assertEquals(null, rowMeta.searchValueMeta("minDate").getConversionMask());
}
use of org.pentaho.di.core.row.value.ValueMetaDate in project pentaho-kettle by pentaho.
the class GroupByMetaGetFieldsTest method getFieldsWithSubject_WithFormat.
@Test
public void getFieldsWithSubject_WithFormat() {
ValueMetaDate valueMeta = new ValueMetaDate();
valueMeta.setConversionMask("yyyy-MM-dd");
valueMeta.setName("date");
doReturn(valueMeta).when(rowMeta).searchValueMeta("date");
groupByMeta.setSubjectField(new String[] { "date" });
groupByMeta.setGroupField(new String[] {});
groupByMeta.setAggregateField(new String[] { "maxDate" });
groupByMeta.setAggregateType(new int[] { TYPE_GROUP_MAX });
groupByMeta.getFields(rowMeta, "Group by", mockInfo, mockNextStep, mockSpace, null, mockIMetaStore);
verify(rowMeta, times(1)).clear();
verify(rowMeta, times(1)).addRowMeta(any());
assertEquals("yyyy-MM-dd", rowMeta.searchValueMeta("maxDate").getConversionMask());
}
use of org.pentaho.di.core.row.value.ValueMetaDate in project pentaho-kettle by pentaho.
the class GroupByMetaGetFieldsTest method getFieldsWithoutSubject.
@Test
public void getFieldsWithoutSubject() {
ValueMetaDate valueMeta = new ValueMetaDate();
valueMeta.setName("date");
doReturn(valueMeta).when(rowMeta).searchValueMeta("date");
groupByMeta.setSubjectField(new String[] { null });
groupByMeta.setGroupField(new String[] { "date" });
groupByMeta.setAggregateField(new String[] { "countDate" });
groupByMeta.setAggregateType(new int[] { TYPE_GROUP_COUNT_ANY });
groupByMeta.getFields(rowMeta, "Group by", mockInfo, mockNextStep, mockSpace, null, mockIMetaStore);
verify(rowMeta, times(1)).clear();
verify(rowMeta, times(1)).addRowMeta(any());
assertNotNull(rowMeta.searchValueMeta("countDate"));
}
Aggregations