I use Dgraph v20.07.1 and trying to bulk load a json file with a graphql schema file like:
type User {
id: String! @id
username: String @search(by: [hash, regexp])
followees: [User]
}
I use the following command:
dgraph bulk -f users.json -s schema.graphql --map_shards=9 --reduce_shards=3 --http localhost:8000 --zero=localhost:5080
but i get this error:
2020/09/29 17:43:54 line 2 column 16: Expected new line after field declaration. Got @
github.com/dgraph-io/dgraph/lex.Item.Errorf
/ext-go/1/src/github.com/dgraph-io/dgraph/lex/lexer.go:54
github.com/dgraph-io/dgraph/schema.parseTypeField
/ext-go/1/src/github.com/dgraph-io/dgraph/schema/parse.go:401
github.com/dgraph-io/dgraph/schema.parseTypeDeclaration
/ext-go/1/src/github.com/dgraph-io/dgraph/schema/parse.go:342
github.com/dgraph-io/dgraph/schema.Parse
/ext-go/1/src/github.com/dgraph-io/dgraph/schema/parse.go:458
github.com/dgraph-io/dgraph/dgraph/cmd/bulk.readSchema
/ext-go/1/src/github.com/dgraph-io/dgraph/dgraph/cmd/bulk/loader.go:169
github.com/dgraph-io/dgraph/dgraph/cmd/bulk.newLoader
/ext-go/1/src/github.com/dgraph-io/dgraph/dgraph/cmd/bulk/loader.go:123
github.com/dgraph-io/dgraph/dgraph/cmd/bulk.run
/ext-go/1/src/github.com/dgraph-io/dgraph/dgraph/cmd/bulk/run.go:228
github.com/dgraph-io/dgraph/dgraph/cmd/bulk.init.0.func1
/ext-go/1/src/github.com/dgraph-io/dgraph/dgraph/cmd/bulk/run.go:48
github.com/spf13/cobra.(*Command).execute
/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:830
github.com/spf13/cobra.(*Command).ExecuteC
/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:914
github.com/spf13/cobra.(*Command).Execute
/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:864
github.com/dgraph-io/dgraph/dgraph/cmd.Execute
/ext-go/1/src/github.com/dgraph-io/dgraph/dgraph/cmd/root.go:70
main.main
/ext-go/1/src/github.com/dgraph-io/dgraph/dgraph/main.go:78
runtime.main
/usr/local/go/src/runtime/proc.go:203
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1373
github.com/dgraph-io/dgraph/x.Check
/ext-go/1/src/github.com/dgraph-io/dgraph/x/error.go:42
github.com/dgraph-io/dgraph/dgraph/cmd/bulk.readSchema
/ext-go/1/src/github.com/dgraph-io/dgraph/dgraph/cmd/bulk/loader.go:170
github.com/dgraph-io/dgraph/dgraph/cmd/bulk.newLoader
/ext-go/1/src/github.com/dgraph-io/dgraph/dgraph/cmd/bulk/loader.go:123
github.com/dgraph-io/dgraph/dgraph/cmd/bulk.run
/ext-go/1/src/github.com/dgraph-io/dgraph/dgraph/cmd/bulk/run.go:228
github.com/dgraph-io/dgraph/dgraph/cmd/bulk.init.0.func1
/ext-go/1/src/github.com/dgraph-io/dgraph/dgraph/cmd/bulk/run.go:48
github.com/spf13/cobra.(*Command).execute
/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:830
github.com/spf13/cobra.(*Command).ExecuteC
/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:914
github.com/spf13/cobra.(*Command).Execute
/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:864
github.com/dgraph-io/dgraph/dgraph/cmd.Execute
/ext-go/1/src/github.com/dgraph-io/dgraph/dgraph/cmd/root.go:70
main.main
/ext-go/1/src/github.com/dgraph-io/dgraph/dgraph/main.go:78
runtime.main
/usr/local/go/src/runtime/proc.go:203
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1373
it seems that bulk loader is not compatible with graphql schema, should i convert the schema file to something else?