| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Add a file or directory to be downloaded with this Spark job...</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| <link rel="stylesheet" type="text/css" href="R.css" /> |
| |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/styles/github.min.css"> |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/highlight.min.js"></script> |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/languages/r.min.js"></script> |
| <script>hljs.initHighlightingOnLoad();</script> |
| </head><body> |
| |
| <table width="100%" summary="page for spark.addFile {SparkR}"><tr><td>spark.addFile {SparkR}</td><td style="text-align: right;">R Documentation</td></tr></table> |
| |
| <h2>Add a file or directory to be downloaded with this Spark job on every node.</h2> |
| |
| <h3>Description</h3> |
| |
| <p>The path passed can be either a local file, a file in HDFS (or other Hadoop-supported |
| filesystems), or an HTTP, HTTPS or FTP URI. To access the file in Spark jobs, |
| use spark.getSparkFiles(fileName) to find its download location. |
| </p> |
| |
| |
| <h3>Usage</h3> |
| |
| <pre> |
| spark.addFile(path, recursive = FALSE) |
| </pre> |
| |
| |
| <h3>Arguments</h3> |
| |
| <table summary="R argblock"> |
| <tr valign="top"><td><code>path</code></td> |
| <td> |
| <p>The path of the file to be added</p> |
| </td></tr> |
| <tr valign="top"><td><code>recursive</code></td> |
| <td> |
| <p>Whether to add files recursively from the path. Default is FALSE.</p> |
| </td></tr> |
| </table> |
| |
| |
| <h3>Details</h3> |
| |
| <p>A directory can be given if the recursive option is set to true. |
| Currently directories are only supported for Hadoop-supported filesystems. |
| Refer Hadoop-supported filesystems at |
| <a href="https://cwiki.apache.org/confluence/display/HADOOP2/HCFS">https://cwiki.apache.org/confluence/display/HADOOP2/HCFS</a>. |
| </p> |
| <p>Note: A path can be added only once. Subsequent additions of the same path are ignored. |
| </p> |
| |
| |
| <h3>Note</h3> |
| |
| <p>spark.addFile since 2.1.0 |
| </p> |
| |
| |
| <h3>Examples</h3> |
| |
| <pre><code class="r">## Not run: |
| ##D spark.addFile("~/myfile") |
| ## End(Not run) |
| </code></pre> |
| |
| |
| <hr /><div style="text-align: center;">[Package <em>SparkR</em> version 2.4.7 <a href="00Index.html">Index</a>]</div> |
| </body></html> |