Repository: incubator-zeppelin Updated Branches: refs/heads/master 2d0fc518e -> 9a3e55533
ZEPPELIN-205: Expand the SQL matching rule to cover various SQL-like ⦠â¦interpreters Author: tzolov <[email protected]> Closes #182 from tzolov/ZEPPELIN-205 and squashes the following commits: 18bfd60 [tzolov] ZEPPELIN-205: Expand the SQL matching rule to cover various SQL-like interpreters Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/9a3e5553 Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/9a3e5553 Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/9a3e5553 Branch: refs/heads/master Commit: 9a3e555339042d3ed435fe51f6ddb89c032fa88b Parents: 2d0fc51 Author: tzolov <[email protected]> Authored: Thu Aug 6 10:50:56 2015 +0200 Committer: Lee moon soo <[email protected]> Committed: Fri Aug 7 21:14:22 2015 -0700 ---------------------------------------------------------------------- zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/9a3e5553/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js index afa3dbf..7091e28 100644 --- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js +++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js @@ -472,8 +472,9 @@ angular.module('zeppelinWebApp') $scope.editor.resize(); }); + var sqlModeTest = /^%(\w*\.)?\wql/; var code = $scope.editor.getSession().getValue(); - if ( String(code).startsWith('%sql')) { + if (sqlModeTest.test(String(code))) { $scope.editor.getSession().setMode(editorMode.sql); } else if ( String(code).startsWith('%md')) { $scope.editor.getSession().setMode(editorMode.markdown);
