Non-standard token 'NaN'

Exception in thread “main” com.fasterxml.jackson.core.JsonParseException: Non-standard token ‘NaN’: enable JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS to allow
at [Source: {
“00-00”: {
“op”: “com.dremio.exec.planner.physical.ScreenPrel”,
“values”: {},
“inputs”: [
“00-01”
],
“rowType”: “RecordType(BIGINT count)”,
“rowCount”: 1.0,
“cumulativeCost”: “{NaN rows, NaN cpu, 0.0 io, 0.0 network, NaN memory}”
},
“00-01”: {
“op”: “com.dremio.exec.planner.physical.ProjectPrel”,
“values”: {
“fields”: “[count]”,
“exprs”: “[$0]”
},
“inputs”: [
“00-02”
],
“rowType”: “RecordType(BIGINT count)”,
“rowCount”: 1.0,
“cumulativeCost”: “{NaN rows, NaN cpu, 0.0 io, 0.0 network, NaN memory}”
},
“00-02”: {
“op”: “com.dremio.exec.planner.physical.StreamAggPrel”,
“values”: {
“group”: “{}”,
“aggs”: “[$SUM0($0)]”
},
“inputs”: [
“00-03”
],
“rowType”: “RecordType(BIGINT count)”,
“rowCount”: 1.0,
“cumulativeCost”: “{NaN rows, NaN cpu, 0.0 io, 0.0 network, NaN memory}”
},
“00-03”: {
“op”: “com.dremio.exec.planner.physical.StreamAggPrel”,
“values”: {
“group”: “{}”,
“aggs”: “[COUNT($0)]”
},
“inputs”: [
“00-04”
],
“rowType”: “RecordType(BIGINT count)”,
“rowCount”: 1.0,
“cumulativeCost”: “{NaN rows, NaN cpu, 0.0 io, 0.0 network, NaN memory}”
},
“00-04”: {
“op”: “com.dremio.exec.planner.physical.HashAggPrel”,
“values”: {
“group”: “{0}”,
“aggs”: “[]”
},
“inputs”: [
“00-05”
],
“rowType”: “RecordType(VARCHAR(65536) apply_no)”,
“rowCount”: NaN,
“cumulativeCost”: “{NaN rows, NaN cpu, 0.0 io, 0.0 network, NaN memory}”
},
“00-05”: {
“op”: “com.dremio.exec.planner.physical.ProjectPrel”,
“values”: {
“fields”: “[apply_no]”,
“exprs”: “[$3]”
},
“inputs”: [
“00-06”
],
“rowType”: “RecordType(VARCHAR(65536) apply_no)”,
“rowCount”: NaN,
“cumulativeCost”: “{NaN rows, NaN cpu, 0.0 io, 0.0 network, 0.0 memory}”
},
“00-06”: {
“op”: “com.dremio.plugins.elastic.planning.rels.ElasticScanPrel”,
“values”: {
“resource”: “crawler.app_upload_record/default”,
“columns”: “[create_time, device_id, upload_timing, apply_no, hbase_rowkey, device_type, serial_number, imsi, product_code, type, app_name, update_time, mobile_phone, id_unqp, imei, id, customer_id, _index, _type, _id, _uid]”,
"pushdown\n ": “{\n from : 0,\n size : 4000,\n query : {\n bool : {\n must : [ {\n match : {\n device_id : {\n query : m23e79906671782d34fa5e0b14e5800bf,\n type : boolean\n }\n }\n }, {\n match : {\n type : {\n query : device,\n type : boolean\n }\n }\n }, {\n match : {\n upload_timing : {\n query : apply,\n type : boolean\n }\n }\n }, {\n range : {\n create_time : {\n from : 1515149971000,\n to : null,\n include_lower : true,\n include_upper : true\n }\n }\n }, {\n range : {\n create_time : {\n from : null,\n to : 1515754771000,\n include_lower : true,\n include_upper : true\n }\n }\n } ]\n }\n }\n}”
},
“inputs”: [],
“rowType”: “RecordType(TIMESTAMP(0) create_time, VARCHAR(65536) device_id, VARCHAR(65536) upload_timing, VARCHAR(65536) apply_no, VARCHAR(65536) hbase_rowkey, VARCHAR(65536) device_type, VARCHAR(65536) serial_number, VARCHAR(65536) imsi, VARCHAR(65536) product_code, VARCHAR(65536) type, VARCHAR(65536) app_name, TIMESTAMP(0) update_time, VARCHAR(65536) mobile_phone, VARCHAR(65536) id_unqp, VARCHAR(65536) imei, BIGINT id, VARCHAR(65536) customer_id, VARCHAR(65536) _index, VARCHAR(65536) _type, VARCHAR(65536) _id, VARCHAR(65536) _uid)”,
“rowCount”: NaN,
“cumulativeCost”: “{NaN rows, NaN cpu, 0.0 io, 0.0 network, 0.0 memory}”
}
}; line: 61, column: 20]
at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1586)
at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:521)
at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1805)
at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextFieldName(ReaderBasedJsonParser.java:923)
at com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer$Vanilla.mapObject(UntypedObjectDeserializer.java:654)
at com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer$Vanilla.deserialize(UntypedObjectDeserializer.java:496)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer._readAndBindStringMap(MapDeserializer.java:496)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:342)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:26)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3807)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2797)
at com.dremio.service.jobs.TestParser.main(TestParser.java:16

public QueryProfileParser(final JobId jobId, final QueryProfile queryProfile) throws IOException {
mapper = new ObjectMapper();
mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
mapper.configure(JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS,true);//this is added for solved this issue.
operatorToTable = Maps.newHashMap();
jobDetails = new JobDetails();
jobStats = new JobStats();
fileSystemDatasetProfileMap = Maps.newHashMap();
tableDatasetProfileMap = Maps.newHashMap();
topOperationsMap = Maps.newHashMap();
this.queryProfile = queryProfile;
this.jobId = jobId;
parse();
}

1 Like

Thanks for reporting the issue. If you feel like it, feel free to open pull request at https://github.com/dremio/dremio-oss

@laurent
Hello, I have submit an MR to fix this bug. fix: failing to process NAN number number for json format by jenliew · Pull Request #95 · dremio/dremio-oss · GitHub
i’m wonder what is the procedure? as this is blocking our project.

thanks.
jenny