lirui-apache opened a new issue, #13869:
URL: https://github.com/apache/iceberg/issues/13869

   ### Query engine
   
   Spark
   
   ### Question
   
   Migrating a bucketed table to iceberg will cause error:
   ```shell
   Cannot find a partition spec in Iceberg table ... that matches the partition 
columns (...) in input table
   ```
   This is because Spark adds bucket columns as partition transforms in 
`V1Table::partitioning`.
   I wonder whether this use case does not work by design, or is yet to be 
supported (by ignoring buckets for example)?
   
   Test case to reproduce:
   ```java
   @TestTemplate
     public void test() throws Exception {
       assumeTrue(catalogName.equals("spark_catalog"));
       String location = Files.createTempDirectory(temp, 
null).toFile().toString();
       sql("create table %s (id bigint) partitioned by (dt string) stored as 
parquet clustered by (id) into 4 buckets location '%s'", tableName, location);
       scalarSql("CALL %s.system.migrate('%s')", catalogName, tableName);
     }
   ```


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