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

MF-1361 - Add StringValue and DataValue comparison filters #1714

Merged
merged 17 commits into from
Jul 28, 2023

Conversation

AryanGodara
Copy link
Contributor

@AryanGodara AryanGodara commented Feb 1, 2023

What does this do?

This pull request adds le, lt, ge, and gt comparators for StringValue and DataValue.

Which issue(s) does this PR fix/relate to?

Resolves #1361, and continues work on #1573.

List any changes that modify/break current functionality

N/A

Have you included tests for your changes?

Yes.

Did you document any new/modified functionality?

Yes.

Notes

N/A

@AryanGodara AryanGodara marked this pull request as ready for review February 3, 2023 12:19
@AryanGodara AryanGodara requested a review from a team as a code owner February 3, 2023 12:19
@codecov-commenter
Copy link

codecov-commenter commented Feb 3, 2023

Codecov Report

Merging #1714 (fb5e444) into master (2b78902) will increase coverage by 0.15%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1714      +/-   ##
==========================================
+ Coverage   64.73%   64.89%   +0.15%     
==========================================
  Files         118      118              
  Lines        9702     9746      +44     
==========================================
+ Hits         6281     6325      +44     
  Misses       2753     2753              
  Partials      668      668              
Files Changed Coverage Δ
readers/api/transport.go 70.00% <100.00%> (-0.25%) ⬇️
readers/influxdb/messages.go 85.27% <100.00%> (+1.66%) ⬆️
readers/postgres/messages.go 85.34% <100.00%> (+1.84%) ⬆️
readers/timescale/messages.go 84.82% <100.00%> (+1.82%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

readers/cassandra/messages.go Outdated Show resolved Hide resolved
readers/cassandra/messages.go Outdated Show resolved Hide resolved
readers/cassandra/messages.go Outdated Show resolved Hide resolved
consumers/writers/influxdb/consumer_test.go Outdated Show resolved Hide resolved
return errors.Wrap(errSaveMessage, err)
}
return nil
writeAPI := repo.client.WriteAPIBlocking(repo.cfg.Org, repo.cfg.Bucket)
Copy link
Contributor

Choose a reason for hiding this comment

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

I am having doubt on this variable naming... I would probably use wa instead of writeAPI, Go idiomatic is using simple names, especially if the code is near and readable... But it might be nitpicking.

@dborovcanin what do you think? There is a naming like this in several places.

@AryanGodara AryanGodara force-pushed the mf1361 branch 6 times, most recently from 5babf77 to 2823bdb Compare May 11, 2023 08:32
readers/influxdb/messages_test.go Outdated Show resolved Hide resolved
readers/influxdb/messages.go Outdated Show resolved Hide resolved
@arvindh123
Copy link
Contributor

arvindh123 commented May 12, 2023

Hello @AryanGodara

I hope the following suggested changes in consumers/writers/cassandra/init.go will fix the problem

At this line Existing Code :
https://github.com/mainflux/mainflux/blob/a039a5d14e18929215c5ea119fbff29d7a8fa830/consumers/writers/cassandra/init.go#L23
Replace with following :

        PRIMARY KEY (channel, time, id, publisher, name)

At this line Existing Code :
https://github.com/mainflux/mainflux/blob/a039a5d14e18929215c5ea119fbff29d7a8fa830/consumers/writers/cassandra/init.go#L34
Replace with following :

        PRIMARY KEY (channel, created, id, publisher)

readers/mongodb/README.md Outdated Show resolved Hide resolved
readers/influxdb/messages.go Outdated Show resolved Hide resolved
consumers/writers/cassandra/init.go Outdated Show resolved Hide resolved
consumers/writers/cassandra/init.go Outdated Show resolved Hide resolved
Copy link
Contributor

@arvindh123 arvindh123 left a comment

Choose a reason for hiding this comment

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

LGTM

fthdrmzzz and others added 15 commits July 13, 2023 16:49
Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Copy link
Contributor

@drasko drasko left a comment

Choose a reason for hiding this comment

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

LGTM

