-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix data anonymizer failures by updating legacy parser. #82
Conversation
Signed-off-by: Yury Fridlyand <[email protected]>
Signed-off-by: Sean Kao <[email protected]>
This fix damages support of this clause, but it was working ever. I failed to run it on OpenSearch 1.1 with plugin pre- |
Signed-off-by: Yury Fridlyand <[email protected]>
Codecov Report
@@ Coverage Diff @@
## integ-fix-anonymizer #82 +/- ##
=======================================================
Coverage ? 97.72%
Complexity ? 2816
=======================================================
Files ? 271
Lines ? 6934
Branches ? 439
=======================================================
Hits ? 6776
Misses ? 157
Partials ? 1
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
We need an anonymizer that works with the new engine. At some point the legacy engine goes will go away. Until that happens, I think it's best if This way we we gain an anonymizer for the new SQL engine, avoid changing the legacy parser, and avoid regressions in anonymizer when legacy engine is removed. Anonymizer for the new SQL engine would have a lot in common with PPL anonymizer. Probably will make sense to have a common subclass. What do you think? |
Great idea, thanks. I will try it out. |
@@ -39,7 +39,7 @@ public static String anonymizeData(String query) { | |||
.replaceAll("[\\n][\\t]+", " "); | |||
} catch (Exception e) { | |||
LOG.warn("Caught an exception when anonymizing sensitive data"); | |||
resultQuery = query; | |||
resultQuery = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with returning an empty string is that it's not solving the root of the problem. The anonymizer is repressing ALL exceptions from the anonymizer, and returning a valid state.
We should, instead, be returning a failure state in the response or throwing some exception. The function that's calling the anonymizer is completely unaware that an error occurred.
Signed-off-by: Yury Fridlyand [email protected]
Description
opensearch-project-sql/legacy/src/main/java/org/opensearch/sql/legacy/utils/QueryDataAnonymizer.java
Lines 40 to 44 in d9d25ad
[]
, fixes processing functions with multiple fields:opensearch-project-sql/legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java
Lines 149 to 155 in d9d25ad
MATCH ... AGAINST
clause, because it is overlayed byMATCH
function. Fixes failure onMATCH
function:opensearch-project-sql/legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java
Lines 501 to 550 in d9d25ad
Issues Resolved
TODO
MATCH ... AGAINST
(Is it even supported BTW?)Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.