use of org.apache.hop.core.row.value.ValueMetaInteger in project hop by apache.
the class SalesforceInputMeta method getFields.
@Override
public void getFields(IRowMeta r, String name, IRowMeta[] info, TransformMeta nextTransform, IVariables variables, IHopMetadataProvider metadataProvider) throws HopTransformException {
int i;
for (i = 0; i < inputFields.length; i++) {
SalesforceInputField field = inputFields[i];
int type = field.getType();
if (type == IValueMeta.TYPE_NONE) {
type = IValueMeta.TYPE_STRING;
}
try {
IValueMeta v = ValueMetaFactory.createValueMeta(variables.resolve(field.getName()), type);
v.setLength(field.getLength());
v.setPrecision(field.getPrecision());
v.setOrigin(name);
v.setConversionMask(field.getFormat());
v.setDecimalSymbol(field.getDecimalSymbol());
v.setGroupingSymbol(field.getGroupSymbol());
v.setCurrencySymbol(field.getCurrencySymbol());
r.addValueMeta(v);
} catch (Exception e) {
throw new HopTransformException(e);
}
}
if (includeTargetURL && !Utils.isEmpty(targetURLField)) {
IValueMeta v = new ValueMetaString(variables.resolve(targetURLField));
v.setLength(250);
v.setPrecision(-1);
v.setOrigin(name);
r.addValueMeta(v);
}
if (includeModule && !Utils.isEmpty(moduleField)) {
IValueMeta v = new ValueMetaString(variables.resolve(moduleField));
v.setLength(250);
v.setPrecision(-1);
v.setOrigin(name);
r.addValueMeta(v);
}
if (includeSQL && !Utils.isEmpty(sqlField)) {
IValueMeta v = new ValueMetaString(variables.resolve(sqlField));
v.setLength(250);
v.setPrecision(-1);
v.setOrigin(name);
r.addValueMeta(v);
}
if (includeTimestamp && !Utils.isEmpty(timestampField)) {
IValueMeta v = new ValueMetaDate(variables.resolve(timestampField));
v.setOrigin(name);
r.addValueMeta(v);
}
if (includeRowNumber && !Utils.isEmpty(rowNumberField)) {
IValueMeta v = new ValueMetaInteger(variables.resolve(rowNumberField));
v.setLength(IValueMeta.DEFAULT_INTEGER_LENGTH, 0);
v.setOrigin(name);
r.addValueMeta(v);
}
if (includeDeletionDate && !Utils.isEmpty(deletionDateField)) {
IValueMeta v = new ValueMetaDate(variables.resolve(deletionDateField));
v.setOrigin(name);
r.addValueMeta(v);
}
}
use of org.apache.hop.core.row.value.ValueMetaInteger in project hop by apache.
the class RestMeta method getFields.
@Override
public void getFields(IRowMeta inputRowMeta, String name, IRowMeta[] info, TransformMeta nextTransform, IVariables variables, IHopMetadataProvider metadataProvider) throws HopTransformException {
if (!Utils.isEmpty(fieldName)) {
IValueMeta v = new ValueMetaString(variables.resolve(fieldName));
v.setOrigin(name);
inputRowMeta.addValueMeta(v);
}
if (!Utils.isEmpty(resultCodeFieldName)) {
IValueMeta v = new ValueMetaInteger(variables.resolve(resultCodeFieldName));
v.setOrigin(name);
inputRowMeta.addValueMeta(v);
}
if (!Utils.isEmpty(responseTimeFieldName)) {
IValueMeta v = new ValueMetaInteger(variables.resolve(responseTimeFieldName));
v.setOrigin(name);
inputRowMeta.addValueMeta(v);
}
String headerFieldName = variables.resolve(responseHeaderFieldName);
if (!Utils.isEmpty(headerFieldName)) {
IValueMeta v = new ValueMetaString(headerFieldName);
v.setOrigin(name);
inputRowMeta.addValueMeta(v);
}
}
use of org.apache.hop.core.row.value.ValueMetaInteger in project hop by apache.
the class ExecProcessMeta method getFields.
@Override
public void getFields(IRowMeta inputRowMeta, String name, IRowMeta[] info, TransformMeta nextTransform, IVariables variables, IHopMetadataProvider metadataProvider) throws HopTransformException {
// Output fields (String)
String realOutputFieldname = variables.resolve(resultfieldname);
if (!Utils.isEmpty(realOutputFieldname)) {
IValueMeta v = new ValueMetaString(realOutputFieldname);
v.setLength(100, -1);
v.setOrigin(name);
inputRowMeta.addValueMeta(v);
}
String realerrofieldname = variables.resolve(errorfieldname);
if (!Utils.isEmpty(realerrofieldname)) {
IValueMeta v = new ValueMetaString(realerrofieldname);
v.setLength(100, -1);
v.setOrigin(name);
inputRowMeta.addValueMeta(v);
}
String realexitvaluefieldname = variables.resolve(exitvaluefieldname);
if (!Utils.isEmpty(realexitvaluefieldname)) {
IValueMeta v = new ValueMetaInteger(realexitvaluefieldname);
v.setLength(IValueMeta.DEFAULT_INTEGER_LENGTH, 0);
v.setOrigin(name);
inputRowMeta.addValueMeta(v);
}
}
use of org.apache.hop.core.row.value.ValueMetaInteger in project hop by apache.
the class FieldsChangeSequenceMeta method getFields.
@Override
public void getFields(IRowMeta r, String name, IRowMeta[] info, TransformMeta nextTransform, IVariables variables, IHopMetadataProvider metadataProvider) {
if (!Utils.isEmpty(resultFieldName)) {
IValueMeta v = new ValueMetaInteger(resultFieldName);
v.setLength(IValueMeta.DEFAULT_INTEGER_LENGTH, 0);
v.setOrigin(name);
r.addValueMeta(v);
}
}
use of org.apache.hop.core.row.value.ValueMetaInteger in project hop by apache.
the class MemoryGroupByAggregationTest method testSqlCompatible.
@Test
@Ignore
public void testSqlCompatible() throws Exception {
addColumn(new ValueMetaInteger("value"), null, -2L, null, 0L, null, 10L, null, null, 0L, null);
RowMetaAndData output = runTransform();
assertThat(output.getInteger("value_max"), is(10L));
assertThat(output.getInteger("value_min"), is(-2L));
assertThat(output.getInteger("value_sum"), is(8L));
assertThat(output.getInteger("value_ave"), is(2L));
assertThat(output.getInteger("value_count"), is(4L));
assertThat(output.getInteger("value_count_any"), is(10L));
assertThat(output.getInteger("value_count_distinct"), is(3L));
}
Aggregations