cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Refreshing DELTA external table

turtleXturtle
New Contributor II

I'm having trouble with the REFRESH TABLE command - does it work with DELTA external tables?  I'm doing the following steps:

  1. Create table: CREATE TABLE IF NOT EXISTS `catalog`.`default`.`table_name` (
    KEY DOUBLE
    , CUSTKEY DOUBLE
    , STATUS STRING
    , PRICE DOUBLE
    , DATE TIMESTAMP
    , PRIORITY STRING
    )
    USING PARQUET LOCATION 's3://bucket-name/folder-name/';
  2.  Convert to Delta: convert to delta `catalog`.`default`.`table_name`;
  3. Add new parquet file to s3 folder
  4. I tried REFRESH TABLE, then CONVERT TO DELTA again, which didn't work.  I also tried converting to delta first and then REFRESH TABLE, and I can't get the new file recognized.
 
I can't get the new file to show up in the created delta table without dropping and recreating the external table - is REFRESH TABLE supposed to work for DELTA external tables? Is there another order of operations I need to do to get the new file to be recognized in the existing delta external table?
1 REPLY 1

gchandra
Databricks Employee
Databricks Employee

Step 3: Insert the Data; don't add it directly to the S3 folder.

Once it's converted to Delta, it maintains the transaction log. Inserting a Parquet file (followed by another convert /refresh) won't work, as the rest of the dataset is already Delta. 

 



~

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group