blob: 92dfc34d3da4d2c182b7609ce3ecf0ea6fd5070e [file] [log] [blame]
<!DOCTYPE html><html><head><title>R: Creates a table based on the dataset in a data source</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.15.3/dist/katex.min.css">
<script type="text/javascript">
const macros = { "\\R": "\\textsf{R}", "\\code": "\\texttt"};
function processMathHTML() {
var l = document.getElementsByClassName('reqn');
for (let e of l) { katex.render(e.textContent, e, { throwOnError: false, macros }); }
return;
}</script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.3/dist/katex.min.js"
onload="processMathHTML();"></script>
<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><div class="container">
<table style="width: 100%;"><tr><td>createTable {SparkR}</td><td style="text-align: right;">R Documentation</td></tr></table>
<h2>Creates a table based on the dataset in a data source</h2>
<h3>Description</h3>
<p>Creates a table based on the dataset in a data source. Returns a SparkDataFrame associated with
the table.
</p>
<h3>Usage</h3>
<pre><code class='language-R'>createTable(tableName, path = NULL, source = NULL, schema = NULL, ...)
</code></pre>
<h3>Arguments</h3>
<table>
<tr style="vertical-align: top;"><td><code>tableName</code></td>
<td>
<p>the qualified or unqualified name that designates a table. If no database
identifier is provided, it refers to a table in the current database.</p>
</td></tr>
<tr style="vertical-align: top;"><td><code>path</code></td>
<td>
<p>(optional) the path of files to load.</p>
</td></tr>
<tr style="vertical-align: top;"><td><code>source</code></td>
<td>
<p>(optional) the name of the data source.</p>
</td></tr>
<tr style="vertical-align: top;"><td><code>schema</code></td>
<td>
<p>(optional) the schema of the data required for some data sources.</p>
</td></tr>
<tr style="vertical-align: top;"><td><code>...</code></td>
<td>
<p>additional named parameters as options for the data source.</p>
</td></tr>
</table>
<h3>Details</h3>
<p>The data source is specified by the <code>source</code> and a set of options(...).
If <code>source</code> is not specified, the default data source configured by
&quot;spark.sql.sources.default&quot; will be used. When a <code>path</code> is specified, an external table is
created from the data at the given path. Otherwise a managed table is created.
</p>
<h3>Value</h3>
<p>A SparkDataFrame.
</p>
<h3>Note</h3>
<p>createTable since 2.2.0
</p>
<h3>Examples</h3>
<pre><code class="language-r">## Not run:
##D sparkR.session()
##D df &lt;- createTable(&quot;myjson&quot;, path=&quot;path/to/json&quot;, source=&quot;json&quot;, schema)
##D
##D createTable(&quot;people&quot;, source = &quot;json&quot;, schema = schema)
##D insertInto(df, &quot;people&quot;)
## End(Not run)
</code></pre>
<hr /><div style="text-align: center;">[Package <em>SparkR</em> version 3.2.3 <a href="00Index.html">Index</a>]</div>
</div>
</body></html>