Commit Graph

21 Commits

Author SHA1 Message Date
Abdullah Yousufi
6c1e272ef7 IMPALA-1059: Make backticking -d option argument idempotent
There was an issue with the previous fix to IMPALA-1059
if the user tried to reconnect within the shell after
having passed in a database via the -d option. The
passed database would be doubly backticked. This makes
the backticking of the argument idempotent.

Change-Id: I6eaed997c2be73d8659a2a12046ce393b97ec82c
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3467
Reviewed-by: Abdullah Yousufi <abdullah.yousufi@cloudera.com>
Tested-by: jenkins
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3502
2014-07-15 18:10:40 -07:00
Abdullah Yousufi
864ed53511 IMPALA-1059: Backtick argument passed to USE by shell -d option
If not backticked, arguments such as parquet are interpreted as
keywords, when it is possible a database by that name exists.

This could have been avoided via single quotes around backticks: -d '`parquet`'
Otherwise, -d `parquet` throws a commandline error.

In interactive mode, backticks alone (ex. use `parquet`) will pass the
name as an identifier rather than a keyword.

Change-Id: I24b43eeeb6b4bfda5388165856788a20b64bc2ba
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3307
Reviewed-by: Abdullah Yousufi <abdullah.yousufi@cloudera.com>
Tested-by: jenkins
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3500
2014-07-15 15:43:49 -07:00
Abdullah Yousufi
f4d1afe0ce IMPALA-921: Change EXPLAIN_LEVEL value from 0 to 1 in impala-shell for SET command
Change-Id: I2bfcefb5c8143d4cb4d74157c5309cd9445bac02
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3383
Reviewed-by: Abdullah Yousufi <abdullah.yousufi@cloudera.com>
Tested-by: jenkins
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3499
2014-07-15 12:32:43 -07:00
ishaan
f262fcea64 Support utf-8 input and out in the shell
Also add --strict_unicode option which controls whether invalid unicode
code points should be ignored on input.

Change-Id: Ice59d6dd3df4557ab3b1fc91d7ddc0e1bf03f1c7
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3218
Reviewed-by: Lenni Kuff <lskuff@cloudera.com>
Tested-by: jenkins
2014-07-02 23:18:27 -07:00
Alex Behm
ef6705d7e0 Rename MergeNode to UnionNode.
Change-Id: I9e3675a103757db1345b04bd1d102d2719efddd0
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3128
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: jenkins
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3154
Tested-by: Alex Behm <alex.behm@cloudera.com>
2014-06-19 12:44:21 -07:00
Skye Wanderman-Milne
c3c9365c17 Change shell to print WARNINGS instead of ERRORS
Change-Id: I8b41a2f4307e31eda970ca891adb4f12fea926bb
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3088
Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com>
Tested-by: Skye Wanderman-Milne <skye@cloudera.com>
(cherry picked from commit 0a655f759d5096def89d2c72be5aa9a0cb2c10b1)
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3149
2014-06-19 10:42:58 -07:00
Henry Robinson
d162571211 Fix 'summary' when exch map is not set
Change-Id: I66d9987f45f6cee045a300f86de357a2761929d7
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3000
Reviewed-by: Henry Robinson <henry@cloudera.com>
Tested-by: jenkins
(cherry picked from commit 6f82cb296d0b3f0546d4e8a26485b79f20ff8996)
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3020
Tested-by: Henry Robinson <henry@cloudera.com>
2014-06-12 22:18:04 -07:00
Henry Robinson
9a7c6d286f Add 'summary' to shell
Users can now type 'summary' in the Impala shell after a query executes
to get a breakdown of the work done by each part of the query plan.

Change-Id: Ia6a43429ffc7778f3c2c8fcbf45d83828263c2ab
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2963
Tested-by: jenkins
Reviewed-by: Henry Robinson <henry@cloudera.com>
(cherry picked from commit 9b98d42acb14d43a64832767528ee572eac4979b)
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2995
2014-06-12 02:59:58 -07:00
ayousufi
66e90d75ee IMPALA-286: Display set query options in default section in impala-shell
Options displayed with 'set' command. Default values distinguished
from set values by square brackets.

Change-Id: Iacf0574555aab78aa0ba2008ceb8776d372a57a5
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2913
Reviewed-by: Abdullah Yousufi <abdullah.yousufi@cloudera.com>
Tested-by: jenkins
2014-06-11 11:51:19 -07:00
Skye Wanderman-Milne
76fa721cc4 Make shell only print error/warning log once.
Without this change, the shell would always print the error log twice
for successful non-insert queries (once in __execute_query() and once
in __fetch()).

