MCPcopy Create free account
hub / github.com/apache/impala / _has_leading_comment

Method _has_leading_comment

shell/impala_shell/impala_shell.py:1826–1835  ·  view source on GitHub ↗

Helper function that returns Boolean true if a query starts with a comment. This saves us from relying on sqlparse filtering, which can be slow.

(raw_line)

Source from the content-addressed store, hash-verified

1824
1825 @staticmethod
1826 def _has_leading_comment(raw_line):
1827 """
1828 Helper function that returns Boolean true if a query starts with a comment.
1829 This saves us from relying on sqlparse filtering, which can be slow.
1830 """
1831 line = raw_line.lstrip()
1832 if line and (line.startswith('--') or line.startswith('/*')):
1833 return True
1834 else:
1835 return False
1836
1837 @staticmethod
1838 def strip_leading_comment(sql):

Callers 1

parselineMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected