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 2022/07/11 19:56:41 UTC

[GitHub] [iceberg] malvarezrohena opened a new pull request, #5250: 0.13.x Discrepancy between partition truncation transform in spec vs code (org.apache.iceberg.transforms.Transform)

malvarezrohena opened a new pull request, #5250:
URL: https://github.com/apache/iceberg/pull/5250

   I would like some clarification on wether or not Iceberg officially supports partition truncation transform for Fixed or Binary data types.  
   
   The [specification](https://iceberg.apache.org/spec/#partition-transforms) denotes that the only data types supported for truncate transform are: String, Int, Long, and Decimal.  Yet the following [code](https://github.com/apache/iceberg/blob/5009949ba4377ac5a8572ff7ae70e886c9e33bec/api/src/main/java/org/apache/iceberg/transforms/Truncate.java#L37) seems to suggest that fixed/binary data types might be supported as well:
   
   ```
    static <T> Truncate<T> get(Type type, int width) {
       Preconditions.checkArgument(width > 0,
           "Invalid truncate width: %s (must be > 0)", width);
   
       switch (type.typeId()) {
         case INTEGER:
           return (Truncate<T>) new TruncateInteger(width);
         case LONG:
           return (Truncate<T>) new TruncateLong(width);
         case DECIMAL:
           return (Truncate<T>) new TruncateDecimal(width);
         case STRING:
           return (Truncate<T>) new TruncateString(width);
         case BINARY:
           return (Truncate<T>) new TruncateByteBuffer(width);
         default:
           throw new UnsupportedOperationException(
               "Cannot truncate type: " + type);
       }
     }
   ```
   
   Should this type be included in the specification as a valid on for the truncation transform or is the BINARY case aboved used for something else.


-- 
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] malvarezrohena closed pull request #5250: 0.13.x Discrepancy between partition truncation transform in spec vs code (org.apache.iceberg.transforms.Transform)

Posted by GitBox <gi...@apache.org>.
malvarezrohena closed pull request #5250: 0.13.x Discrepancy between partition truncation transform in spec vs code (org.apache.iceberg.transforms.Transform)
URL: https://github.com/apache/iceberg/pull/5250


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