{"record":{"id":"8694da9cb8cd61cc","repo":"dotnet/machinelearning","slug":"null-8694da","errorCode":null,"errorMessage":"null","messagePattern":"null","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.Data.Analysis/DataFrameColumns/ArrowStringDataFrameColumn.cs","lineNumber":366,"sourceCode":"\n        /// <inheritdoc/>\n        protected internal override Apache.Arrow.Array ToArrowArray(long startIndex, int numberOfRows)\n        {\n            if (numberOfRows == 0)\n                return new StringArray(numberOfRows, ArrowBuffer.Empty, ArrowBuffer.Empty, ArrowBuffer.Empty);\n            int offsetsBufferIndex = GetBufferIndexContainingRowIndex(startIndex, out int indexInBuffer);\n            if (numberOfRows != 0 && numberOfRows > _offsetsBuffers[offsetsBufferIndex].Length - 1 - indexInBuffer)\n            {\n                throw new ArgumentException(Strings.SpansMultipleBuffers, nameof(numberOfRows));\n            }\n            ArrowBuffer dataBuffer = new ArrowBuffer(_dataBuffers[offsetsBufferIndex].ReadOnlyBuffer);\n            ArrowBuffer offsetsBuffer = new ArrowBuffer(_offsetsBuffers[offsetsBufferIndex].ReadOnlyBuffer);\n            ArrowBuffer nullBuffer = new ArrowBuffer(_nullBitMapBuffers[offsetsBufferIndex].ReadOnlyBuffer);\n            int nullCount = GetNullCount(indexInBuffer, numberOfRows);\n            return new StringArray(numberOfRows, offsetsBuffer, dataBuffer, nullBuffer, nullCount, indexInBuffer);\n        }\n\n        protected internal override PrimitiveDataFrameColumn<long> GetSortIndices(bool ascending, bool putNullValuesLast) => throw new NotSupportedException();\n\n        public new ArrowStringDataFrameColumn Clone(long numberOfNullsToAppend = 0)\n        {\n            return (ArrowStringDataFrameColumn)CloneImplementation(numberOfNullsToAppend);\n        }\n\n        public new ArrowStringDataFrameColumn Clone(DataFrameColumn mapIndices, bool invertMapIndices = false, long numberOfNullsToAppend = 0)\n        {\n            return (ArrowStringDataFrameColumn)CloneImplementation(mapIndices, invertMapIndices, numberOfNullsToAppend);\n        }\n\n        /// <inheritdoc/>\n        protected override DataFrameColumn CloneImplementation(long numberOfNullsToAppend)\n        {\n            var ret = new ArrowStringDataFrameColumn(Name);\n\n            for (long i = 0; i < Length; i++)\n                ret.Append(IsValid(i) ? GetBytes(i) : default(ReadOnlySpan<byte>));","sourceCodeStart":348,"sourceCodeEnd":384,"githubUrl":"https://github.com/dotnet/machinelearning/blob/7b76e69cf964daeca3f1377af6bc5543284d56c6/src/Microsoft.Data.Analysis/DataFrameColumns/ArrowStringDataFrameColumn.cs#L348-L384","documentation":"GetSortIndices on ArrowStringDataFrameColumn unconditionally throws NotSupportedException (no message argument, hence 'null'). Sorting is not implemented for Arrow string columns because their multi-buffer, variable-length layout has no in-place sort path. Callers reach it via DataFrame.OrderBy/Sort APIs that rely on GetSortIndices.","triggerScenarios":"Sorting a DataFrame (df.OrderBy(columnName) / DataFrameRow sorting) where the sort key column is an ArrowStringDataFrameColumn, or calling GetSortIndices directly.","commonSituations":"Data loaded from Arrow IPC/Feather then sorted by a string column; pipelines mixing Arrow-backed and primitive columns where sorting works for numerics but not Arrow strings.","solutions":["Convert the ArrowStringDataFrameColumn to a StringDataFrameColumn and replace it in the collection before sorting.","Sort on a derived numeric column (e.g. a hash/key) instead of the Arrow string column.","Perform the sort upstream (in the Arrow/Feather source) before loading.","Clone the dataframe with mutable columns: df.Columns[name] = new StringDataFrameColumn(name, arrowCol); then OrderBy."],"exampleFix":"// before\nvar sorted = df.OrderBy(\"Name\"); // Name is ArrowStringDataFrameColumn -> NotSupportedException\n\n// after\ndf[\"Name\"] = new StringDataFrameColumn(\"Name\", ((ArrowStringDataFrameColumn)df.Columns[\"Name\"]).Cast<StringDataFrameColumn>());\nvar sorted = df.OrderBy(\"Name\");","handlingStrategy":"fallback","validationCode":"if (df.Columns[sortKey] is ArrowStringDataFrameColumn)\n    df[sortKey] = /* convert to StringDataFrameColumn */;","typeGuard":"static bool IsSortable(DataFrameColumn c) => c is not ArrowStringDataFrameColumn;","tryCatchPattern":"try { var sorted = df.OrderBy(key); }\ncatch (NotSupportedException) { /* convert Arrow string column to StringDataFrameColumn, retry */ }","preventionTips":["Convert Arrow-backed string columns to StringDataFrameColumn before sorting","Sort on numeric key columns where possible","Check column type before calling OrderBy","Convert at load time if the pipeline will sort later"],"tags":["dotnet","dataframe","not-supported","sorting"],"backgroundTag":"operation-not-supported","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"}