After change https://issues.apache.org/jira/browse/SPARK-11157, which removed a single large Spark assembly in favor of multiple small jars, when you try to submit a Spark app to YARN on Windows (using spark-submit.cmd), the app fails with the following error:
Diagnostics: The command line has a length of 12046 exceeds maximum allowed length of 8191. Command starts with: @set SPARK_YARN_CACHE_FILES=[...]/.sparkStaging/application_[...] Failing this attempt. Failing the application.
So basically a large number of jars needed for staging in YARN causes exceeding Windows command line length limit.
Please see more details in the discussion here: