-
Notifications
You must be signed in to change notification settings - Fork 0
Improve Error Reporting for New SQL Engine #88
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 all commits
38d3819
d9bfd6c
9866cce
05b4c90
0467d13
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 |
|---|---|---|
|
|
@@ -26,7 +26,8 @@ public class QueryDataAnonymizer { | |
| * Sensitive data includes index names, column names etc., | ||
| * which in druid parser are parsed to SQLIdentifierExpr instances | ||
| * @param query entire sql query string | ||
| * @return sql query string with all identifiers replaced with "***" | ||
| * @return sql query string with all identifiers replaced with "***" on success | ||
| * and failure string otherwise to ensure no non-anonymized data is logged in production. | ||
| */ | ||
| public static String anonymizeData(String query) { | ||
| String resultQuery; | ||
|
|
@@ -38,8 +39,9 @@ public static String anonymizeData(String query) { | |
| .replaceAll("false", "boolean_literal") | ||
| .replaceAll("[\\n][\\t]+", " "); | ||
| } catch (Exception e) { | ||
| LOG.warn("Caught an exception when anonymizing sensitive data"); | ||
| resultQuery = query; | ||
| LOG.warn("Caught an exception when anonymizing sensitive data."); | ||
| LOG.debug("String {} failed anonymization.", query); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You still print the query on failure in the log.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only in debug level which shouldn't be enabled in a production build right? |
||
| resultQuery = "Failed to anonymize data."; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should comment why we aren't returning the query any longer |
||
| } | ||
| return resultQuery; | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.