Prints the runtime profile of the last DML statement or SELECT query executed.
(self, args)
| 1314 | self._build_query_string(self.last_leading_comment, self.orig_cmd, args)) |
| 1315 | |
| 1316 | def do_profile(self, args): |
| 1317 | """Prints the runtime profile of the last DML statement or SELECT query executed.""" |
| 1318 | split_args = args.split() |
| 1319 | if len(split_args) > 1: |
| 1320 | print("'profile' only accepts 0 or 1 arguments", file=sys.stderr) |
| 1321 | return CmdStatus.ERROR |
| 1322 | elif self.last_query_handle is None: |
| 1323 | print('No previous query available to profile', file=sys.stderr) |
| 1324 | return CmdStatus.ERROR |
| 1325 | |
| 1326 | # Parse and validate the QueryProfileDisplayModes option. |
| 1327 | profile_display_mode = QueryAttemptDisplayModes.LATEST |
| 1328 | if len(split_args) == 1: |
| 1329 | profile_display_mode = self.get_query_attempt_display_mode(split_args[0]) |
| 1330 | if profile_display_mode is None: |
| 1331 | return CmdStatus.ERROR |
| 1332 | |
| 1333 | profile, failed_profile = self.imp_client.get_runtime_profile( |
| 1334 | self.last_query_handle, self.profile_format) |
| 1335 | return self.print_runtime_profile(profile, failed_profile, profile_display_mode) |
| 1336 | |
| 1337 | def do_select(self, args): |
| 1338 | """Executes a SELECT... query, fetching all rows""" |
nothing calls this directly
no test coverage detected