@drasko drasko merged commit 33eb8d8 into absmach:master Jul 28, 2023
3 checks passed
WashingtonKK pushed a commit to WashingtonKK/magistrala that referenced this pull request Jul 28, 2023
)

* Upgrade InfluxDB from 1.x to 2.x

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* go mod tidy vendor

Signed-off-by: aryan <aryangodara03@gmail.com>

* add all changes to single commit

Signed-off-by: aryan <aryangodara03@gmail.com>

* handle unmarshal errors

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix tests

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix primary keys in cassandra writer

Signed-off-by: aryan <aryangodara03@gmail.com>

* update mongodb vs queries

Signed-off-by: aryan <aryangodara03@gmail.com>

* update mongodb queries

Signed-off-by: aryan <aryangodara03@gmail.com>

* update mongodb queries again

Signed-off-by: aryan <aryangodara03@gmail.com>

* update readmes, revert mongo and cassandra

Signed-off-by: aryan <aryangodara03@gmail.com>

* remove unwanted print statement

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix errors in go.sum

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix typos

Signed-off-by: aryan <aryangodara03@gmail.com>

* revert changes to cassandra init

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix errors acc to pr review

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix errors in datavalue testcases

Signed-off-by: aryan <aryangodara03@gmail.com>

---------

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>
Signed-off-by: aryan <aryangodara03@gmail.com>
Co-authored-by: fatih <fatihdurmaz@sabanciuniv.edu>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
WashingtonKK pushed a commit to WashingtonKK/magistrala that referenced this pull request Jul 28, 2023
)

* Upgrade InfluxDB from 1.x to 2.x

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* go mod tidy vendor

Signed-off-by: aryan <aryangodara03@gmail.com>

* add all changes to single commit

Signed-off-by: aryan <aryangodara03@gmail.com>

* handle unmarshal errors

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix tests

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix primary keys in cassandra writer

Signed-off-by: aryan <aryangodara03@gmail.com>

* update mongodb vs queries

Signed-off-by: aryan <aryangodara03@gmail.com>

* update mongodb queries

Signed-off-by: aryan <aryangodara03@gmail.com>

* update mongodb queries again

Signed-off-by: aryan <aryangodara03@gmail.com>

* update readmes, revert mongo and cassandra

Signed-off-by: aryan <aryangodara03@gmail.com>

* remove unwanted print statement

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix errors in go.sum

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix typos

Signed-off-by: aryan <aryangodara03@gmail.com>

* revert changes to cassandra init

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix errors acc to pr review

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix errors in datavalue testcases

Signed-off-by: aryan <aryangodara03@gmail.com>

---------

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>
Signed-off-by: aryan <aryangodara03@gmail.com>
Co-authored-by: fatih <fatihdurmaz@sabanciuniv.edu>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
rodneyosodo pushed a commit to rodneyosodo/magistrala that referenced this pull request Aug 3, 2023
)

* Upgrade InfluxDB from 1.x to 2.x

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* go mod tidy vendor

Signed-off-by: aryan <aryangodara03@gmail.com>

* add all changes to single commit

Signed-off-by: aryan <aryangodara03@gmail.com>

* handle unmarshal errors

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix tests

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix primary keys in cassandra writer

Signed-off-by: aryan <aryangodara03@gmail.com>

* update mongodb vs queries

Signed-off-by: aryan <aryangodara03@gmail.com>

* update mongodb queries

Signed-off-by: aryan <aryangodara03@gmail.com>

* update mongodb queries again

Signed-off-by: aryan <aryangodara03@gmail.com>

* update readmes, revert mongo and cassandra

Signed-off-by: aryan <aryangodara03@gmail.com>

* remove unwanted print statement

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix errors in go.sum

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix typos

Signed-off-by: aryan <aryangodara03@gmail.com>

* revert changes to cassandra init

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix errors acc to pr review

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix errors in datavalue testcases

Signed-off-by: aryan <aryangodara03@gmail.com>

---------

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>
Signed-off-by: aryan <aryangodara03@gmail.com>
Co-authored-by: fatih <fatihdurmaz@sabanciuniv.edu>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
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.

Add StringValue and DataValue comparison filters
6 participants