@logExceptions(_LOGGER)<EOL><INDENT>@g_retrySQL<EOL>def modelsGetFieldsForJob(self, jobID, fields, ignoreKilled=False):<DEDENT>
assert len(fields) >= <NUM_LIT:1>, '<STR_LIT>'<EOL>dbFields = [self._models.pubToDBNameDict[x] for x in fields]<EOL>dbFieldsStr = '<STR_LIT:U+002C>'.join(dbFields)<EOL>query = '<STR_LIT>''<STR_LIT>'% (dbFieldsStr, self.modelsTableName)<EOL>sqlParams = [jobID]<EOL>if ignoreKilled:<EOL><INDENT>query += '<STR_LIT>'<EOL>sqlParams.append(self.CMPL_REASON_KILLED)<EOL><DEDENT>with ConnectionFactory.get() as conn:<EOL><INDENT>conn.cursor.execute(query, sqlParams)<EOL>rows = conn.cursor.fetchall()<EOL><DEDENT>if rows is None:<EOL><INDENT>self._logger.error("<STR_LIT>"<EOL>"<STR_LIT>",<EOL>query, traceback.format_exc())<EOL><DEDENT>return [(r[<NUM_LIT:0>], list(r[<NUM_LIT:1>:])) for r in rows]<EOL>
Gets the specified fields for all the models for a single job. This is
        similar to modelsGetFields

        Parameters:
        ----------------------------------------------------------------
        jobID:              jobID for the models to be searched
        fields:             A list  of fields to return
        ignoreKilled:       (True/False). If True, this will ignore models that
                            have been killed

        Returns: a (possibly empty) list of tuples as follows
          [
            (model_id1, [field1, ..., fieldn]),
            (model_id2, [field1, ..., fieldn]),
            (model_id3, [field1, ..., fieldn])
                        ...
          ]

        NOTE: since there is a window of time between a job getting inserted into
         jobs table and the job's worker(s) starting up and creating models, an
         empty-list result is one of the normal outcomes.