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/10/09 02:24:44 UTC

[GitHub] [iceberg] manishmalhotrawork commented on issue #2934: IllegarlArgumentException when filtering on BinaryType column.

manishmalhotrawork commented on issue #2934:
URL: https://github.com/apache/iceberg/issues/2934#issuecomment-939207737


   hi @cccs-br 
   Very sorry for delay!
   I was thinking to take this up, also spend some time initially, and reach to a place where found that:
   
   looks like `org.apache.iceberg.expressions.Literals.from` is the place where `byte[]` or `ByteBuffer` converted to the corresponding literals
   
   ```
   static <T> Literal<T> from(T value) {
       Preconditions.checkNotNull(value, "Cannot create expression literal from null");
       Preconditions.checkArgument(!NaNUtil.isNaN(value), "Cannot create expression literal from NaN");
   
       if (value instanceof Boolean) {
         return (Literal<T>) new Literals.BooleanLiteral((Boolean) value);
       } else if (value instanceof Integer) {
         return (Literal<T>) new Literals.IntegerLiteral((Integer) value);
       } else if (value instanceof Long) {
         return (Literal<T>) new Literals.LongLiteral((Long) value);
       } else if (value instanceof Float) {
         return (Literal<T>) new Literals.FloatLiteral((Float) value);
       } else if (value instanceof Double) {
         return (Literal<T>) new Literals.DoubleLiteral((Double) value);
       } else if (value instanceof CharSequence) {
         return (Literal<T>) new Literals.StringLiteral((CharSequence) value);
       } else if (value instanceof UUID) {
         return (Literal<T>) new Literals.UUIDLiteral((UUID) value);
       } else if (value instanceof byte[]) {
         return (Literal<T>) new Literals.FixedLiteral(ByteBuffer.wrap((byte[]) value));
       } else if (value instanceof ByteBuffer) {
         return (Literal<T>) new Literals.BinaryLiteral((ByteBuffer) value);
       } else if (value instanceof BigDecimal) {
         return (Literal<T>) new Literals.DecimalLiteral((BigDecimal) value);
       }
   
   ```
   
   Also discussed with @RussellSpitzer and next step was to check the query plan in spark sql case. That can give more insight as how it's being handled in case of spark sql.
   
   thanks @RussellSpitzer for the help!
   
   
   


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