{"record":{"id":"e558e6fb86f16315","repo":"prestodb/presto","slug":"node-selection-not-supported","errorCode":"NODE_SELECTION_NOT_SUPPORTED","errorMessage":"Unsupported node selection strategy %s","messagePattern":"Unsupported node selection strategy (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-hive/src/main/java/com/facebook/presto/hive/HiveNodePartitioningProvider.java","lineNumber":81,"sourceCode":"            default:\n                throw new IllegalArgumentException(\"Unsupported bucket function type \" + bucketFunctionType);\n        }\n    }\n\n    @Override\n    public ConnectorBucketNodeMap getBucketNodeMap(ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorPartitioningHandle partitioningHandle, List<Node> sortedNodes)\n    {\n        HivePartitioningHandle handle = (HivePartitioningHandle) partitioningHandle;\n        NodeSelectionStrategy nodeSelectionStrategy = getNodeSelectionStrategy(session);\n        int bucketCount = handle.getBucketCount();\n        switch (nodeSelectionStrategy) {\n            case HARD_AFFINITY:\n            case SOFT_AFFINITY:\n                return createBucketNodeMap(Stream.generate(() -> sortedNodes).flatMap(List::stream).limit(bucketCount).collect(toImmutableList()), nodeSelectionStrategy);\n            case NO_PREFERENCE:\n                return createBucketNodeMap(bucketCount);\n            default:\n                throw new PrestoException(NODE_SELECTION_NOT_SUPPORTED, format(\"Unsupported node selection strategy %s\", nodeSelectionStrategy));\n        }\n    }\n\n    @Override\n    public ToIntFunction<ConnectorSplit> getSplitBucketFunction(\n            ConnectorTransactionHandle transactionHandle,\n            ConnectorSession session,\n            ConnectorPartitioningHandle partitioningHandle)\n    {\n        return value -> ((HiveSplit) value).getReadBucketNumber()\n                .orElseThrow(() -> new IllegalArgumentException(\"Bucket number not set in split\"));\n    }\n\n    @Override\n    public int getBucketCount(ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorPartitioningHandle partitioningHandle)\n    {\n        HivePartitioningHandle handle = (HivePartitioningHandle) partitioningHandle;\n        return handle.getBucketCount();","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive/src/main/java/com/facebook/presto/hive/HiveNodePartitioningProvider.java#L63-L99","documentation":"getBucketNodeMap builds a ConnectorBucketNodeMap using the session's node selection strategy. Only HARD_AFFINITY, SOFT_AFFINITY, and NO_PREFERENCE are supported; any other strategy throws PrestoException NODE_SELECTION_NOT_SUPPORTED.","triggerScenarios":"Query planning for bucketed execution when nodeSelectionStrategy holds an unrecognized value — e.g. a strategy configured in the connector/catalog properties or set by a scheduler extension that this hive plugin version doesn't implement.","commonSituations":"Setting an unsupported node-selection strategy in catalog config; planner extension supplying a strategy not implemented by the Hive connector; version skew where a newer strategy name is used against an older plugin.","solutions":["Change the node selection strategy configuration to HARD_AFFINITY, SOFT_AFFINITY, or NO_PREFERENCE.","Check catalog configuration files (hive.properties) for typos in strategy-related properties.","If a custom scheduler sets the strategy, update it to emit a supported value or upgrade the hive connector to one supporting it."],"exampleFix":"// before (hive.properties)\nhive.node-selection-strategy=DISK_AWARE\n// after\nhive.node-selection-strategy=SOFT_AFFINITY","handlingStrategy":"validation","validationCode":"Set<String> supported = Set.of(\"HARD_AFFINITY\", \"SOFT_AFFINITY\", \"NO_PREFERENCE\");\nif (!supported.contains(strategyName.toUpperCase())) {\n    throw new IllegalStateException(\"Unsupported node selection strategy: \" + strategyName);\n}","typeGuard":"boolean isSupportedNodeSelectionStrategy(Object s) { return s == NodeSelectionStrategy.HARD_AFFINITY || s == NodeSelectionStrategy.SOFT_AFFINITY || s == NodeSelectionStrategy.NO_PREFERENCE; }","tryCatchPattern":"try { planBucketedQuery(...); } catch (PrestoException e) { if (e.getErrorCode().getCode() == StandardErrorCode.NODE_SELECTION_NOT_SUPPORTED.getCode()) { /* fix strategy config and re-run */ } else throw e; }","preventionTips":["Only configure HARD_AFFINITY, SOFT_AFFINITY, or NO_PREFERENCE in catalog properties.","Lint hive.properties against the connector version's supported values.","Upgrade the connector before adopting new strategy names from newer releases."],"tags":["hive","bucketing","node-selection","configuration"],"backgroundTag":"unsupported-config-value","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}