debajyoti-truefoundry opened a new issue, #16550:
URL: https://github.com/apache/datafusion/issues/16550

   ### Describe the bug
   
   
https://github.com/delta-io/delta-rs/blob/2cc8081caf89ec4aa162d8c9a903d3b9890fcac9/crates/core/src/delta_datafusion/mod.rs#L679
   
https://github.com/apache/datafusion/blob/20a723b7b6d91da57fe6abea8ecac08ea5267a89/datafusion/datasource/src/file_scan_config.rs#L1527
   
https://github.com/apache/datafusion/blob/20a723b7b6d91da57fe6abea8ecac08ea5267a89/datafusion/common/src/scalar/mod.rs#L2108
   
   
   So if I have a query like,
   ```sql
   SELECT 
     "SpanId" as spanId,
     "TraceId" as traceId,
     -- TracingProjectId is a partition column
     FIRST_VALUE("TracingProjectId") as tracingProjectId
     FROM tbl 
     WHERE "TfyTenantId" = 'truefoundry' 
     AND "TraceId" = 'fb09d0c9b49136bb161464b3e32c5083'
     AND "ParentSpanId" = '662b7388122dfb79'
     AND ("MlRepoId", "TracingProjectId") IN ((1089, 
'222fde49-1f7a-4752-8ec1-06bcdbf570c5'), (1234, 
'2a68e4f6-eda0-4b50-aeb1-aee55a8c52df'))
     AND "Timestamp" >= to_timestamp('2025-04-15 07:30:00')
     GROUP BY "TraceId", "SpanId"
     LIMIT 10
     OFFSET 0
   ```
   
   I get,
   ```
   Internal error: Can not create index of type UInt16 from value 65536.
   This was likely caused by a bug in DataFusion's code and we would welcome 
that you file an bug report in our issue tracker
   ```
   
   If I change `FIRST_VALUE("TracingProjectId") as tracingProjectId` to 
`FIRST_VALUE(CAST("TracingProjectId" AS VARCHAR)) as tracingProjectId`, it 
works.
   
   
   
   ### To Reproduce
   
   _No response_
   
   ### Expected behavior
   
   _No response_
   
   ### Additional context
   
   _No response_


-- 
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: github-unsubscr...@datafusion.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to