Skip to content

Commit cd1177a

Browse files
authored
Merge pull request #80 from chris9692/master
Derived fields can have int not integer because avro supports only int
2 parents 2c1911d + cf59856 commit cd1177a

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

cdi-core/src/main/java/com/linkedin/cdi/extractor/JsonExtractor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ private JsonObject addDerivedFields(JsonObject row) {
326326
case KEY_WORD_BOOLEAN:
327327
row.addProperty(name, Boolean.parseBoolean(strValue));
328328
break;
329-
case KEY_WORD_INTEGER:
329+
case KEY_WORD_INT:
330330
row.addProperty(name, Integer.parseInt(strValue));
331331
break;
332332
case KEY_WORD_NUMBER:

cdi-core/src/main/java/com/linkedin/cdi/extractor/MultistageExtractor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public class MultistageExtractor<S, D> implements Extractor<S, D> {
7676
protected final static String PXD = "P\\d+D";
7777
protected final static String CONTENT_TYPE_KEY = "Content-Type";
7878
protected final static List<String> SUPPORTED_DERIVED_FIELD_TYPES =
79-
Arrays.asList(KEY_WORD_EPOC, KEY_WORD_STRING, KEY_WORD_REGEXP, KEY_WORD_BOOLEAN, KEY_WORD_INTEGER, KEY_WORD_NUMBER);
79+
Arrays.asList(KEY_WORD_EPOC, KEY_WORD_STRING, KEY_WORD_REGEXP, KEY_WORD_BOOLEAN, KEY_WORD_INT, KEY_WORD_NUMBER);
8080
protected static final String COMMA_STR = ",";
8181
protected WorkUnitStatus workUnitStatus = WorkUnitStatus.builder().build();
8282
protected WorkUnitState state = null;
@@ -482,7 +482,7 @@ protected JsonArray addDerivedFieldsToAltSchema() {
482482
dataType.addProperty(KEY_WORD_TYPE, "long");
483483
break;
484484
case KEY_WORD_STRING:
485-
case KEY_WORD_INTEGER:
485+
case KEY_WORD_INT:
486486
case KEY_WORD_NUMBER:
487487
case KEY_WORD_BOOLEAN:
488488
dataType.addProperty(KEY_WORD_TYPE, entry.getValue().get(KEY_WORD_TYPE));

cdi-core/src/test/java/com/linkedin/cdi/extractor/JsonExtractorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ public void testAddDerivedFields() throws Exception {
356356
"dateTimeString",
357357
ImmutableMap.of("type", "string", "source", "{{dateTimeString}}"),
358358
"someInteger",
359-
ImmutableMap.of("type", "integer", "source", "{{someInteger}}"),
359+
ImmutableMap.of("type", "int", "source", "{{someInteger}}"),
360360
"someEpoc",
361361
ImmutableMap.of("type", "epoc", "source", "{{someEpoc}}"),
362362
"someNumber",

docs/parameters/ms.derived.fields.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ DIL supports 6 types of derived fields:
3434
- `epoc`: it provides a time value field in the form of epoch (millisecond level).
3535
- `regexp`: it provides a string value field by extracting the value from another field using a Java REGEXP pattern
3636
- `string`: it provides a string value field by taking from another field, which can be a nested field, without transformation
37-
- `integer`: it provides a integer value field by taking from another integer field, which can be a nested field, without transformation
37+
- `int`: it provides a integer value field by taking from another integer field, which can be a nested field, without transformation
3838
- `number`: it provides a number value field by taking from another number field, which can be a nested field, without transformation
3939
- `boolean`: it provides a boolean value field by taking from another boolean field, which can be a nested field, without transformation
4040

0 commit comments

Comments
 (0)