blob: 7f9ef3e2f74f207f13a893f3f59956f24228f557 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Create a SparkDataFrame from a SparkSQL Table</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 tableToDF {SparkR}"><tr><td>tableToDF {SparkR}</td><td align="right">R Documentation</td></tr></table>
<h2>Create a SparkDataFrame from a SparkSQL Table</h2>
<h3>Description</h3>
<p>Returns the specified Table as a SparkDataFrame. The Table must have already been registered
in the SparkSession.
</p>
<h3>Usage</h3>
<pre>
tableToDF(tableName)
</pre>
<h3>Arguments</h3>
<table summary="R argblock">
<tr valign="top"><td><code>tableName</code></td>
<td>
<p>The SparkSQL Table to convert to a SparkDataFrame.</p>
</td></tr>
</table>
<h3>Value</h3>
<p>SparkDataFrame
</p>
<h3>Note</h3>
<p>tableToDF since 2.0.0
</p>
<h3>Examples</h3>
<pre><code class="r">## Not run:
##D sparkR.session()
##D path &lt;- &quot;path/to/file.json&quot;
##D df &lt;- read.json(path)
##D createOrReplaceTempView(df, &quot;table&quot;)
##D new_df &lt;- tableToDF(&quot;table&quot;)
## End(Not run)
</code></pre>
<hr><div align="center">[Package <em>SparkR</em> version 2.1.1 <a href="00Index.html">Index</a>]</div>
</body></html>