|
| 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