[ZEPPELIN-2030] Select statement doesn't work in LivySparkSQLInterpreter

### What is this PR for?
I try to execute sql query by ``%livy.sql``, I got a error as below
```
ERROR [2017-01-30 11:15:57,060] ({pool-2-thread-6} LivySparkSQLInterpreter.java[interpret]:143) - Exception in LivySparkSQLInterpreter while interpret
java.lang.StringIndexOutOfBoundsException: String index out of range: 28
        at java.lang.String.substring(String.java:1963)
        at org.apache.zeppelin.livy.LivySparkSQLInterpreter.parseSQLOutput(LivySparkSQLInterpreter.java:177)
        at org.apache.zeppelin.livy.LivySparkSQLInterpreter.interpret(LivySparkSQLInterpreter.java:128)
        at org.apache.zeppelin.interpreter.LazyOpenInterpreter.interpret(LazyOpenInterpreter.java:94)
        at org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:489)
        at org.apache.zeppelin.scheduler.Job.run(Job.java:175)
        at org.apache.zeppelin.scheduler.FIFOScheduler$1.run(FIFOScheduler.java:139)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
```
I seem ``parseSQLOutput`` method try to filter out ``only showing top 1 row`` but it doesn't.
Therefore, I fix this issue by modifying condition

### What type of PR is it?
Bug Fix

### Todos
* [x] - none

### What is the Jira issue?
[ZEPPELIN-2030](https://issues.apache.org/jira/browse/ZEPPELIN-2030)

### How should this be tested?
try  to execute ``%livy.sql  SELECT * FROM bank`` on  tutorial

### Screenshots (if appropriate)
Before
![2017-01-30 11 42 15](https://cloud.githubusercontent.com/assets/3747345/22412521/73c09e70-e6f2-11e6-9db4-d948201b7e9e.png)

After
![2017-01-30 12 08 13](https://cloud.githubusercontent.com/assets/3747345/22412525/806e3696-e6f2-11e6-909e-6c4ffade4356.png)

### Questions:
* Does the licenses files need update?
* Is there breaking changes for older versions?
* Does this needs documentation?

Author: Chin Tzulin <jp20316@w022341412910m.local>

Closes #1960 from del680202/bug-2030 and squashes the following commits:

86ebc82 [Chin Tzulin] Fix test problem
d681100 [Chin Tzulin] Add test case into LivySQLInterpreterTest.java
8f499c4 [Chin Tzulin] [ZEPPELIN-2030] Select statement doesn't work in LivySparkSQLInterpreter

(cherry picked from commit 8774f80732927eaa62709ea0f790fb165847a389)
Signed-off-by: Mina Lee <minalee@apache.org>
2 files changed
tree: efef8c164d8bb36a635bff5c0f6243e81b23949e
  1. .github/
  2. _tools/
  3. alluxio/
  4. angular/
  5. beam/
  6. bigquery/
  7. bin/
  8. cassandra/
  9. conf/
  10. dev/
  11. docs/
  12. elasticsearch/
  13. file/
  14. flink/
  15. geode/
  16. hbase/
  17. helium-dev/
  18. ignite/
  19. interpreter/
  20. jdbc/
  21. kylin/
  22. lens/
  23. licenses/
  24. livy/
  25. markdown/
  26. notebook/
  27. pig/
  28. postgresql/
  29. python/
  30. r/
  31. scalding/
  32. scio/
  33. scripts/
  34. shell/
  35. spark/
  36. spark-dependencies/
  37. testing/
  38. zeppelin-display/
  39. zeppelin-distribution/
  40. zeppelin-examples/
  41. zeppelin-interpreter/
  42. zeppelin-server/
  43. zeppelin-web/
  44. zeppelin-zengine/
  45. .gitignore
  46. .travis.yml
  47. LICENSE
  48. NOTICE
  49. pom.xml
  50. README.md
  51. Roadmap.md
  52. SECURITY-README.md
  53. STYLE.md
README.md

Apache Zeppelin

Documentation: User Guide
Mailing Lists: User and Dev mailing list
Continuous Integration: Build Status
Contributing: Contribution Guide
Issue Tracker: Jira
License: Apache 2.0

Zeppelin, a web-based notebook that enables interactive data analytics. You can make beautiful data-driven, interactive and collaborative documents with SQL, Scala and more.

Core feature:

  • Web based notebook style editor.
  • Built-in Apache Spark support

To know more about Zeppelin, visit our web site http://zeppelin.apache.org

Getting Started

Install binary package

Please go to install to install Apache Zeppelin from binary package.

Build from source

Please check Build from source to build Zeppelin from source.