mirror of
https://github.com/apache/impala.git
synced 2025-12-30 21:02:41 -05:00
The shell uses an external module called sqlparse to strip the comments from a query file. When sqlparse.format() is invoked, it runs several grouping functions on the tokenized query text; some of these methods are very slow, and not needed for comment removal. This change restricts sqlparse to only invoke the grouping function for removing comments. Change-Id: I3a067187667fcd3cd331156a325960a3de2db9c2 Reviewed-on: http://gerrit.ent.cloudera.com:8080/944 Reviewed-by: Ishaan Joshi <ishaan@cloudera.com> Tested-by: jenkins
python-sqlparse - Parse SQL statements ====================================== sqlparse is a non-validating SQL parser module for Python. |buildstatus|_ Install ------- Run:: python setup.py install to install python-sqlparse on your system. python-sqlparse is compatible with Python 2 (>= 2.5) and Python 3 (>= 3.2). Run Tests --------- To run the test suite run:: tox Note, you'll need tox installed, of course. Links ----- Project Page https://github.com/andialbrecht/sqlparse Documentation http://readthedocs.org/docs/sqlparse/en/latest/ Discussions http://groups.google.com/group/sqlparse Issues/Bugs https://github.com/andialbrecht/sqlparse/issues Online Demo http://sqlformat.appspot.com python-sqlparse is licensed under the BSD license. Parts of the code are based on pygments written by Georg Brandl and others. pygments-Homepage: http://pygments.org/ .. |buildstatus| image:: https://secure.travis-ci.org/andialbrecht/sqlparse.png?branch=master .. _buildstatus: http://travis-ci.org/#!/andialbrecht/sqlparse