Skip to content

Commit ce7a49f

Browse files
iRaksonsrowen
authored andcommitted
[SPARK-30363][SQL][DOC] Add Documentation for refresh resources
### What changes were proposed in this pull request? Documentation added for refresh resources command in spark-sql. ### Why are the changes needed? Previously, only refresh table command was documented. ### Does this PR introduce any user-facing change? Yes. Now users can access documentation for refresh resources command. ### How was this patch tested? Manually. Closes #27023 from iRakson/SPARK-30363. Authored-by: root1 <[email protected]> Signed-off-by: Sean Owen <[email protected]>
1 parent 319ccd5 commit ce7a49f

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

docs/_data/menu-sql.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@
172172
url: sql-ref-syntax-aux-cache-clear-cache.html
173173
- text: REFRESH TABLE
174174
url: sql-ref-syntax-aux-refresh-table.html
175+
- text: REFRESH
176+
url: sql-ref-syntax-aux-cache-refresh.md
175177
- text: Describe Commands
176178
url: sql-ref-syntax-aux-describe.html
177179
subitems:
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
layout: global
3+
title: REFRESH
4+
displayTitle: REFRESH
5+
license: |
6+
Licensed to the Apache Software Foundation (ASF) under one or more
7+
contributor license agreements. See the NOTICE file distributed with
8+
this work for additional information regarding copyright ownership.
9+
The ASF licenses this file to You under the Apache License, Version 2.0
10+
(the "License"); you may not use this file except in compliance with
11+
the License. You may obtain a copy of the License at
12+
13+
http://www.apache.org/licenses/LICENSE-2.0
14+
15+
Unless required by applicable law or agreed to in writing, software
16+
distributed under the License is distributed on an "AS IS" BASIS,
17+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
See the License for the specific language governing permissions and
19+
limitations under the License.
20+
---
21+
22+
### Description
23+
`REFRESH` is used to invalidate and refresh all the cached data (and the associated metadata) for
24+
all Datasets that contains the given data source path. Path matching is by prefix, i.e. "/" would
25+
invalidate everything that is cached.
26+
27+
### Syntax
28+
{% highlight sql %}
29+
REFRESH resource_path
30+
{% endhighlight %}
31+
32+
### Parameters
33+
<dl>
34+
<dt><code><em>resource_path</em></code></dt>
35+
<dd>The path of the resource that is to be refreshed.</dd>
36+
</dl>
37+
38+
### Examples
39+
{% highlight sql %}
40+
-- The Path is resolved using the datasource's File Index.
41+
42+
CREATE TABLE test(ID INT) using parquet;
43+
INSERT INTO test SELECT 1000;
44+
CACHE TABLE test;
45+
INSERT INTO test SELECT 100;
46+
REFRESH "hdfs://path/to/table";
47+
48+
{% endhighlight %}
49+
50+
### Related Statements
51+
- [CACHE TABLE](sql-ref-syntax-aux-cache-cache-table.html)
52+
- [CLEAR CACHE](sql-ref-syntax-aux-cache-clear-cache.html)
53+
- [UNCACHE TABLE](sql-ref-syntax-aux-cache-uncache-table.html)
54+
- [REFRESH TABLE](sql-ref-syntax-aux-refresh-table.html)

0 commit comments

Comments
 (0)