Fix return status of summary within impala shell

Follow up fix to IMPALA-1153. Ensure that the correct
CmdStatus is returned by the summary command. (ERROR for
invalid queries and SUCCESS even if summary is not available.)

Change-Id: Icf67164dc82f202ec15071541f6ed3b26e3ad7fb
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4089
Reviewed-by: Abdullah Yousufi <abdullah.yousufi@cloudera.com>
Tested-by: jenkins
This commit is contained in:
Abdullah Yousufi
2014-08-28 11:47:38 -07:00
committed by Lenni Kuff
parent 9853f74db1
commit f11de455a0
2 changed files with 3 additions and 3 deletions

View File

@@ -387,10 +387,10 @@ class ImpalaShell(cmd.Cmd):
pass
if summary is None:
print_to_stderr("Could not retrieve summary for query.")
return True
return CmdStatus.ERROR
if summary.nodes is None:
print_to_stderr("Summary not available")
return True
return CmdStatus.SUCCESS
output = []
table = self.construct_table_header(["Operator", "#Hosts", "Avg Time", "Max Time",
"#Rows", "Est. #Rows", "Peak Mem",

View File

@@ -258,7 +258,7 @@ class TestImpalaShell(object):
assert "03:AGGREGATE" in result_set.stdout
args = "-q 'summary;'"
result_set = run_impala_shell_cmd(args)
result_set = run_impala_shell_cmd(args, expect_success=False)
assert "Could not retrieve summary for query" in result_set.stderr
args = "-q 'show tables; summary;'"