You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "liyunzhang_intel (JIRA)" <ji...@apache.org> on 2015/04/01 03:03:52 UTC

[jira] [Commented] (PIG-4489) Add spark option to Util.getLocalTestMode()

    [ https://issues.apache.org/jira/browse/PIG-4489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14389803#comment-14389803 ] 

liyunzhang_intel commented on PIG-4489:
---------------------------------------

Hi [~mohitsabharwal]:
   We can add SparkLocalExecType like "TezLocalExecType".  when running the unittest , the command  will be
ant test-spark:  run spark unit tests
ant test-spark-local: run spark unit tests in local mode

And in SparkLauncher.java#startSparkIfNeeded  need change from 
{code}
private static void startSparkIfNeeded() throws PigException {
        if (sparkContext == null) {
            String master = System.getenv("SPARK_MASTER");
            if (master == null) {
                LOG.info("SPARK_MASTER not specified, using \"local\"");
                master = "local";
            }
    ...
}
{code}

to 
{code}
  private static void startSparkIfNeeded(PigContext pc) throws PigException {
        if (sparkContext == null) {
            String master = null;
            if (pc.getExecType().isLocal()) {
                 master = "local";
            }else{
                master = System.getenv("SPARK_MASTER");
            }
            if (master == null) {
                LOG.info("SPARK_MASTER not specified, using \"local\"");
                master = "local";
            }
  ....
}
{code}

> Add spark option to Util.getLocalTestMode() 
> --------------------------------------------
>
>                 Key: PIG-4489
>                 URL: https://issues.apache.org/jira/browse/PIG-4489
>             Project: Pig
>          Issue Type: Sub-task
>          Components: spark
>            Reporter: Mohit Sabharwal
>            Assignee: Mohit Sabharwal
>             Fix For: spark-branch
>
>
> Util.getLocalTestMode() currently only returns "tez_local" or "local".
> I see that ~212 testcases do this check, and we are not running these tests against Spark at this point.
> Currently all Spark tests run in local mode ("local" as a the Spark Cluster URL passed to JavaSparkContext), so we should enable these tests as well.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)