{"record":{"id":"5f9416a191bb14b2","repo":"dotnet/machinelearning","slug":"joinalgorithm","errorCode":null,"errorMessage":"joinAlgorithm","messagePattern":"joinAlgorithm","errorType":"exception","errorClass":"System.NotImplementedException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.Data.Analysis/DataFrame.Join.cs","lineNumber":402,"sourceCode":"                var intersection = Merge(retainedDataFrame, supplementaryDataFrame, retainedJoinColumns, supplementaryJoinColumns, out retainedRowIndices, out supplementaryRowIndices, calculateIntersection: true);\n\n                // Step 2\n                // Do RIGHT JOIN to retain all data from supplementary DataFrame too (take into account data intersection from the first step to avoid duplicates)\n                for (long i = 0; i < supplementaryDataFrame.Columns.RowCount; i++)\n                {\n                    var columns = supplementaryJoinColumns.Select(name => supplementaryDataFrame.Columns[name]).ToArray();\n                    if (!IsAnyNullValueInColumns(columns, i))\n                    {\n                        if (!intersection.Contains(i))\n                        {\n                            retainedRowIndices.Append(null);\n                            supplementaryRowIndices.Append(i);\n                        }\n                    }\n                }\n            }\n            else\n                throw new NotImplementedException(nameof(joinAlgorithm));\n\n            DataFrame ret = new DataFrame();\n\n            PrimitiveDataFrameColumn<long> mapIndicesLeft = isLeftDataFrameRetained ? retainedRowIndices : supplementaryRowIndices;\n            PrimitiveDataFrameColumn<long> mapIndicesRight = isLeftDataFrameRetained ? supplementaryRowIndices : retainedRowIndices;\n\n            // Insert columns from left dataframe (this)\n            for (int i = 0; i < this.Columns.Count; i++)\n            {\n                ret.Columns.Insert(i, this.Columns[i].Clone(mapIndicesLeft));\n            }\n\n            // Insert columns from right dataframe (other)\n            for (int i = 0; i < other.Columns.Count; i++)\n            {\n                DataFrameColumn column = other.Columns[i].Clone(mapIndicesRight);\n\n                SetSuffixForDuplicatedColumnNames(ret, column, leftSuffix, rightSuffix);","sourceCodeStart":384,"sourceCodeEnd":420,"githubUrl":"https://github.com/dotnet/machinelearning/blob/7b76e69cf964daeca3f1377af6bc5543284d56c6/src/Microsoft.Data.Analysis/DataFrame.Join.cs#L384-L420","documentation":"Merge ends its if/else chain with `throw new NotImplementedException(nameof(joinAlgorithm))`, so any JoinAlgorithm value that is not one of the implemented algorithms (Left/Right/Outer handled above) reaches this line. The message is just the parameter name 'joinAlgorithm'. It means the join algorithm you passed is not supported by this version.","triggerScenarios":"Calling df.Merge(other, leftCols, rightCols, joinAlgorithm: someJoinAlgorithm) where someJoinAlgorithm is not among the implemented enum members in the installed Microsoft.Data.Analysis version — typically a newer enum value, an invalid cast, or an out-of-range enum value like (JoinAlgorithm)99.","commonSituations":"Targeting a newer .NET/ML.NET API surface than the runtime package provides; copying sample code that uses an algorithm added in a later release; casting an int or another enum into JoinAlgorithm.","solutions":["Use only JoinAlgorithm.Left, JoinAlgorithm.Right, or JoinAlgorithm.Outer as supported by your package version.","Check the installed Microsoft.Data.Analysis version and upgrade if you need the newer algorithm.","Validate the enum value before calling: Enum.IsDefined(typeof(JoinAlgorithm), joinAlgorithm).","Implement the missing join manually (e.g. via row filtering) if the version cannot be upgraded."],"exampleFix":"// before\nvar merged = left.Merge(right, lc, rc, joinAlgorithm: JoinAlgorithm.FullOuter);\n// after\nif (!Enum.IsDefined(typeof(JoinAlgorithm), joinAlgorithm))\n    throw new ArgumentException($\"Unsupported join algorithm: {joinAlgorithm}\");\nvar merged = left.Merge(right, lc, rc, joinAlgorithm: JoinAlgorithm.Outer);","handlingStrategy":"type-guard","validationCode":"if (!Enum.IsDefined(typeof(JoinAlgorithm), joinAlgorithm))\n    throw new ArgumentException($\"Join algorithm {joinAlgorithm} not supported by this package version\");","typeGuard":"bool IsSupportedJoin(JoinAlgorithm a) => a is JoinAlgorithm.Left or JoinAlgorithm.Right or JoinAlgorithm.Outer;","tryCatchPattern":"try { merged = left.Merge(right, lc, rc, joinAlgorithm: alg); }\ncatch (NotImplementedException) { merged = manualJoin(left, right, lc, rc); }","preventionTips":["Pin and document the Microsoft.Data.Analysis version your join code targets","Only reference enum members that exist in your referenced package version","Never cast raw ints to JoinAlgorithm without Enum.IsDefined"],"tags":["not-implemented","enum","join","version-mismatch"],"backgroundTag":"unsupported-enum-value","analyzedSha":"7b76e69cf964daeca3f1377af6bc5543284d56c6","analyzedAt":"2026-09-11T12:35:38.930Z","contentChangedAt":"2026-09-11T12:35:38.930Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}