dilipbiswal commented on a change in pull request #25532: 
[SPARK-28790][DOC][SQL]Document CACHE TABLE statement in SQL Reference
URL: https://github.com/apache/spark/pull/25532#discussion_r319743998
 
 

 ##########
 File path: docs/sql-ref-syntax-aux-cache-cache-table.md
 ##########
 @@ -19,4 +19,65 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+`CACHE TABLE` statement caches the table's contents with the given storage 
level. This reduces scanning of the original files in future queries.
+
+### Syntax
+{% highlight sql %}
+CACHE [ LAZY ] TABLE table_name
+    [ OPTIONS ( 'storageLevel' [ = ] value ) ] [ [ AS ] query ]
+{% endhighlight %}
+
+### Parameters
+<dl>
+  <dt><code><em>LAZY</em></code></dt>
+  <dd>Only cache the table when it is first used, instead of immediately.</dd>
+</dl>
+
+<dl>
+  <dt><code><em>table_name</em></code></dt>
+  <dd>The name of the table to be cached.</dd>
+</dl>
+
+<dl>
+  <dt><code><em>OPTIONS ( 'storageLevel' [ = ] value )</em></code></dt>
+  <dd>
+  <code>OPTIONS</code> clause with <code>storageLevel</code> key and value 
pair. If a key other than <code>storageLevel</code> is used, a WARN with 
message "org.apache.spark.sql.execution.command.CacheTableCommand: Invalid 
options: XXXX -> XXXX" will be issued. The valid options for 
<code>storageLevel</code> are:
+    <ul>
+      <li><code>NONE</code></li>
+      <li><code>DISK_ONLY</code></li>
+      <li><code>DISK_ONLY_2</code></li>
+      <li><code>MEMORY_ONLY</code></li>
+      <li><code>MEMORY_ONLY_2</code></li>
+      <li><code>MEMORY_ONLY_SER</code></li>
+      <li><code>MEMORY_ONLY_SER_2</code></li>
+      <li><code>MEMORY_AND_DISK</code></li>
+      <li><code>MEMORY_AND_DISK_2</code></li>
+      <li><code>MEMORY_AND_DISK_SER</code></li>
+      <li><code>MEMORY_AND_DISK_SER_2</code></li>
+      <li><code>OFF_HEAP</code></li>
+    </ul>
+    If invalid value is set for <code>storageLevel</code>, 
"java.lang.IllegalArgumentException: Invalid StorageLevel: XXXX" will be 
issued. If <code>storageLevel</code> is not explicitly set using 
<code>OPTIONS</code> clause,the default <code>storageLevel</code> is set to 
<code>MEMORY_AND_DISK</code>.
+  </dd>
+</dl>
+
+<dl>
+  <dt><code><em>query</em></code></dt>
+  <dd>A query that produces the rows to be inserted. It can be in one of 
following formats:
 
 Review comment:
   @huaxingao you meant "to be cached" ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to