prestodb / presto

The official home of the Presto distributed SQL query engine for big data
http://prestodb.io
Apache License 2.0
16.06k stars 5.38k forks source link

Presto client return 0 even when query failed #2013

Closed linehrr closed 8 years ago

linehrr commented 9 years ago

Presto client always return 0 even when query failed. this makes it hard to detect the error.

the current way we do is to rely on the STDERR and see if STDERR is empty. but it's a hack not a proper way.

nezihyigitbasi commented 9 years ago

We hit the same issue some time ago and updated the presto-cli, please see my branch for the fix (I just rebased it to the current master): https://github.com/nezihyigitbasi/presto/tree/cli-fix

I will go ahead and create a PR for this shortly.

linehrr commented 9 years ago

System.exit(success ? 0 : 1);

I see this fix. hopefully the PR will be granted soon :)

snarayanank2 commented 9 years ago

It would be nice to have the actual error code returned as exit code. That's what we did in our internal fix.

nezihyigitbasi commented 9 years ago

A new PR is WIP to fix this issue: #2770