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

Run bulk loader existence check on individual files #3681

Merged
merged 1 commit into from
Jul 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions dgraph/cmd/bulk/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,16 @@ func run() {
if opt.DataFiles == "" {
fmt.Fprint(os.Stderr, "RDF or JSON file(s) location must be specified.\n")
os.Exit(1)
} else if _, err := os.Stat(opt.DataFiles); err != nil && os.IsNotExist(err) {
fmt.Fprintf(os.Stderr, "Data path(%v) does not exist.\n", opt.DataFiles)
os.Exit(1)
} else {
fileList := strings.Split(opt.DataFiles, ",")
for _, file := range fileList {
if _, err := os.Stat(file); err != nil && os.IsNotExist(err) {
fmt.Fprintf(os.Stderr, "Data path(%v) does not exist.\n", file)
os.Exit(1)
}
}
}

if opt.ReduceShards > opt.MapShards {
fmt.Fprintf(os.Stderr, "Invalid flags: reduce_shards(%d) should be <= map_shards(%d)\n",
opt.ReduceShards, opt.MapShards)
Expand Down