def _build_spark_submit_command(self, application):
connection_cmd = self._get_spark_binary_path()<EOL>connection_cmd += ["<STR_LIT>", self._connection['<STR_LIT>']]<EOL>if self._conf:<EOL><INDENT>for key in self._conf:<EOL><INDENT>connection_cmd += ["<STR_LIT>", "<STR_LIT>".format(key, str(self._conf[key]))]<EOL><DEDENT><DEDENT>if self._env_vars and (self._is_kubernetes or self._is_yarn):<EOL><INDENT>if self._is_yarn:<EOL><INDENT>tmpl = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>tmpl = "<STR_LIT>"<EOL><DEDENT>for key in self._env_vars:<EOL><INDENT>connection_cmd += [<EOL>"<STR_LIT>",<EOL>tmpl.format(key, str(self._env_vars[key]))]<EOL><DEDENT><DEDENT>elif self._env_vars and self._connection['<STR_LIT>'] != "<STR_LIT>":<EOL><INDENT>self._env = self._env_vars  <EOL><DEDENT>elif self._env_vars and self._connection['<STR_LIT>'] == "<STR_LIT>":<EOL><INDENT>raise AirflowException(<EOL>"<STR_LIT>")<EOL><DEDENT>if self._is_kubernetes:<EOL><INDENT>connection_cmd += ["<STR_LIT>", "<STR_LIT>".format(<EOL>self._connection['<STR_LIT>'])]<EOL><DEDENT>if self._files:<EOL><INDENT>connection_cmd += ["<STR_LIT>", self._files]<EOL><DEDENT>if self._py_files:<EOL><INDENT>connection_cmd += ["<STR_LIT>", self._py_files]<EOL><DEDENT>if self._archives:<EOL><INDENT>connection_cmd += ["<STR_LIT>", self._archives]<EOL><DEDENT>if self._driver_class_path:<EOL><INDENT>connection_cmd += ["<STR_LIT>", self._driver_class_path]<EOL><DEDENT>if self._jars:<EOL><INDENT>connection_cmd += ["<STR_LIT>", self._jars]<EOL><DEDENT>if self._packages:<EOL><INDENT>connection_cmd += ["<STR_LIT>", self._packages]<EOL><DEDENT>if self._exclude_packages:<EOL><INDENT>connection_cmd += ["<STR_LIT>", self._exclude_packages]<EOL><DEDENT>if self._repositories:<EOL><INDENT>connection_cmd += ["<STR_LIT>", self._repositories]<EOL><DEDENT>if self._num_executors:<EOL><INDENT>connection_cmd += ["<STR_LIT>", str(self._num_executors)]<EOL><DEDENT>if self._total_executor_cores:<EOL><INDENT>connection_cmd += ["<STR_LIT>", str(self._total_executor_cores)]<EOL><DEDENT>if self._executor_cores:<EOL><INDENT>connection_cmd += ["<STR_LIT>", str(self._executor_cores)]<EOL><DEDENT>if self._executor_memory:<EOL><INDENT>connection_cmd += ["<STR_LIT>", self._executor_memory]<EOL><DEDENT>if self._driver_memory:<EOL><INDENT>connection_cmd += ["<STR_LIT>", self._driver_memory]<EOL><DEDENT>if self._keytab:<EOL><INDENT>connection_cmd += ["<STR_LIT>", self._keytab]<EOL><DEDENT>if self._principal:<EOL><INDENT>connection_cmd += ["<STR_LIT>", self._principal]<EOL><DEDENT>if self._name:<EOL><INDENT>connection_cmd += ["<STR_LIT>", self._name]<EOL><DEDENT>if self._java_class:<EOL><INDENT>connection_cmd += ["<STR_LIT>", self._java_class]<EOL><DEDENT>if self._verbose:<EOL><INDENT>connection_cmd += ["<STR_LIT>"]<EOL><DEDENT>if self._connection['<STR_LIT>']:<EOL><INDENT>connection_cmd += ["<STR_LIT>", self._connection['<STR_LIT>']]<EOL><DEDENT>if self._connection['<STR_LIT>']:<EOL><INDENT>connection_cmd += ["<STR_LIT>", self._connection['<STR_LIT>']]<EOL><DEDENT>connection_cmd += [application]<EOL>if self._application_args:<EOL><INDENT>connection_cmd += self._application_args<EOL><DEDENT>self.log.info("<STR_LIT>", connection_cmd)<EOL>return connection_cmd<EOL>
Construct the spark-submit command to execute.
:param application: command to append to the spark-submit command
:type application: str
:return: full command to be executed