@@ -225,6 +225,11 @@ class IdentifierKind(Enum):
225225 VIEW = "view"
226226
227227
228+ class ScanPlanningMode (Enum ):
229+ CLIENT = "client"
230+ SERVER = "server"
231+
232+
228233ACCESS_DELEGATION_DEFAULT = "vended-credentials"
229234AUTHORIZATION_HEADER = "Authorization"
230235BEARER_PREFIX = "Bearer"
@@ -255,8 +260,8 @@ class IdentifierKind(Enum):
255260SNAPSHOT_LOADING_MODE = "snapshot-loading-mode"
256261AUTH = "auth"
257262CUSTOM = "custom"
258- REST_SCAN_PLANNING_ENABLED = "rest- scan-planning-enabled "
259- REST_SCAN_PLANNING_ENABLED_DEFAULT = False
263+ SCAN_PLANNING_MODE = "scan-planning-mode "
264+ SCAN_PLANNING_MODE_DEFAULT = ScanPlanningMode . CLIENT . value
260265# for backwards compatibility with older REST servers where it can be assumed that a particular
261266# server supports view endpoints but doesn't send the "endpoints" field in the ConfigResponse
262267VIEW_ENDPOINTS_SUPPORTED = "view-endpoints-supported"
@@ -480,9 +485,8 @@ def _load_file_io(self, properties: Properties = EMPTY_DICT, location: str | Non
480485 @override
481486 def supports_server_side_planning (self ) -> bool :
482487 """Check if the catalog supports server-side scan planning."""
483- return Capability .V1_SUBMIT_TABLE_SCAN_PLAN in self ._supported_endpoints and property_as_bool (
484- self .properties , REST_SCAN_PLANNING_ENABLED , REST_SCAN_PLANNING_ENABLED_DEFAULT
485- )
488+ scan_planning_mode = ScanPlanningMode (self .properties .get (SCAN_PLANNING_MODE , SCAN_PLANNING_MODE_DEFAULT ))
489+ return Capability .V1_SUBMIT_TABLE_SCAN_PLAN in self ._supported_endpoints and scan_planning_mode == ScanPlanningMode .SERVER
486490
487491 @retry (** _RETRY_ARGS )
488492 def _plan_table_scan (self , identifier : str | Identifier , request : PlanTableScanRequest ) -> PlanningResponse :
0 commit comments