the-other-tim-brown commented on code in PR #526:
URL: https://github.com/apache/incubator-xtable/pull/526#discussion_r1735487614
##########
xtable-core/src/test/java/org/apache/xtable/delta/TestDeltaValueConverter.java:
##########
@@ -82,6 +82,15 @@ void parseWrongDateTime() throws ParseException {
assertThrows(ParseException.class, () ->
strictDateFormat.parse(wrongDateTime));
}
+ @ParameterizedTest
+ @MethodSource("nonNumericValuesForColStats")
+ public void formattedDifferentNonNumericValuesFromDeltaColumnStat(
Review Comment:
nitpick: `public` can be removed
##########
xtable-core/src/main/java/org/apache/xtable/delta/DeltaValueConverter.java:
##########
@@ -194,9 +194,35 @@ public static Object convertFromDeltaPartitionValue(
private static Object castObjectToInternalType(Object value, InternalType
valueType) {
switch (valueType) {
+ case DOUBLE:
+ if (value instanceof String)
+ switch (value.toString()) {
+ case "NaN":
Review Comment:
Is there anywhere we can import these strings as constants from Delta? if
not, can you define some internally for us?
##########
xtable-core/src/test/java/org/apache/xtable/delta/TestDeltaValueConverter.java:
##########
@@ -82,6 +82,15 @@ void parseWrongDateTime() throws ParseException {
assertThrows(ParseException.class, () ->
strictDateFormat.parse(wrongDateTime));
}
+ @ParameterizedTest
+ @MethodSource("nonNumericValuesForColStats")
+ public void formattedDifferentNonNumericValuesFromDeltaColumnStat(
+ Object fieldValue, InternalSchema fieldSchema, Object
expectedDeltaValue) {
+ Object internalRepresentation =
+ DeltaValueConverter.convertFromDeltaColumnStatValue(fieldValue,
fieldSchema);
+ assertEquals(internalRepresentation, expectedDeltaValue);
Review Comment:
Do we also need to test transforming the internal representation into the
delta stats?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]