{"action":"created","issue":{"url":"https://api.github.com/repos/NFLabs/zeppelin/issues/346","labels_url":"https://api.github.com/repos/NFLabs/zeppelin/issues/346/labels{/name}","comments_url":"https://api.github.com/repos/NFLabs/zeppelin/issues/346/comments","events_url":"https://api.github.com/repos/NFLabs/zeppelin/issues/346/events","html_url":"https://github.com/NFLabs/zeppelin/pull/346","id":57584282,"number":346,"title":"spark sql interpreter should be able to open spark interpreter if spark interpreter is already not open","user":{"login":"guptarajat","id":545831,"avatar_url":"https://avatars.githubusercontent.com/u/545831?v=3","gravatar_id":"","url":"https://api.github.com/users/guptarajat","html_url":"https://github.com/guptarajat","followers_url":"https://api.github.com/users/guptarajat/followers","following_url":"https://api.github.com/users/guptarajat/following{/other_user}","gists_url":"https://api.github.com/users/guptarajat/gists{/gist_id}","starred_url":"https://api.github.com/users/guptarajat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guptarajat/subscriptions","organizations_url":"https://api.github.com/users/guptarajat/orgs","repos_url":"https://api.github.com/users/guptarajat/repos","events_url":"https://api.github.com/users/guptarajat/events{/privacy}","received_events_url":"https://api.github.com/users/guptarajat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-02-13T10:44:49Z","updated_at":"2015-03-05T03:06:49Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/NFLabs/zeppelin/pulls/346","html_url":"https://github.com/NFLabs/zeppelin/pull/346","diff_url":"https://github.com/NFLabs/zeppelin/pull/346.diff","patch_url":"https://github.com/NFLabs/zeppelin/pull/346.patch"},"body":"If I try to use %sql as first command in notebook it errors out. But if I run sc.version first and the run %sql commands then things work fine. The PR fixes this issue....\r\n\r\nPlease review...."},"comment":{"url":"https://api.github.com/repos/NFLabs/zeppelin/issues/comments/77298264","html_url":"https://github.com/NFLabs/zeppelin/pull/346#issuecomment-77298264","issue_url":"https://api.github.com/repos/NFLabs/zeppelin/issues/346","id":77298264,"user":{"login":"Leemoonsoo","id":1540981,"avatar_url":"https://avatars.githubusercontent.com/u/1540981?v=3","gravatar_id":"","url":"https://api.github.com/users/Leemoonsoo","html_url":"https://github.com/Leemoonsoo","followers_url":"https://api.github.com/users/Leemoonsoo/followers","following_url":"https://api.github.com/users/Leemoonsoo/following{/other_user}","gists_url":"https://api.github.com/users/Leemoonsoo/gists{/gist_id}","starred_url":"https://api.github.com/users/Leemoonsoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Leemoonsoo/subscriptions","organizations_url":"https://api.github.com/users/Leemoonsoo/orgs","repos_url":"https://api.github.com/users/Leemoonsoo/repos","events_url":"https://api.github.com/users/Leemoonsoo/events{/privacy}","received_events_url":"https://api.github.com/users/Leemoonsoo/received_events","type":"User","site_admin":false},"created_at":"2015-03-05T03:06:49Z","updated_at":"2015-03-05T03:06:49Z","body":"I agree with @swkimme 's approach.\r\nThe code would look like\r\n\r\n```\r\n         while (p instanceof WrappedInterpreter) {\r\n           if (p instanceof LazyOpenInterpreter) {\r\n             p.open();\r\n           }\r\n           p = ((WrappedInterpreter) p).getInnerInterpreter();\r\n         }\r\n```\r\n\r\n"}}