use of org.pentaho.di.core.row.value.ValueMetaDate 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;
}
use of org.pentaho.di.core.row.value.ValueMetaDate 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;
}
use of org.pentaho.di.core.row.value.ValueMetaDate in project pentaho-kettle by pentaho.
the class JavaScriptSpecialIT method createDateAddResultData.
public List<RowMetaAndData> createDateAddResultData() throws ParseException {
List<RowMetaAndData> list = new ArrayList<RowMetaAndData>();
// Create RowMeta
RowMetaInterface rm = new RowMeta();
rm.addValueMeta(new ValueMetaDate("input"));
rm.addValueMeta(new ValueMetaDate("new_weekday"));
rm.addValueMeta(new ValueMetaDate("new_year"));
rm.addValueMeta(new ValueMetaDate("new_month"));
rm.addValueMeta(new ValueMetaDate("new_week"));
rm.addValueMeta(new ValueMetaDate("new_day"));
rm.addValueMeta(new ValueMetaDate("new_hour"));
rm.addValueMeta(new ValueMetaDate("new_minute"));
rm.addValueMeta(new ValueMetaDate("new_second"));
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Object[] r1 = new Object[] { // input
format.parse("2014-01-01 00:00:00"), // weekday
format.parse("2014-01-06 00:00:00"), // year
format.parse("2019-01-01 00:00:00"), // month
format.parse("2014-06-01 00:00:00"), // week
format.parse("2014-02-05 00:00:00"), // day
format.parse("2014-01-06 00:00:00"), // hour
format.parse("2014-01-01 05:00:00"), // minute
format.parse("2014-01-01 00:05:00"), // second
format.parse("2014-01-01 00:00:05") };
list.add(new RowMetaAndData(rm, r1));
return list;
}
use of org.pentaho.di.core.row.value.ValueMetaDate in project pentaho-kettle by pentaho.
the class JavaScriptSpecialIT method createDateAddData.
public List<RowMetaAndData> createDateAddData() throws ParseException {
List<RowMetaAndData> list = new ArrayList<RowMetaAndData>();
// Create RowMeta
RowMetaInterface rm = new RowMeta();
rm.addValueMeta(new ValueMetaDate("input"));
// Populate Row
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
list.add(new RowMetaAndData(rm, new Object[] { format.parse("2014-01-01 00:00:00") }));
return list;
}
use of org.pentaho.di.core.row.value.ValueMetaDate in project pentaho-kettle by pentaho.
the class SortRowsIT method createGlobalData.
/**
* Generate rows for couple of possible combinations
* <ul>
* <li>String
* <li>String (with dup)
* <li>Timestamp
* <li>Integer
* <li>String (CaseSensitive)
* <li>Integer (pre-sorted) 1 grp
* <li>String (pre-sorted) 2 grp
* </ul>
*
* @return
*/
List<RowMetaAndData> createGlobalData() {
List<RowMetaAndData> list = new ArrayList<RowMetaAndData>();
RowMetaInterface rm = new RowMeta();
rm.addValueMeta(new ValueMetaString(KEY1));
rm.addValueMeta(new ValueMetaString(KEY2));
rm.addValueMeta(new ValueMetaDate(TMS));
rm.addValueMeta(new ValueMetaInteger(INT));
rm.addValueMeta(new ValueMetaString(STR));
rm.addValueMeta(new ValueMetaInteger(INTG1));
rm.addValueMeta(new ValueMetaString(STRG2));
rm.addValueMeta(new ValueMetaString(CONST));
long time = new Date().getTime();
String prevKey = null;
int counter = 0;
int group = 0;
for (int idx = 0; idx < MAX_COUNT; idx++) {
String key1 = UUID.randomUUID().toString();
String key2 = null;
if ((idx % 10 == 0 || idx == 11) && idx != 0) {
key2 = prevKey;
} else {
key2 = UUID.randomUUID().toString();
prevKey = key2;
}
int rand = Math.abs(RN.nextInt() % 10000);
Timestamp tms = new Timestamp(time + rand);
Long igr = new Long(rand);
String caseSen = TestUtilities.generateString(RN, 10);
char ch = (char) (65 + counter);
String gr2 = String.valueOf(ch);
Object[] row = new Object[] { key1, key2, tms, igr, caseSen, new Long(group), gr2, "stable" };
list.add(new RowMetaAndData(rm, row));
if (counter == 13) {
counter = 0;
group++;
} else {
counter++;
}
}
return list;
}
Aggregations