Skip to content

Comet query with range frame will fail #720

@viirya

Description

@viirya

Describe the bug

I found this issue while fixing CI failures in #651.

The following errors happens many times:

[info]   java.lang.ClassCastException: class java.lang.Long cannot be cast to class java.lang.Integer (java.lang.Long and java.lang.Integer are in module java.base of loader 'bootstrap')
[info]   at scala.runtime.BoxesRunTime.unboxToInt(BoxesRunTime.java:103)
[info]   at org.apache.comet.serde.QueryPlanSerde$.windowExprToProto(QueryPlanSerde.scala:281)

It is because we don't separate RangeFrame and RowFrame for window expression support. Looks like we only support RowFrame which can take integers as upper and lower bounds. So the current code just tries to cast upper and lower bound expression values into Int.

For RangeFrame, it can accept more data types. Once we do the casting there, it causes the errors.

Steps to reproduce

No response

Expected behavior

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions