Dmitry Lychagin has posted comments on this change. Change subject: [ASTERIXDB-2000][RT] Fix roundtrip-ability for INF. ......................................................................
Patch Set 1: (3 comments) https://asterix-gerrit.ics.uci.edu/#/c/1901/1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ADoublePrinterFactory.java File asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ADoublePrinterFactory.java: Line 27: public class ADoublePrinterFactory implements IPrinterFactory { There are 3 other ADoublePrinterFactory classes under org.apache.asterix.dataflow.data.nontagged.printers (adm, csv, json.loseless). Do we need to update them as well? We also need to update AFloatPrinterFactory classes in the same manner. Line 34: if (Double.isFinite(d) && !Double.isNaN(d)) { is this new comparison necessary here (Double.isNaN)? isFinite() already returns 'false' for NaN according to the javadoc Line 38: ps.print(Double.compare(d, Double.NaN) == 0 ? "NaN" btw, you could use Double.isNaN() here instead of Double.compare() and then directly compare value with +INF (d == Double.POSITIVE_INFINITY). Makes things a bit easier to read. but the existing code works too. -- To view, visit https://asterix-gerrit.ics.uci.edu/1901 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: comment Gerrit-Change-Id: I13687822433744afe1ad3439029b2c0887563f9b Gerrit-PatchSet: 1 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Yingyi Bu <[email protected]> Gerrit-Reviewer: Dmitry Lychagin <[email protected]> Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Till Westmann <[email protected]> Gerrit-HasComments: Yes
