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)
| 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 |