Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded list rounds decimals in position 1 onwards #4064

Closed
andyflatt opened this issue May 1, 2015 · 3 comments
Closed

Embedded list rounds decimals in position 1 onwards #4064

andyflatt opened this issue May 1, 2015 · 3 comments
Assignees
Labels
Milestone

Comments

@andyflatt
Copy link

I have found an issue with the EMBEDDEDLIST type. I am trying to store location point data in a List of doubles and can see that they are being rounded. I first noticed this issue whilst using the Java API but am able to reproduce in the studio browse tab where you can run the following three commands:

CREATE CLASS Test
CREATE PROPERTY Test.lngLatAlt EMBEDDEDLIST
INSERT INTO class:Test CONTENT {"lngLatAlt":[-1.0622668999780415,53.18759235410253,123.52103761862963]}

Notice in the result it has rounded the decimals in position 1 and 2 to 6 decimal places.
{
"result": [
{
"@type": "d",
"@Rid": "#56:0",
"@Version": 1,
"@Class": "Test",
"lngLatAlt": [
-1.0622668999780415,
53.18759,
123.521034
]
}
],
"notification": "Query executed in 0.011 sec. Returned 1 record(s)"
}

I am running version orientdb-community-2.0.8 downloaded from the homepage.

@ryan-stateless
Copy link

+1

@nagarajasr
Copy link
Contributor

reproduced on 2.1-rc5, and this happens even if the property is defined as EMBDEDDLIST DECIMAL.
notice also that first item in the list is rounded of to "...416" in my case.

orientdb {db=t12db}> select expand(lngLatAlt) from Test1 unwind lngLatAlt

----+------+-------------------
#   |@CLASS|value
----+------+-------------------
0   |null  |-1.0622668999780416
1   |null  |53.18759
2   |null  |123.521034
----+------+-------------------

3 item(s) found. Query executed in 0.015 sec(s).
orientdb {db=t12db}>

funny thing is if I change the sign of the 2nd entry in the list to -53..., it gets inserted alright.

orientdb {db=t12db}> INSERT INTO Test1 CONTENT {"lngLatAlt":[-53.18759235410253,123.52103761862963,-100.0622668999780415]}

Inserted record 'Test1#12:5{lngLatAlt:[3]} v1' in 0.014000 sec(s).

orientdb {db=t12db}> select expand(lngLatAlt) from Test1 unwind lngLatAlt

----+------+-------------------
#   |@CLASS|value
----+------+-------------------
0   |null  |-53.18759235410253
1   |null  |123.521034
2   |null  |-100.06226689997804
----+------+-------------------

3 item(s) found. Query executed in 0.02 sec(s).

@lvca lvca added this to the 2.1.x (next hotfix) milestone Sep 22, 2015
@lvca lvca added the bug label Sep 22, 2015
@luigidellaquila luigidellaquila modified the milestones: 2.2.1, 2.1.x (next hotfix) May 24, 2016
@luigidellaquila
Copy link
Member

This is fixed in 2.2

I'm closing the ticket, please reopen if you see any related problems

Thanks

Luigi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

5 participants