Skip to content

FnOverload.getInstance() design limitation  #1814

@XuechunHHH

Description

@XuechunHHH

Description

The current implementation of FnOverloadImpl.getInstance(PType[] args) in FnOverload.java ignores the provided argument types and always returns the same function instance. This is a design limitation of the current architecture and not a simple bug.

Current Behavior

@Nullable
@Override
public Fn getInstance(PType[] args) {
    return instance; // Always returns the same instance, ignoring args
}

The FnOverload.Builder creates a single Fn instance with fixed parameter types, and FnOverloadImpl stores this single instance. The getInstance() method cannot validate argument types because it only has one pre-built instance for specific types and changing this behavior would break existing code that relies on the current implementation.

  • Function overload resolution must be handled at a higher level (catalog/registry)
  • The method signature suggests type validation but doesn't perform it

Additional Context

  • PartiQL version: v1.2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions