orientechnologies / orientechnologies/orientdb

String record parsed as double on import

Open
#9,742 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
5k
Forks
868
Avg merge
15h 6m
Merged PRs (30d)
18

Description

OrientDB Version: 3.2.3
Java Version: 16
OS: Win/UNIX/osx

Expected behavior

Simple import/export should work

Actual behavior

java.lang.NumberFormatException: For input string: "1.0[ICCProfile]GreenTRC-0.0"
at jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054) ~[?:?]
at jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110) ~[?:?]
at java.lang.Double.parseDouble(Double.java:556) ~[?:?]
at java.lang.Double.(Double.java:638) ~[?:?]
at com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerJSON.getValueV0(ORecordSerializerJSON.java:1048) ~[orientdb-core-3.2.3.jar!/:3.2.3]
at com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerJSON.processRecordsV0(ORecordSerializerJSON.java:642) ~[orientdb-core-3.2.3.jar!/:3.2.3]
at com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerJSON.fromStringV0(ORecordSerializerJSON.java:462) ~[orientdb-core-3.2.3.jar!/:3.2.3]
at com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerJSON.fromStream(ORecordSerializerJSON.java:323) ~[orientdb-core-3.2.3.jar!/:3.2.3]
at com.orientechnologies.orient.core.db.tool.ODatabaseImport.importRecord(ODatabaseImport.java:2235) ~[orientdb-core-3.2.3.jar!/:3.2.3]
at com.orientechnologies.orient.core.db.tool.ODatabaseImport.importRecords(ODatabaseImport.java:2583) ~[orientdb-core-3.2.3.jar!/:3.2.3]
at com.orientechnologies.orient.core.db.tool.ODatabaseImport.importDatabase(ODatabaseImport.java:542) ~[orientdb-core-3.2.3.jar!/:3.2.3]

It seems that because the value has dot it gets treated like a double ?!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ODatabaseImport.importRecord and ORecordSerializerJSON.getValueV0, following the stack trace through processRecordsV0 and fromStringV0. Reproduce the simple import/export case containing the value "1.0[ICCProfile]GreenTRC-0.0". Done means the record imports without NumberFormatException and the string value is preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.