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

Getting error: "Do not know how to anonymize type 'DATE'" #5

Open
ShubhankitRoy opened this issue Jun 16, 2017 · 3 comments
Open

Getting error: "Do not know how to anonymize type 'DATE'" #5

ShubhankitRoy opened this issue Jun 16, 2017 · 3 comments
Milestone

Comments

@ShubhankitRoy
Copy link

ShubhankitRoy commented Jun 16, 2017

Hi there

I have a MySQL table that has a field of type 'DATETIME'. When I try to anonymize this table I get an UnsupportedOperationException saying "Do not know how to anonymize type 'DATE' "
Following is an excerpt from my config file:

<table name="contact_">
	<column name="birthday" type="DATE" />
</table>

Can you kindly let me know what is going wrong here? Same exception is thrown if the field is of type 'DATE'.

Best
Shubhankit

@macropin
Copy link

macropin commented Oct 22, 2018

I've reproduced this:

anonimatron_1  | Anonymizing table 'domain_operations', total progress  [0%, ETA 7:34:32 PM]Exception in thread "main" java.lang.RuntimeException: java.lang.UnsupportedOperationException: Can not anonymize objects of type class java.sql.Timestamp
anonimatron_1  | 	at com.rolfje.anonimatron.jdbc.JdbcAnonymizerService.processTableColumns(JdbcAnonymizerService.java:241)
anonimatron_1  | 	at com.rolfje.anonimatron.jdbc.JdbcAnonymizerService.anonymizeTableInPlace(JdbcAnonymizerService.java:154)
anonimatron_1  | 	at com.rolfje.anonimatron.jdbc.JdbcAnonymizerService.anonymize(JdbcAnonymizerService.java:94)
anonimatron_1  | 	at com.rolfje.anonimatron.Anonimatron.anonymize(Anonimatron.java:99)
anonimatron_1  | 	at com.rolfje.anonimatron.Anonimatron.main(Anonimatron.java:67)
anonimatron_1  | Caused by: java.lang.UnsupportedOperationException: Can not anonymize objects of type class java.sql.Timestamp
anonimatron_1  | 	at com.rolfje.anonimatron.anonymizer.DateAnonymizer.anonymize(DateAnonymizer.java:42)
anonimatron_1  | 	at com.rolfje.anonimatron.anonymizer.AnonymizerService.anonymize(AnonymizerService.java:92)
anonimatron_1  | 	at com.rolfje.anonimatron.jdbc.JdbcAnonymizerService$2.processColumn(JdbcAnonymizerService.java:140)
anonimatron_1  | 	at com.rolfje.anonimatron.jdbc.JdbcAnonymizerService.processTableColumns(JdbcAnonymizerService.java:212)
anonimatron_1  | 	... 4 more
anonimatron_1  | /usr/src/app

column is mysql type timestamp.

@realrolfje
Copy link
Owner

Currently the DateAnonymizer only handles java.sql.Date objects. Apparently the resultset returns DateTime objects because the database contains the timestamp datatype. I need to add a testcase for this situation and either fix the date anonymizer or create a datetime anonymizer

@realrolfje
Copy link
Owner

Related to #2

@realrolfje realrolfje added this to the 1.12 milestone Oct 31, 2019
@realrolfje realrolfje modified the milestones: 1.12, 1.13 Feb 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants