Fokko commented on issue #5591:
URL: https://github.com/apache/iceberg/issues/5591#issuecomment-1222001655

   I'm able to reproduce it and it looks like the data is rolebacked, but the 
schema isn't.
   
   ```sql
   %%sql
   
   CREATE TABLE test.test USING iceberg AS SELECT 1 c1;
   ```
   
       SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
       SLF4J: Defaulting to no-operation (NOP) logger implementation
       SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for 
further details.
                                                                                
     
   
   
   
   
   <table>
       <thead>
           <tr>
           </tr>
       </thead>
       <tbody>
       </tbody>
   </table>
   
   
   
   
   ```sql
   %%sql
   
   ALTER TABLE test.test ADD COLUMN c2 int;
   ```
   
   
   
   
   <table>
       <thead>
           <tr>
           </tr>
       </thead>
       <tbody>
       </tbody>
   </table>
   
   
   
   
   ```sql
   %%sql
   
   INSERT INTO test.test VALUES (1, 1);
   ```
   
   
   
   
   <table>
       <thead>
           <tr>
           </tr>
       </thead>
       <tbody>
       </tbody>
   </table>
   
   
   
   
   ```sql
   %%sql
   
   SELECT * FROM test.test;
   ```
   
                                                                                
       
   
   
   
   
   <table>
       <thead>
           <tr>
               <th>c1</th>
               <th>c2</th>
           </tr>
       </thead>
       <tbody>
           <tr>
               <td>1</td>
               <td>None</td>
           </tr>
           <tr>
               <td>1</td>
               <td>1</td>
           </tr>
       </tbody>
   </table>
   
   
   
   
   ```sql
   %%sql
   
   SELECT * FROM test.test.snapshots;
   ```
   
   
   
   
   <table>
       <thead>
           <tr>
               <th>committed_at</th>
               <th>snapshot_id</th>
               <th>parent_id</th>
               <th>operation</th>
               <th>manifest_list</th>
               <th>summary</th>
           </tr>
       </thead>
       <tbody>
           <tr>
               <td>2022-08-22 07:47:45.143000</td>
               <td>5161623784319151399</td>
               <td>None</td>
               <td>append</td>
               
<td>s3://tabular-wh-us-west-2-dev/8bcb0838-50fc-472d-9ddb-8feb89ef5f1e/03b32560-7561-4f96-992b-01ef730946f5/metadata/snap-5161623784319151399-1-cde4c05b-670c-47dd-8860-bcd6f07756f9.avro</td>
               <td>{&#x27;added-data-files&#x27;: &#x27;1&#x27;, 
&#x27;total-equality-deletes&#x27;: &#x27;0&#x27;, &#x27;added-records&#x27;: 
&#x27;1&#x27;, &#x27;partition-summaries-included&#x27;: &#x27;true&#x27;, 
&#x27;partitions.&#x27;: 
&#x27;added-data-files=1,added-records=1,added-files-size=389&#x27;, 
&#x27;total-records&#x27;: &#x27;1&#x27;, &#x27;spark.app.id&#x27;: 
&#x27;local-1661154453400&#x27;, &#x27;changed-partition-count&#x27;: 
&#x27;1&#x27;, &#x27;total-position-deletes&#x27;: &#x27;0&#x27;, 
&#x27;added-files-size&#x27;: &#x27;389&#x27;, &#x27;total-delete-files&#x27;: 
&#x27;0&#x27;, &#x27;total-files-size&#x27;: &#x27;389&#x27;, 
&#x27;total-data-files&#x27;: &#x27;1&#x27;}</td>
           </tr>
           <tr>
               <td>2022-08-22 07:47:52.492000</td>
               <td>2279922865032537001</td>
               <td>5161623784319151399</td>
               <td>append</td>
               
<td>s3://tabular-wh-us-west-2-dev/8bcb0838-50fc-472d-9ddb-8feb89ef5f1e/03b32560-7561-4f96-992b-01ef730946f5/metadata/snap-2279922865032537001-1-58b2d439-1420-49c2-bf06-228c77f1ebd0.avro</td>
               <td>{&#x27;added-data-files&#x27;: &#x27;1&#x27;, 
&#x27;total-equality-deletes&#x27;: &#x27;0&#x27;, &#x27;added-records&#x27;: 
&#x27;1&#x27;, &#x27;partition-summaries-included&#x27;: &#x27;true&#x27;, 
&#x27;partitions.&#x27;: 
&#x27;added-data-files=1,added-records=1,added-files-size=599&#x27;, 
&#x27;total-records&#x27;: &#x27;2&#x27;, &#x27;spark.app.id&#x27;: 
&#x27;local-1661154453400&#x27;, &#x27;changed-partition-count&#x27;: 
&#x27;1&#x27;, &#x27;total-position-deletes&#x27;: &#x27;0&#x27;, 
&#x27;added-files-size&#x27;: &#x27;599&#x27;, &#x27;total-delete-files&#x27;: 
&#x27;0&#x27;, &#x27;total-files-size&#x27;: &#x27;988&#x27;, 
&#x27;total-data-files&#x27;: &#x27;2&#x27;}</td>
           </tr>
       </tbody>
   </table>
   
   
   
   
   ```sql
   %%sql
   
   CALL system.rollback_to_snapshot('test.test', 5161623784319151399)
   ```
   
   
   
   
   <table>
       <thead>
           <tr>
               <th>previous_snapshot_id</th>
               <th>current_snapshot_id</th>
           </tr>
       </thead>
       <tbody>
           <tr>
               <td>2279922865032537001</td>
               <td>5161623784319151399</td>
           </tr>
       </tbody>
   </table>
   
   
   
   
   ```sql
   %%sql
   
   SELECT * FROM test.test;
   ```
   
                                                                                
       
   
   
   
   
   <table>
       <thead>
           <tr>
               <th>c1</th>
               <th>c2</th>
           </tr>
       </thead>
       <tbody>
           <tr>
               <td>1</td>
               <td>None</td>
           </tr>
       </tbody>
   </table>
   
   
   
   
   ```sql
   %%sql
   
   DESCRIBE TABLE test.test;
   ```
   
   
   
   
   <table>
       <thead>
           <tr>
               <th>col_name</th>
               <th>data_type</th>
               <th>comment</th>
           </tr>
       </thead>
       <tbody>
           <tr>
               <td>c1</td>
               <td>int</td>
               <td></td>
           </tr>
           <tr>
               <td>c2</td>
               <td>int</td>
               <td></td>
           </tr>
           <tr>
               <td></td>
               <td></td>
               <td></td>
           </tr>
           <tr>
               <td># Partitioning</td>
               <td></td>
               <td></td>
           </tr>
           <tr>
               <td>Not partitioned</td>
               <td></td>
               <td></td>
           </tr>
       </tbody>
   </table>
   
   
   
   
   ```sql
   %%sql
   
   SELECT * FROM test.test.snapshots;
   ```
   
   
   
   
   <table>
       <thead>
           <tr>
               <th>committed_at</th>
               <th>snapshot_id</th>
               <th>parent_id</th>
               <th>operation</th>
               <th>manifest_list</th>
               <th>summary</th>
           </tr>
       </thead>
       <tbody>
           <tr>
               <td>2022-08-22 07:47:45.143000</td>
               <td>5161623784319151399</td>
               <td>None</td>
               <td>append</td>
               
<td>s3://tabular-wh-us-west-2-dev/8bcb0838-50fc-472d-9ddb-8feb89ef5f1e/03b32560-7561-4f96-992b-01ef730946f5/metadata/snap-5161623784319151399-1-cde4c05b-670c-47dd-8860-bcd6f07756f9.avro</td>
               <td>{&#x27;added-data-files&#x27;: &#x27;1&#x27;, 
&#x27;total-equality-deletes&#x27;: &#x27;0&#x27;, &#x27;added-records&#x27;: 
&#x27;1&#x27;, &#x27;partition-summaries-included&#x27;: &#x27;true&#x27;, 
&#x27;partitions.&#x27;: 
&#x27;added-data-files=1,added-records=1,added-files-size=389&#x27;, 
&#x27;total-records&#x27;: &#x27;1&#x27;, &#x27;spark.app.id&#x27;: 
&#x27;local-1661154453400&#x27;, &#x27;changed-partition-count&#x27;: 
&#x27;1&#x27;, &#x27;total-position-deletes&#x27;: &#x27;0&#x27;, 
&#x27;added-files-size&#x27;: &#x27;389&#x27;, &#x27;total-delete-files&#x27;: 
&#x27;0&#x27;, &#x27;total-files-size&#x27;: &#x27;389&#x27;, 
&#x27;total-data-files&#x27;: &#x27;1&#x27;}</td>
           </tr>
           <tr>
               <td>2022-08-22 07:47:52.492000</td>
               <td>2279922865032537001</td>
               <td>5161623784319151399</td>
               <td>append</td>
               
<td>s3://tabular-wh-us-west-2-dev/8bcb0838-50fc-472d-9ddb-8feb89ef5f1e/03b32560-7561-4f96-992b-01ef730946f5/metadata/snap-2279922865032537001-1-58b2d439-1420-49c2-bf06-228c77f1ebd0.avro</td>
               <td>{&#x27;added-data-files&#x27;: &#x27;1&#x27;, 
&#x27;total-equality-deletes&#x27;: &#x27;0&#x27;, &#x27;added-records&#x27;: 
&#x27;1&#x27;, &#x27;partition-summaries-included&#x27;: &#x27;true&#x27;, 
&#x27;partitions.&#x27;: 
&#x27;added-data-files=1,added-records=1,added-files-size=599&#x27;, 
&#x27;total-records&#x27;: &#x27;2&#x27;, &#x27;spark.app.id&#x27;: 
&#x27;local-1661154453400&#x27;, &#x27;changed-partition-count&#x27;: 
&#x27;1&#x27;, &#x27;total-position-deletes&#x27;: &#x27;0&#x27;, 
&#x27;added-files-size&#x27;: &#x27;599&#x27;, &#x27;total-delete-files&#x27;: 
&#x27;0&#x27;, &#x27;total-files-size&#x27;: &#x27;988&#x27;, 
&#x27;total-data-files&#x27;: &#x27;2&#x27;}</td>
           </tr>
       </tbody>
   </table>
   
   
   
   
   ```sql
   %%sql
   
   REFRESH TABLE test.test
   ```
   
   
   
   
   <table>
       <thead>
           <tr>
           </tr>
       </thead>
       <tbody>
       </tbody>
   </table>
   
   
   
   
   ```sql
   %%sql
   
   SELECT * FROM test.test;
   ```
   
                                                                                
       
   
   
   
   
   <table>
       <thead>
           <tr>
               <th>c1</th>
               <th>c2</th>
           </tr>
       </thead>
       <tbody>
           <tr>
               <td>1</td>
               <td>None</td>
           </tr>
       </tbody>
   </table>
   
   
   
   # Waiting one minute
   
   
   ```sql
   %%sql
   
   SELECT * FROM test.test;
   ```
   
                                                                                
       
   
   
   
   
   <table>
       <thead>
           <tr>
               <th>c1</th>
               <th>c2</th>
           </tr>
       </thead>
       <tbody>
           <tr>
               <td>1</td>
               <td>None</td>
           </tr>
       </tbody>
   </table>
   


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to