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

Exporting of types with back edges #4856

Closed
Kingloko opened this issue Feb 26, 2020 · 3 comments · Fixed by #4857
Closed

Exporting of types with back edges #4856

Kingloko opened this issue Feb 26, 2020 · 3 comments · Fixed by #4857
Assignees
Labels
area/import-export Issues related to data import and export. kind/bug Something is broken. status/accepted We accept to investigate/work on it.

Comments

@Kingloko
Copy link

Kingloko commented Feb 26, 2020

What version of Dgraph are you using?

v1.2.1

Have you tried reproducing the issue with the latest release?

yes

What is the hardware spec (RAM, OS)?

Ubuntu, 32gb, running inside the docker

Steps to reproduce the issue (command/config used to run Dgraph).

in shell:

dgraph zero &
dgraph  alpha &

in python

import pydgraph

client_stub = pydgraph.DgraphClientStub('localhost:9080')
client = pydgraph.DgraphClient(client_stub)
schema = """
back_edge: [uid] @reverse .
type WillCrash {
   back_edge
   <~back_edge>
}
"""
client.alter(pydgraph.Operation(schema=schema))

back in shell

curl localhost:8080/admin/export?format=json
curl localhost:8080/admin/shutdown
--cd into export dir 
dgraph bulk -f g01.json.gz -s g01.schema.gz 

Expected behaviour and actual result.

I'd expect it to successfully load via zero but I get the following error:

2020/02/26 20:28:32 while lexing <back_edge>:[uid] @reverse . 
<dgraph.type>:[string] @index(exact) . 
type WillCrash {
	back_edge
	~back_edge
}
 at line 5 column 1: Invalid schema. Unexpected ~

fwiw: If I change WillCrash to include "<~back_edge>" instead of the exported ~back_edge I have no issues

@Kingloko
Copy link
Author

Not sure if this is helpful or not - but I figured I'd add it

root@e7c29139044b:/dgraph/export/dgraph.r5.u0226.2027# gunzip g01.schema.gz 
root@e7c29139044b:/dgraph/export/dgraph.r5.u0226.2027# vim g01.schema 
bash: vim: command not found
root@e7c29139044b:/dgraph/export/dgraph.r5.u0226.2027# cat g01.schema 
<back_edge>:[uid] @reverse . 
<dgraph.type>:[string] @index(exact) . 
type WillCrash {
	back_edge
	~back_edge
}

@martinmr
Copy link
Contributor

Yeah, seems like a bug. Reverse predicate names require the <~pred> notation to be properly parsed. But it doesn't look like the export tool is taking care of that. I'll send a bug fix soon.

@Kingloko
Copy link
Author

Thanks @martinmr!

@sleto-it sleto-it added area/import-export Issues related to data import and export. kind/bug Something is broken. status/accepted We accept to investigate/work on it. labels Feb 26, 2020
@martinmr martinmr self-assigned this Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/import-export Issues related to data import and export. kind/bug Something is broken. status/accepted We accept to investigate/work on it.
Development

Successfully merging a pull request may close this issue.

3 participants