-
Notifications
You must be signed in to change notification settings - Fork 181
Fix search anoymizer only #4783
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
Changes from 10 commits
2cb2048
24bcb66
0e601c6
6a41ad0
d19c147
5e22011
e02a035
518acb2
9629ea7
44d7591
f56c04d
0039240
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "calcite":{ | ||
| "logical":"LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT])\n LogicalProject(account_number=[$0], firstname=[$1], address=[$2], birthdate=[$3], gender=[$4], city=[$5], lastname=[$6], balance=[$7], employer=[$8], state=[$9], age=[$10], email=[$11], male=[$12])\n LogicalFilter(condition=[match(MAP('field_name', $3), MAP('value', '\"2016\\-12\\-08 00\\:00\\:00.000000000\"':VARCHAR))])\n CalciteLogicalIndexScan(table=[[OpenSearch, opensearch-sql_test_index_bank]])\n", | ||
| "physical":"CalciteEnumerableIndexScan(table=[[OpenSearch, opensearch-sql_test_index_bank]], PushDownContext=[[PROJECT->[account_number, firstname, address, birthdate, gender, city, lastname, balance, employer, state, age, email, male], FILTER->match(MAP('field_name', $3), MAP('value', '\"2016\\-12\\-08 00\\:00\\:00.000000000\"':VARCHAR)), LIMIT->10000], OpenSearchRequestBuilder(sourceBuilder={\"from\":0,\"size\":10000,\"timeout\":\"1m\",\"query\":{\"match\":{\"birthdate\":{\"query\":\"\\\"2016\\\\-12\\\\-08 00\\\\:00\\\\:00.000000000\\\"\",\"operator\":\"OR\",\"prefix_length\":0,\"max_expansions\":50,\"fuzzy_transpositions\":true,\"lenient\":false,\"zero_terms_query\":\"NONE\",\"auto_generate_synonyms_phrase_query\":true,\"boost\":1.0}}},\"_source\":{\"includes\":[\"account_number\",\"firstname\",\"address\",\"birthdate\",\"gender\",\"city\",\"lastname\",\"balance\",\"employer\",\"state\",\"age\",\"email\",\"male\"],\"excludes\":[]}}, requestedTotalSize=10000, pageSize=null, startFrom=0)])\n" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,7 +33,7 @@ public class PPLQueryDataAnonymizerTest { | |
|
|
||
| @Test | ||
| public void testSearchCommand() { | ||
| assertEquals("source=table a:***", anonymize("search source=t a=1")); | ||
| assertEquals("source=table identifier = ***", anonymize("search source=t a=1")); | ||
| } | ||
|
|
||
| @Test | ||
|
|
@@ -879,10 +879,37 @@ private String anonymizeStatement(String query, boolean isExplain) { | |
| @Test | ||
| public void testSearchWithAbsoluteTimeRange() { | ||
| assertEquals( | ||
| "source=table (@timestamp:*** AND (@timestamp:***", | ||
| "source=table (identifier >= ***) AND (identifier <= ***)", | ||
| anonymize("search source=t earliest='2012-12-10 15:00:00' latest=now")); | ||
| } | ||
|
|
||
| @Test | ||
| public void testSearchWithIn() { | ||
| assertEquals("source=table identifier IN ***", anonymize("search source=t balance in (2000)")); | ||
| } | ||
|
|
||
| @Test | ||
| public void testSearchWithNot() { | ||
| assertEquals( | ||
| "source=table NOT(identifier = ***)", anonymize("search NOT balance=2000 source=t")); | ||
| } | ||
|
|
||
| @Test | ||
| public void testSearchWithGroup() { | ||
| assertEquals( | ||
| "source=table ((identifier = *** OR identifier = ***) AND identifier > ***)", | ||
| anonymize( | ||
| "search (severityText=\"ERROR\" OR severityText=\"WARN\") AND severityNumber>10" | ||
| + " source=t")); | ||
| } | ||
|
|
||
| @Test | ||
| public void testSearchWithOr() { | ||
| assertEquals( | ||
| "source=table (identifier >= *** OR identifier <= ***)", | ||
| anonymize("search source=t earliest='2012-12-10 15:00:00' or latest=now")); | ||
|
||
| } | ||
|
|
||
| @Test | ||
| public void testSpath() { | ||
| assertEquals( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.