You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/11/10 07:10:16 UTC

[GitHub] [iceberg] Initial-neko opened a new issue #3521: In Flink, when we set the PK, the properties cannot be changed

Initial-neko opened a new issue #3521:
URL: https://github.com/apache/iceberg/issues/3521


   when a table has PK, alter table xxx set() will throw ***Altering schema is not supported yet*** Exception.
   but I only want to change the properties such as format-version or something else
   
   After tracking this comparison code, I found that the table with PK will always throw this Exception because a random name field is compared
   
   1.alterTable:CatalogTable table = toCatalogTable(icebergTable);
   2.TableSchema schema = FlinkSchemaUtil.toSchema(table.schema());
   3.builder.primaryKey(columns.toArray(new String[0]));
   4.primaryKey(UUID.randomUUID().toString(), columns);
   
   what? primary generate a random name ,I think it‘s a small bug in iceberg FlinkSQL alter 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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] Initial-neko edited a comment on issue #3521: In Flink, when we set the PK, the properties cannot be changed

Posted by GitBox <gi...@apache.org>.
Initial-neko edited a comment on issue #3521:
URL: https://github.com/apache/iceberg/issues/3521#issuecomment-966789613


   ```
   /**
      * skip the AbstractConstraint comparison
      * @param rawSchema
      * @param newSchema
      * @return
      */
     public boolean schemaCompare(TableSchema rawSchema, TableSchema newSchema){
       UniqueConstraint rawPK = rawSchema.getPrimaryKey().orElse(null);
       UniqueConstraint newPK = newSchema.getPrimaryKey().orElse(null);
       boolean exp = rawSchema.getTableColumns().equals(newSchema.getTableColumns()) &&
               rawSchema.getWatermarkSpecs().equals(newSchema.getWatermarkSpecs());
       boolean exp2 = rawPK != null && newPK != null ? rawPK.getColumns().equals(newPK.getColumns()) && rawPK.getType().equals(newPK.getType()) : true;
       return exp && exp2;
     }
   ```
   
   this new compare code can solve this problem. But I'm a new member of the community. Can anyone give me some suggestions,Thanks!


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] Initial-neko commented on issue #3521: In Flink, when we set the PK, the properties cannot be changed

Posted by GitBox <gi...@apache.org>.
Initial-neko commented on issue #3521:
URL: https://github.com/apache/iceberg/issues/3521#issuecomment-966789613


   
   
   /**
      * skip the AbstractConstraint comparison
      * @param rawSchema
      * @param newSchema
      * @return
      */
     public boolean schemaCompare(TableSchema rawSchema, TableSchema newSchema){
       UniqueConstraint rawPK = rawSchema.getPrimaryKey().get();
       UniqueConstraint newPK = newSchema.getPrimaryKey().get();
       return rawSchema.getTableColumns().equals(newSchema.getTableColumns()) &&
               rawSchema.getWatermarkSpecs().equals(newSchema.getWatermarkSpecs()) &&
               rawPK.getColumns().equals(newPK.getColumns()) && rawPK.getType().equals(newPK.getType());
     }
   
   this new compare code can solve this problem. But I'm a new member of the community. Can anyone give me some suggestions,Thanks!


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] Initial-neko edited a comment on issue #3521: In Flink, when we set the PK, the properties cannot be changed

Posted by GitBox <gi...@apache.org>.
Initial-neko edited a comment on issue #3521:
URL: https://github.com/apache/iceberg/issues/3521#issuecomment-966789613


   /**
      * skip the AbstractConstraint comparison
      * @param rawSchema
      * @param newSchema
      * @return
      */
     public boolean schemaCompare(TableSchema rawSchema, TableSchema newSchema){
       UniqueConstraint rawPK = rawSchema.getPrimaryKey().orElse(null);
       UniqueConstraint newPK = newSchema.getPrimaryKey().orElse(null);
       boolean exp = rawSchema.getTableColumns().equals(newSchema.getTableColumns()) &&
               rawSchema.getWatermarkSpecs().equals(newSchema.getWatermarkSpecs());
       boolean exp2 = rawPK != null && newPK != null ? rawPK.getColumns().equals(newPK.getColumns()) && rawPK.getType().equals(newPK.getType()) : true;
       return exp && exp2;
     }
   
   this new compare code can solve this problem. But I'm a new member of the community. Can anyone give me some suggestions,Thanks!


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] Initial-neko edited a comment on issue #3521: In Flink, when we set the PK, the properties cannot be changed

Posted by GitBox <gi...@apache.org>.
Initial-neko edited a comment on issue #3521:
URL: https://github.com/apache/iceberg/issues/3521#issuecomment-966789613


   
   /**
      * skip the AbstractConstraint comparison
      * @param rawSchema
      * @param newSchema
      * @return
      */
     public boolean schemaCompare(TableSchema rawSchema, TableSchema newSchema){
       UniqueConstraint rawPK = rawSchema.getPrimaryKey().orElse(null);
       UniqueConstraint newPK = newSchema.getPrimaryKey().orElse(null);
       boolean exp = rawSchema.getTableColumns().equals(newSchema.getTableColumns()) &&
               rawSchema.getWatermarkSpecs().equals(newSchema.getWatermarkSpecs());
       boolean exp2 = rawPK != null && newPK != null ? rawPK.getColumns().equals(newPK.getColumns()) && rawPK.getType().equals(newPK.getType()) : true;
       return exp && exp2;
     }
   
   this new compare code can solve this problem. But I'm a new member of the community. Can anyone give me some suggestions,Thanks!


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org