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


   hi @cccs-br 
   Very sorry for delay!
   Got sidelined with other stuff.
   
   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: [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