def to_flyte_idl(self): """ :rtype: flyteidl.plugins.spark_pb2.SparkJob """ if self.spark_type == _spark_type.PYTHON: application_type = _spark_task.SparkApplication.PYTHON elif self.spark_type == _spark_type.JAVA: application_type = _spark_task.SparkApplication.JAVA elif self.spark_type == _spark_type.SCALA: application_type = _spark_task.SparkApplication.SCALA elif self.spark_type == _spark_type.R: application_type = _spark_task.SparkApplication.R else: raise _user_exceptions.FlyteValidationException( "Invalid Spark Application Type Specified") return _spark_task.SparkJob( applicationType=application_type, mainApplicationFile=self.application_file, mainClass=self.main_class, executorPath=self.executor_path, sparkConf=self.spark_conf, hadoopConf=self.hadoop_conf, )
def to_flyte_idl(self): """ :rtype: flyteidl.plugins.spark_pb2.SparkJob """ return _spark_task.SparkJob( mainApplicationFile=self.application_file, executorPath=self.executor_path, sparkConf=self.spark_conf, hadoopConf=self.hadoop_conf, )