Skip to content

Commit de4a8a1

Browse files
rustyconoverclaude
andcommitted
Change projection_pushdown default to False
Functions must now explicitly opt-in to projection pushdown support by setting `projection_pushdown = True` in their Meta class. This is safer as a function incorrectly claiming projection support could lead to incorrect results. - Changed default from True to False in ResolvedMetadata - Added projection_pushdown = True to ProjectedDataFunction (the only example function that actually implements projection optimization) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 0bf69e1 commit de4a8a1

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

vgi/examples/table.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ class Meta:
464464
description = "Generates data with 4 columns, supporting projection pushdown"
465465
categories = ["generator", "utility"]
466466
max_workers = 1
467+
projection_pushdown = True
467468
examples = [
468469
FunctionExample(
469470
sql="SELECT * FROM projected_data(10)",

vgi/metadata.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ class ResolvedMetadata:
322322
required_settings: list[str] = field(default_factory=list)
323323

324324
# Table function specific
325-
projection_pushdown: bool = True
325+
projection_pushdown: bool = False
326326
filter_pushdown: bool = False
327327
preserves_order: OrderPreservation = OrderPreservation.PRESERVES_ORDER
328328
max_workers: int | None = None
@@ -368,7 +368,7 @@ def from_dict(d: dict[str, Any]) -> ResolvedMetadata:
368368
stability=FunctionStability[d.get("stability", "CONSISTENT")],
369369
null_handling=NullHandling[d.get("null_handling", "DEFAULT")],
370370
required_settings=d.get("required_settings", []),
371-
projection_pushdown=d.get("projection_pushdown", True),
371+
projection_pushdown=d.get("projection_pushdown", False),
372372
filter_pushdown=d.get("filter_pushdown", False),
373373
preserves_order=OrderPreservation[
374374
d.get("preserves_order", "PRESERVES_ORDER")
@@ -790,7 +790,7 @@ class Meta:
790790
stability=attrs.get("stability", FunctionStability.CONSISTENT),
791791
null_handling=attrs.get("null_handling", NullHandling.DEFAULT),
792792
required_settings=attrs.get("required_settings", []),
793-
projection_pushdown=attrs.get("projection_pushdown", True),
793+
projection_pushdown=attrs.get("projection_pushdown", False),
794794
filter_pushdown=attrs.get("filter_pushdown", False),
795795
preserves_order=attrs.get("preserves_order", OrderPreservation.PRESERVES_ORDER),
796796
max_workers=attrs.get("max_workers"),

0 commit comments

Comments
 (0)