Skip to content
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ on:
description: Hadoop version to run with. HADOOP_PROFILE environment variable should accept it.
required: false
type: string
default: hadoop3
default: hadoop2

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for test hadoop-2, will revert after confirmation takes effect

envs:
description: Additional environment variables to set when running the tests. Should be in JSON format.
required: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1470,6 +1470,11 @@ private[spark] object Client extends Logging {
addClasspathEntry(getClusterPath(sparkConf, cp), env)
}

val cpSet = extraClassPath match {
case Some(classPath) if Utils.isTesting => classPath.split(File.pathSeparator).toSet
case _ => Set.empty[String]
}

addClasspathEntry(Environment.PWD.$$(), env)

addClasspathEntry(Environment.PWD.$$() + Path.SEPARATOR + LOCALIZED_CONF_DIR, env)
Expand Down Expand Up @@ -1513,7 +1518,11 @@ private[spark] object Client extends Logging {
}

sys.env.get(ENV_DIST_CLASSPATH).foreach { cp =>
addClasspathEntry(getClusterPath(sparkConf, cp), env)
val newCp = if (Utils.isTesting) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe let's add a comment with mentioning the JIRA number.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, will add comments after the hadoop2 check pass

cp.split(File.pathSeparator)
.filterNot(cpSet.contains).mkString(File.pathSeparator)
} else cp
addClasspathEntry(getClusterPath(sparkConf, newCp), env)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to deduplicate jars that have been added to CLASSPATH through extraClassPath

@LuciferYang LuciferYang Oct 3, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to change it to

      val newCp = if (Utils.isTesting) {
        cp.split(File.pathSeparator)
          .filterNot(cpSet.contains).mkString(File.pathSeparator)
      } else cp

but I think de duplication may also be useful for the production environment

}

// Add the localized Hadoop config at the end of the classpath, in case it contains other
Expand Down