Skip to content

Potential panic due to unchecked downcast in ListingTableFactory::create #20113

@vkverma9534

Description

@vkverma9534

Describe the bug

location : listing_table_factory.rs, inside ListingTableFactory::create

I might be mistaken, but I noticed that state is downcast to SessionState using downcast_ref::().unwrap(). Since create accepts a &dyn Session, this seems to assume that the concrete type is always SessionState.

If that assumption doesn’t hold (for example with alternative or wrapped Session implementations), this would cause a panic rather than returning an error. I’m not sure if this is an intentional invariant or just a temporary implementation detail (there’s a TODO nearby that suggests it may not be final).

If this is not intentional, I’m happy to open a PR to handle this more defensively and return a proper error instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions