GitHub user del680202 reopened a pull request: https://github.com/apache/zeppelin/pull/1960
[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  After  ### Questions: * Does the licenses files need update? * Is there breaking changes for older versions? * Does this needs documentation? You can merge this pull request into a Git repository by running: $ git pull https://github.com/del680202/zeppelin bug-2030 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/zeppelin/pull/1960.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1960 ---- commit 8f499c49ecb4bca1077674de12f44c9b67e4e66e Author: Chin Tzulin <jp20316@w022341412910m.local> Date: 2017-01-30T04:40:21Z [ZEPPELIN-2030] Select statement doesn't work in LivySparkSQLInterpreter commit d6811006efe4d36f9163a2d9d3a703d241d948c5 Author: Chin Tzulin <jp20316@w022341412910m.local> Date: 2017-01-31T06:26:20Z Add test case into LivySQLInterpreterTest.java commit 86ebc82ea9b5b70d7d9eaefc538d38aeaeae5029 Author: Chin Tzulin <jp20316@w022341412910m.local> Date: 2017-01-31T08:34:38Z Fix test problem ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---