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

support crate 4.x #300

Merged
merged 1 commit into from
Apr 16, 2020
Merged

support crate 4.x #300

merged 1 commit into from
Apr 16, 2020

Conversation

chicco785
Copy link
Contributor

fix #256

@c0c0n3 three test are failing.

  • test_NTNE_limit probably because the query is actually wrong
  • test_NTNE_offset may be actually a crate bug. i run the query manually and it seems that crate 4.x is not handling correctly offset when using it with an aggregate query (at least if in a union all select)
  • test_bc well of course moving to crate 4.x it's not backward compatible with ql 0.5.1

@chicco785 chicco785 requested a review from c0c0n3 April 4, 2020 01:13
@chicco785 chicco785 mentioned this pull request Apr 4, 2020
@c0c0n3
Copy link
Member

c0c0n3 commented Apr 6, 2020

@chicco785 it looks like you've added these changes on top of PR #299. We should freeze this PR until we merge PR #299 into master, then rebase this PR onto master to avoid version control nightmares :-)

For the rest it looks like a very good start. What happens if you re-enable all reporter tests? Talking about this change:

- pytest src/reporter/ --cov-report= --cov-config=.coveragerc --cov-append --cov=src/
+ pytest src/reporter/tests/test_NTNE.py --cov-report= --cov-config=.coveragerc --cov-append --cov=src/

@chicco785
Copy link
Contributor Author

yep, the idea was to rebase after merging the log one, locally i already re-enabled all report tests. i disable to focus on the troublesome ones

@chicco785
Copy link
Contributor Author

I reported the Union all "bug" in crate github crate/crate#9854

@c0c0n3
Copy link
Member

c0c0n3 commented Apr 6, 2020

idea was to rebase after merging the log one, locally i already re-enabled all report tests

I see you've rebased the branch, good stuff, thanks!

disable to focus on the troublesome ones

cool bananas, just wanted to make sure the change was intentional :-)

reported the Union all "bug"

that's great, thanks!

@chicco785
Copy link
Contributor Author

@c0c0n3
in general i assume that when you have lot of entities, offset is more important than order by, so at the time being for the crate bug, i removed order by.

i also improved the backward compatibility test, so we are able to test also database upgrade, and to test it across different combination of quantumleap and crate. see .travis.yml

@chicco785
Copy link
Contributor Author

chicco785 commented Apr 6, 2020

https://travis-ci.org/github/smartsdk/ngsi-timeseries-api/jobs/671718649?utm_medium=notification&utm_source=github_status highlights that query behaviour between crate versions in inconsistent

A theory could be that the order of result - in absence of order by - depends on the order of consolidation by crate (and not on the order of insertion).

@c0c0n3
Copy link
Member

c0c0n3 commented Apr 8, 2020

in general i assume that when you have lot of entities, offset is more important than order by, so at the time being for the crate bug, i removed order by.

That seems the most sensible thing to do at the moment. I opened #306 as a reminder to follow up on the Crate issue and possibly revert back to ordering the result set.

i also improved the backward compatibility test

That's fantabulous, thanks!

query behaviour between crate versions in inconsistent
A theory could be that the order of result - in absence of order by - depends on the order of consolidation by crate (and not on the order of insertion).

Yes probably. Since those tables don't have a PK, perhaps we get an implicit one with an associated index and results get output in index traversal order. But that's just a wild guess!

@c0c0n3
Copy link
Member

c0c0n3 commented Apr 8, 2020

Also, I'd update test_NTNE_limit to make it independent of result set ordering. What we want to test here is that the limit param is honoured. So the test should just check the returned tuple (id, type, ix) ∈ { (Room0, Room, room_ix), (Kitchen0, Kitchen, kitchen_ix) }.

@chicco785
Copy link
Contributor Author

@c0c0n3 all test are passing

@@ -204,7 +206,7 @@ def _insert_entities_of_type(self,
msg = "Translating entity without TIME_INDEX. " \
"It should have been inserted by the 'Reporter'. {}"
warnings.warn(msg.format(e))
now_iso = datetime.now().isoformat(timespec='milliseconds')
now_iso = datetime.utcnow().isoformat(timespec='milliseconds')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@c0c0n3 this ensure that also when not timeindex is inserted, we use utc

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excellent thanks!

@chicco785 chicco785 force-pushed the fix-256 branch 2 times, most recently from 00ff168 to b2775eb Compare April 14, 2020 08:59
@chicco785 chicco785 changed the title support crate 4.0 support crate 4.x Apr 14, 2020
* support backward compatibility tests with different crate versions

* improve health test (return better error when cratedb cannot be reached)

* sort table_name to ensure that tables are always queried in the same order

* diffenrentiate dev compose and deploy compose

* update travis to comply with new spec

* clean docker compose

* Hack test_NTNE.py due to ordering issue

* update documentation listing Crate 4.x as experimental support
@chicco785
Copy link
Contributor Author

@c0c0n3 unless there is anything else, this PR should be ready to land

@c0c0n3 c0c0n3 merged commit a257af2 into master Apr 16, 2020
@c0c0n3 c0c0n3 deleted the fix-256 branch April 16, 2020 16:55
@c0c0n3
Copy link
Member

c0c0n3 commented Apr 16, 2020

@chicco785 excellent, merged in!

fisuda added a commit to fisuda/ngsi-timeseries-api that referenced this pull request Jul 4, 2020
c0c0n3 pushed a commit that referenced this pull request Jul 6, 2020
* (ja) Add documentation for crate 4.x (#300)

* (ja) Add documentation for environment variables (#299,#330)
@c0c0n3 c0c0n3 mentioned this pull request Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants