{"record":{"id":"ff7a6a69ead1c060","repo":"prestodb/presto","slug":"not-supported-ff7a6a","errorCode":"NOT_SUPPORTED","errorMessage":"Catalog \"%s\" cannot be used as a partitioning provider: %s","messagePattern":"Catalog \"(.+?)\" cannot be used as a partitioning provider: (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/AddExchanges.java","lineNumber":1754,"sourceCode":"        }\n\n        private Partitioning createPartitioning(Collection<VariableReferenceExpression> partitioningColumns)\n        {\n            // TODO: Use SystemTablesMetadata instead of introducing a special case\n            if (GlobalSystemConnector.NAME.equals(partitioningProviderCatalog)) {\n                return Partitioning.create(FIXED_HASH_DISTRIBUTION, ImmutableList.copyOf(partitioningColumns));\n            }\n\n            List<Type> partitioningTypes = partitioningColumns.stream()\n                    .map(VariableReferenceExpression::getType)\n                    .collect(toImmutableList());\n            try {\n                PartitioningHandle partitioningHandle = metadata.getPartitioningHandleForExchange(session, partitioningProviderCatalog, hashPartitionCount, partitioningTypes);\n                return Partitioning.create(partitioningHandle, partitioningColumns);\n            }\n            catch (PrestoException e) {\n                if (e.getErrorCode().equals(NOT_SUPPORTED.toErrorCode())) {\n                    throw new PrestoException(\n                            NOT_SUPPORTED,\n                            format(\n                                    \"Catalog \\\"%s\\\" cannot be used as a partitioning provider: %s\",\n                                    partitioningProviderCatalog,\n                                    e.getMessage()),\n                            e);\n                }\n                throw e;\n            }\n        }\n\n        // TODO: refactor this method into ExchangeNode#partitionedExchange once\n        //   materialized exchange is supported for all nodes.\n        private Scope selectExchangeScopeForPartitionedRemoteExchange(PlanNode exchangeSource, boolean nullsAndAnyReplicated)\n        {\n            if (nullsAndAnyReplicated || exchangeSource.getOutputVariables().isEmpty()) {\n                // materialized remote exchange is not supported when\n                //  * replicateNullsAndAny is needed","sourceCodeStart":1736,"sourceCodeEnd":1772,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/AddExchanges.java#L1736-L1772","documentation":"AddExchanges delegates hash partitioning to a catalog's partitioning provider via getPartitioningHandleForExchange. If the provider catalog throws NOT_SUPPORTED (it cannot supply that partitioning), AddExchanges wraps it in a clearer NOT_SUPPORTED error naming the catalog.","triggerScenarios":"A query's join/aggregation distribution requires a partitioning handle from a connector catalog that does not support the requested partitioning type or partition count.","commonSituations":"Querying tables across catalogs where one connector lacks partitioning support; partitioning_provider_catalog misconfigured; hash partition count unsupported by the connector.","solutions":["Remove or fix the 'partitioning_provider_catalog' session property / connector config to point at a catalog supporting the partitioning","Avoid cross-catalog joins that force partitioning through an unsupported connector, or co-locate data in one catalog","Check the wrapped cause (e.getMessage()) for the connector-specific limitation and adjust partition count or types"],"exampleFix":"// before\nSET SESSION partitioning_provider_catalog = 'iceberg'; -- unsupported partitioning\nSELECT ... JOIN ...;\n// after\nRESET SESSION partitioning_provider_catalog;\nSELECT ... JOIN ...;","handlingStrategy":"validation","validationCode":"// confirm connector supports exchange partitioning before cross-catalog joins\nSHOW SESSION LIKE 'partitioning_provider_catalog';","typeGuard":"null","tryCatchPattern":"try {\n    return query(sql);\n} catch (PrestoException e) {\n    if (e.getErrorCode() == NOT_SUPPORTED.toErrorCode() && e.getMessage().contains(\"partitioning provider\")) {\n        resetSessionProperty(\"partitioning_provider_catalog\");\n        return retryQuery(sql);\n    }\n    throw e;\n}","preventionTips":["Only set partitioning_provider_catalog to connectors that implement getPartitioningHandleForExchange","Avoid cross-catalog joins requiring hash distribution through an unsupported connector","Keep the wrapped cause message when triaging — it names the connector limitation"],"tags":["partitioning","connector","distribution"],"backgroundTag":"partitioning-provider-unsupported","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}