Source:
<code>void putJSONRep(int columnIndex, JSONStringer js) throws JSONException { long value; double dvalue; VoltType columnType = getColumnType(columnIndex); switch (columnType) { case TINYINT: value = getLong(columnIndex); if (wasNull()) { js.value(null); } else { js.value(value); } break; case SMALLINT: value = getLong(columnIndex); if (wasNull()) { js.value(null); } else { js.value(value); } break; case INTEGER: value = getLong(columnIndex); if (wasNull()) { js.value(null); } else { js.value(value); } break; case BIGINT: value = getLong(columnIndex); if (wasNull()) { js.value(null); } else { js.value(value); } break; case TIMESTAMP: value = getTimestampAsLong(columnIndex); if (wasNull()) { js.value(null); } else { js.value(value); } break; case FLOAT: dvalue = getDouble(columnIndex); if (wasNull()) { js.value(null); } <START> else if (dvalue != dvalue) { <END> js.value("NaN"); } else { js.value(dvalue); } break; case STRING: js.value(getString(columnIndex)); break; case VARBINARY: byte[] bin = getVarbinary(columnIndex); js.value(Encoder.hexEncode(bin)); break; case DECIMAL: Object dec = getDecimalAsBigDecimal(columnIndex); if (wasNull()) { js.value(null); } else { js.value(dec.toString()); } break; case GEOGRAPHY_POINT: GeographyPointValue pt = getGeographyPointValue(columnIndex); if (wasNull()) { js.value(null); } else { js.value(pt.toString()); } break; case GEOGRAPHY: GeographyValue gv = getGeographyValue(columnIndex); if (wasNull()) { js.value(null); } else { js.value(gv.toString()); } break; case INVALID: break; case NULL: break; case NUMERIC: break; case BOOLEAN: break; case VOLTTABLE: break; } }</code><technical_language>good Double.isNan() for readability. Also, Inf -Inf? ticket mention them, able handle well</technical_language>

Target:
void putJSONRep(int columnIndex, JSONStringer js) throws JSONException { long value; double dvalue; VoltType columnType = getColumnType(columnIndex); switch (columnType) { case TINYINT: value = getLong(columnIndex); if (wasNull()) { js.value(null); } else { js.value(value); } break; case SMALLINT: value = getLong(columnIndex); if (wasNull()) { js.value(null); } else { js.value(value); } break; case INTEGER: value = getLong(columnIndex); if (wasNull()) { js.value(null); } else { js.value(value); } break; case BIGINT: value = getLong(columnIndex); if (wasNull()) { js.value(null); } else { js.value(value); } break; case TIMESTAMP: value = getTimestampAsLong(columnIndex); if (wasNull()) { js.value(null); } else { js.value(value); } break; case FLOAT: dvalue = getDouble(columnIndex); if (wasNull()) { js.value(null); } else if (Double.isNaN(dvalue)) { js.value(Double.toString(dvalue)); } else if (Double.isInfinite(dvalue)) { js.value(Double.toString(dvalue)); } else { js.value(dvalue); } break; case STRING: js.value(getString(columnIndex)); break; case VARBINARY: byte[] bin = getVarbinary(columnIndex); js.value(Encoder.hexEncode(bin)); break; case DECIMAL: Object dec = getDecimalAsBigDecimal(columnIndex); if (wasNull()) { js.value(null); } else { js.value(dec.toString()); } break; case GEOGRAPHY_POINT: GeographyPointValue pt = getGeographyPointValue(columnIndex); if (wasNull()) { js.value(null); } else { js.value(pt.toString()); } break; case GEOGRAPHY: GeographyValue gv = getGeographyValue(columnIndex); if (wasNull()) { js.value(null); } else { js.value(gv.toString()); } break; case INVALID: break; case NULL: break; case NUMERIC: break; case BOOLEAN: break; case VOLTTABLE: break; } }