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

Method _remove_comments_before_set

shell/impala_shell/impala_shell.py:499–505  ·  view source on GitHub ↗

SET commands preceded by a comment become a SET query, which are not processed locally. SET VAR:* commands must be processed locally, since they are not known to the frontend. Thus, we remove comments that precede SET commands to enforce the local processing.

(self, line)

Source from the content-addressed store, hash-verified

497 return CmdStatus.ERROR
498
499 def _remove_comments_before_set(self, line):
500 """SET commands preceded by a comment become a SET query, which are not processed
501 locally. SET VAR:* commands must be processed locally, since they are not known
502 to the frontend. Thus, we remove comments that precede SET commands to enforce the
503 local processing."""
504 regexp = re.compile(ImpalaShell.COMMENTS_BEFORE_SET_PATTERN, re.IGNORECASE)
505 return regexp.sub(ImpalaShell.COMMENTS_BEFORE_SET_REPLACEMENT, line, 1)
506
507 def sanitise_input(self, args):
508 # A command terminated by a semi-colon is legal. Check for the trailing

Callers 1

sanitise_inputMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected