-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Store strings unescaped #1508
Comments
Thanks for reporting. This will break |
@niemeyer do you have a minimum working example? I'm having trouble reproducing this. This is what I've tried (on a fresh instance of Dgraph): First add some data containing a newline:
Perform the export:
RDF file seems to be ok:
Loads ok with bulkloader as well:
|
The problem can be reproduced when using the Go client. |
So this is the situation:
The quick and easy way to fix this is to escape newline in the Go client. Ideally though, I think it would be better to transmit to/from and store the strings inside Dgraph in the regular way (e.g. the byte sequence 65, 9, 66). Under that proposal, the only places where escaping/unescaping would have to occur is when parsing RDFs and formating RDFs for the export. That way, when new clients are written the authors won't have to worry about any custom escaping rules. These authors could be third party community authors, so it would be nice not to surprise them. |
This sounds related to #1484 as well. It's very error prone to have a SetStringValue function whose parameter needs to be escaped in various cases and also certain predefined strings avoided to not get data corruption. It should really be up to the driver to make sure whatever was passed in is what's actually stored and that it roundtrips back into the same string when consumed via any of the available means. |
Summary of discussion with @manishrjain and @janardhan1993 :
|
PR: #1587 |
Merged to master in 9772a86 |
On an rdf file produced by the internal export routine itself, bulkloader breaks if there were embedded newlines:
Exported file content holds:
The text was updated successfully, but these errors were encountered: