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

feat: implemented working query anonymizer #7357

Merged

Conversation

tolgadur
Copy link
Contributor

@tolgadur tolgadur commented Apr 8, 2021

Jira: KCI-341

Description

This is the first userstory in the anonymize query epic KCI-340. Here, a class is defined that takes in a ksqldb query and returns the same statement with anonymised property names, column names, stream names etc.

For example, the following query...

ALTER STREAM my_stream ADD COLUMN c3 INT, ADD COLUMN c4 INT;

...is anonymised to:

ALTER STREAM stream1 (ADD COLUMN column1 INT, ADD COLUMN column2 INT);

The output in this story is all printed in the same line as discussed on Jira. The pretty printing according to specified rules from the product team is going to be done in KCI-377.

Testing done

Unit- and approval testing to make sure anonymizer works as expected.

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

@tolgadur tolgadur requested a review from a team as a code owner April 8, 2021 14:17
@ghost
Copy link

ghost commented Apr 8, 2021

@confluentinc It looks like @tolgadur just signed our Contributor License Agreement. 👍

Always at your service,

clabot

@tolgadur tolgadur requested review from swist and rodesai April 8, 2021 14:17
@tolgadur tolgadur force-pushed the anonymize-and-pretty-print-ksql-queries branch from 294b467 to 1b67324 Compare April 8, 2021 15:09
@@ -84,6 +84,18 @@
<version>${io.confluent.ksql.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Copy link
Member

Choose a reason for hiding this comment

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

Do you actually need this? If you know how to do it, we should depend on one version of approval tests throughout (via ksql-test-util or parent POM), if not let me know and I'll task myself up with that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, I don't need it. I removed it now :)

Copy link
Member

@swist swist left a comment

Choose a reason for hiding this comment

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

LGTM just two questions that would be good to have answers to before merging

Copy link
Contributor

@lct45 lct45 left a comment

Choose a reason for hiding this comment

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

Overall LGTM - had a few questions about handling UDFs / inline functions


@Override
public String visitDescribeFunction(final DescribeFunctionContext context) {
return "DESCRIBE FUNCTION function;";
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to make sure I understand the anonymizing - there won't be a way to map what function is being described here to where the function is used, is that right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's right. I can add this if this is something we want though?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's probably ok, depends on how much visibility product wants into functions

@tolgadur tolgadur force-pushed the anonymize-and-pretty-print-ksql-queries branch 6 times, most recently from 80ccd99 to 8b3a0a8 Compare April 21, 2021 11:33
@tolgadur tolgadur force-pushed the anonymize-and-pretty-print-ksql-queries branch from 8b3a0a8 to ab39bc9 Compare April 21, 2021 11:54
@tolgadur tolgadur merged commit fa0445f into confluentinc:master Apr 22, 2021
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.

3 participants