Skip to content

feat: add ValuesSource data source#24

Open
LLDay wants to merge 1 commit intodsemenov/resolve-placeholdersfrom
dsemenov/volumes-source
Open

feat: add ValuesSource data source#24
LLDay wants to merge 1 commit intodsemenov/resolve-placeholdersfrom
dsemenov/volumes-source

Conversation

@LLDay
Copy link

@LLDay LLDay commented Feb 6, 2026

Rationale for this change

The previous implementation of VALUES list in DataFusion (via MemorySourceConfig::try_new_as_values) required all expressions to be evaluated to constant scalars at plan time. This approach was incompatible with physical placeholders, which cannot be evaluated until execution time when parameter values are provided.

By introducing ValuesSource, we can now represent VALUES lists that contain placeholders.

What changes are included in this PR?

  • New ValuesSource: A physical data source that can hold both constant values and placeholders.
  • Refactoring: Removed MemorySourceConfig::try_new_as_values method.

Are these changes tested?

Yes, this PR includes:

  • Unit tests and SLTs covering placeholder resolution.
  • Roundtrip tests ensuring ValuesSource can be serialized and deserialized via protobuf.

Are there any user-facing changes?

Users can now use placeholders in VALUES lists (e.g., in INSERT statements or standalone VALUES queries), which previously might have failed during physical planning.

This commit introduces `ValuesSource`, a new data source specifically
designed to handle constant values that may contain placeholders. It
replaces the previous `MemorySourceConfig::try_new_as_values`
implementation, providing the necessary infrastructure to resolve
physical placeholders during execution while maintaining performance for
constant-only data by falling back to the standard memory source.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant