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

Timestamp inside collection does not round trip #78

Open
jhellan opened this issue Sep 22, 2017 · 0 comments
Open

Timestamp inside collection does not round trip #78

jhellan opened this issue Sep 22, 2017 · 0 comments

Comments

@jhellan
Copy link

jhellan commented Sep 22, 2017

Here is a csv line that cassandra-loader is unable to parse:

554aa617-b9c3-4863-8dc2-8a2cd03b2f43,"{\"feide:[email protected]\":8/11/17 10:44 AM,\"p:2a08783f-9597-42d9-9cba-91248f1150ef\":8/3/17 8:25 AM}"

The line was produced by cassandra-unloader called like so:

cassandra-unloader -host <src ip> -f /tmp/example.csv -schema "dataporten.users(userid, userid_sec_seen)"

and we called cassandra-loader like so:

cassandra-loader -host <dst ip> -f /tmp/example.csv -schema "dataporten.users(userid, userid_sec_seen)"

We expected the second column to be loaded into the database and cqlsh to show it like this:

{'feide:[email protected]': '2017-08-11 08:44:39+0000', 'p:2a08783f-9597-42d9-9cba-91248f1150ef': '2017-08-03 06:25:35+0000'}

But cassandra-loader failed to parse the timestamps:

Trouble parsing : Unparseable date: "8/11/17 10"
java.text.ParseException: Unparseable date: "8/11/17 10"
    at java.text.DateFormat.parse(DateFormat.java:366)
    ...

This column is a collection:

`userid_sec_seen map<text,timestamp>`.

We were able to load timestamp columns, but when parsing the collection column, the loader gets confused about where the date ends. We suspect that the ':' in '10:44' gets misinterpreted. Should the unloader have escaped it?

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

No branches or pull requests

1 participant