0001 ---
0002 layout: global
0003 title: REFRESH
0004 displayTitle: REFRESH
0005 license: |
0006 Licensed to the Apache Software Foundation (ASF) under one or more
0007 contributor license agreements. See the NOTICE file distributed with
0008 this work for additional information regarding copyright ownership.
0009 The ASF licenses this file to You under the Apache License, Version 2.0
0010 (the "License"); you may not use this file except in compliance with
0011 the License. You may obtain a copy of the License at
0012
0013 http://www.apache.org/licenses/LICENSE-2.0
0014
0015 Unless required by applicable law or agreed to in writing, software
0016 distributed under the License is distributed on an "AS IS" BASIS,
0017 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0018 See the License for the specific language governing permissions and
0019 limitations under the License.
0020 ---
0021
0022 ### Description
0023
0024 `REFRESH` is used to invalidate and refresh all the cached data (and the associated metadata) for
0025 all Datasets that contains the given data source path. Path matching is by prefix, i.e. "/" would
0026 invalidate everything that is cached.
0027
0028 ### Syntax
0029
0030 ```sql
0031 REFRESH resource_path
0032 ```
0033
0034 ### Parameters
0035
0036 * **resource_path**
0037
0038 The path of the resource that is to be refreshed.
0039
0040 ### Examples
0041
0042 ```sql
0043 -- The Path is resolved using the datasource's File Index.
0044 CREATE TABLE test(ID INT) using parquet;
0045 INSERT INTO test SELECT 1000;
0046 CACHE TABLE test;
0047 INSERT INTO test SELECT 100;
0048 REFRESH "hdfs://path/to/table";
0049 ```
0050
0051 ### Related Statements
0052
0053 * [CACHE TABLE](sql-ref-syntax-aux-cache-cache-table.html)
0054 * [CLEAR CACHE](sql-ref-syntax-aux-cache-clear-cache.html)
0055 * [UNCACHE TABLE](sql-ref-syntax-aux-cache-uncache-table.html)
0056 * [REFRESH TABLE](sql-ref-syntax-aux-refresh-table.html)