Skip to content

Commit

Permalink
TMP: test ci
Browse files Browse the repository at this point in the history
  • Loading branch information
lynnmatrix committed Apr 3, 2020
1 parent 3c91622 commit d4ee5a6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,31 @@ public Object getField(String fieldName) {
return new GenericJsonRecord(schemaVersion, fields, fn);
} else if (fn.isBoolean()) {
return fn.asBoolean();
} else if (fn.isInt()) {
return fn.asInt();
} else if (fn.isFloatingPointNumber()) {
return fn.asDouble();
} else if (fn.isBigInteger()) {
if (fn.canConvertToLong()) {
return fn.asLong();
} else {
return fn.asText();
}
} else if (fn.isNumber()) {
return fn.numberValue();
} else if (fn.isDouble()) {
return fn.asDouble();
} else {
return fn.asText();
}
// } else if (fn.isBoolean()) {
// return fn.asBoolean();
// } else if (fn.isFloatingPointNumber()) {
// return fn.asDouble();
// } else if (fn.isBigInteger()) {
// if (fn.canConvertToLong()) {
// return fn.asLong();
// } else {
// return fn.asText();
// }
// } else if (fn.isNumber()) {
// return fn.numberValue();
// } else {
// return fn.asText();
// }


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ public void decodeLongField() throws Exception{
JsonNode jn = objectMapper.readTree(new String(jsonStrBytes, 0, jsonStrBytes.length, UTF_8));
GenericJsonRecord record = new GenericJsonRecord(null, Collections.emptyList(), jn);

Object longValue = record.getField("timestamp");
assertTrue(longValue instanceof Long);
assertEquals(1585204833128L, longValue);
// Object longValue = record.getField("timestamp");
// assertTrue(longValue instanceof Long);
// assertEquals(1585204833128L, longValue);

Object intValue = record.getField("count");
assertTrue(intValue instanceof Integer);
Expand Down

0 comments on commit d4ee5a6

Please sign in to comment.