Change-Id: I0ab038230df897559b30feaea34778ea72988bc3
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2815
Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com>
Tested-by: jenkins
(cherry picked from commit 095dba7f395491db03daf19ff3bff2e2b4640ee4)
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2908
2014-06-09 13:40:14 -07:00
Taras Bobrovytsky
46aba6149d CDH-18512: Modification to allow spaces around the = sign in SET in impala-shell
Change-Id: I3c149e9a27962ed1130b1ddbb02952f4254bd4c9
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2609
Reviewed-by: Taras Bobrovytsky <tbobrovytsky@cloudera.com>
Tested-by: jenkins
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2645
2014-05-21 15:34:24 -07:00
Alex Behm
91db96d903 IMPALA-762: Add the query status to Beeswax::get_log() and pick it up in the Impala shell.
COMPUTE STATS is an async DDL command. When COMPUTE STATS fails it will set the
query status of the QueryExecState properly, but the original Beeswax::query() RPC
won't throw. The Impala shell sometimes did not pick up and display the
query status because no RPC actually threw. To fix this, I modified
Beeswax::get_log() to include the query status if it is not ok. The shell looks
for a special prefix to distinguish the query status from the runtime state error log.

Change-Id: I0d9dbf0801629a37de22ea4ebb6d2e5d53b836ef
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1899
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: jenkins
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2063
2014-04-10 15:47:06 -07:00
Lenni Kuff
70c05d4caa IMPALA-897: shell does not close queries after completion when running from a script
The problem was that we were setting a flag marking the last_query_handle as closed, but
were not resetting the flag before the next query. This caused the first query to
be closed properly, but subsequent queries would not be closed. The fix is to change
where the flag is reset to the same place as where we assign last_query_handle.

Added a test case.

Change-Id: I870a96789489bfe4f388910b808409cd0584af8a
(cherry picked from commit 1439151af5b63112b0dd631fac9c7ab4d43bba37)
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1976
Reviewed-by: Lenni Kuff <lskuff@cloudera.com>
Tested-by: jenkins
2014-03-18 18:46:54 -07:00
ishaan
17761f1f5e IMPALA-571 The shell should be able to cancel a query during an rpc.
This change makes the fetch rpc interruptable. If the user cancels the query in
the middle of a fetch, the shell reconnects to the impalad and closes the
query. It also includes some code consolidation.

Change-Id: Iaaf0dfd4cba9ce2557e4a7d0447bc9c3ffda5e29
Reviewed-on: http://gerrit.ent.cloudera.com:8080/717
Reviewed-by: Ishaan Joshi <ishaan@cloudera.com>
Tested-by: jenkins
2014-01-08 10:54:12 -08:00
ishaan
c0129a1683 Improve the Impala shell's behavior when attempting to connect to a keberized impalad.
This change has the following additions:
- If the user's connecting to a kerberized impalad, the Impala shell will check
  whether a valid ticket exists by running 'klist -s'. If a valid ticket is not found,
  then the shell will exit with an appropriate error message on the commandline.
- If the user's connecting to a kerberized impalad without the '-k' option, the Impala
  Shell will issue a 'klist -s' to check if there are valid kerberos tickets in the
  credentials cache. If a valid ticket is found, it will retry the connection with
  kerberos enabled.
- The Impala shell encodes strings entered on the commandline as unicode. The sasl
  module expects ascii strings as arguments. Explcitly encode any string sent to the
  sasl module to ascii.

Change-Id: I1799b1e7988a19fa513b683afe1e3b66b68c1ffc
Reviewed-on: http://gerrit.ent.cloudera.com:8080/535
Reviewed-by: Ishaan Joshi <ishaan@cloudera.com>
Tested-by: Ishaan Joshi <ishaan@cloudera.com>
2014-01-08 10:53:02 -08:00
Henry Robinson
8cee9fa138 Fix failing test_shell_commandline
Change-Id: Iea170885f740ceeb08e21e64ef88ab44584fa270
Reviewed-on: http://gerrit.ent.cloudera.com:8080/545
Tested-by: jenkins
Reviewed-by: Lenni Kuff <lskuff@cloudera.com>
2014-01-08 10:53:01 -08:00
Skye Wanderman-Milne
efac6f82fd Print errors to shell in BaseSequenceScanner.
Change-Id: I0d1b041695c0d61b8c4994833f0a703e3bfa9c6a
Reviewed-on: http://gerrit.ent.cloudera.com:8080/278
Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com>
Tested-by: Skye Wanderman-Milne <skye@cloudera.com>
2014-01-08 10:52:20 -08:00
Lenni Kuff
039bfa475d Update impala-shell to print errors from RuntimeState after query completion 2014-01-08 10:51:47 -08:00
ishaan
77859a5262 Add shell tests for startup display messages for connections. 2014-01-08 10:51:31 -08:00
Lenni Kuff
5946801c73 Disable shell test case for kerberos flag 2014-01-08 10:51:28 -08:00
ishaan
7c83abba9a Add unittests for the non-interactive shell. 2014-01-08 10:51:27 -08:00