public sealed class CommandPartition : IEquatable<CommandPartition>
Reference documentation and code samples for the Google.Cloud.Spanner.Data class CommandPartition.
Represents a partition of data upon which a SpannerCommand will execute.
Partitions are useful for parallelizing large operations across several tasks or processes.
After partitioning a query, the partitions can be serialized using this method, then deserialized
with FromBase64String(string) on multiple machines, allowing parallel processing.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe latest version available for the \u003ccode\u003eCommandPartition\u003c/code\u003e class is 5.0.0-beta05, with numerous previous versions listed down to 3.5.0.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCommandPartition\u003c/code\u003e represents a data partition that a \u003ccode\u003eSpannerCommand\u003c/code\u003e will execute upon, useful for parallelizing large operations.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eCommandPartition\u003c/code\u003e class implements the \u003ccode\u003eIEquatable\u003c/code\u003e interface and provides a \u003ccode\u003ePartitionId\u003c/code\u003e property.\u003c/p\u003e\n"],["\u003cp\u003eIt includes static method \u003ccode\u003eFromBase64String\u003c/code\u003e to deserialize a partition and an instance method \u003ccode\u003eToBase64String\u003c/code\u003e to serialize a partition for transport and parallel processing across multiple machines.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides methods to retrieve the hashcode of an object.\u003c/p\u003e\n"]]],[],null,["# Google.Cloud.Spanner.Data - Class CommandPartition (5.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [5.1.0 (latest)](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.CommandPartition)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/5.0.0/Google.Cloud.Spanner.Data.CommandPartition)\n- [4.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.6.0/Google.Cloud.Spanner.Data.CommandPartition)\n- [4.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.5.0/Google.Cloud.Spanner.Data.CommandPartition)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.4.0/Google.Cloud.Spanner.Data.CommandPartition)\n- [4.3.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.3.0/Google.Cloud.Spanner.Data.CommandPartition)\n- [4.2.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.2.0/Google.Cloud.Spanner.Data.CommandPartition)\n- [4.1.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.1.0/Google.Cloud.Spanner.Data.CommandPartition)\n- [4.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.0.0/Google.Cloud.Spanner.Data.CommandPartition)\n- [3.15.1](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.15.1/Google.Cloud.Spanner.Data.CommandPartition)\n- [3.14.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.14.0/Google.Cloud.Spanner.Data.CommandPartition)\n- [3.13.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.13.0/Google.Cloud.Spanner.Data.CommandPartition)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.12.0/Google.Cloud.Spanner.Data.CommandPartition)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.11.0/Google.Cloud.Spanner.Data.CommandPartition)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.10.0/Google.Cloud.Spanner.Data.CommandPartition)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.9.0/Google.Cloud.Spanner.Data.CommandPartition)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.8.0/Google.Cloud.Spanner.Data.CommandPartition)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.7.0/Google.Cloud.Spanner.Data.CommandPartition)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.6.0/Google.Cloud.Spanner.Data.CommandPartition)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.5.0/Google.Cloud.Spanner.Data.CommandPartition) \n\n public sealed class CommandPartition : IEquatable\u003cCommandPartition\u003e\n\nReference documentation and code samples for the Google.Cloud.Spanner.Data class CommandPartition.\n\nRepresents a partition of data upon which a [SpannerCommand](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.SpannerCommand) will execute.\nPartitions are useful for parallelizing large operations across several tasks or processes. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e CommandPartition \n\nImplements\n----------\n\n[IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[CommandPartition](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.CommandPartition) \n\nInherited Members\n-----------------\n\n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Spanner.Data](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data)\n\nAssembly\n--------\n\nGoogle.Cloud.Spanner.Data.dll\n\nProperties\n----------\n\n### PartitionId\n\n public string PartitionId { get; }\n\nThe Id for the set of data to be included when the [SpannerCommand](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.SpannerCommand) executes.\n\nMethods\n-------\n\n### FromBase64String(string)\n\n public static CommandPartition FromBase64String(string base64String)\n\nCreates a new [CommandPartition](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.CommandPartition) based on the text returned by a previous\ncall to [ToBase64String()](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.CommandPartition#Google_Cloud_Spanner_Data_CommandPartition_ToBase64String).\n\n### GetHashCode()\n\n public override int GetHashCode()\n\nServes as the default hash function.\n\n**Overrides** \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)\n\n### ToBase64String()\n\n public string ToBase64String()\n\nSerializes this command partition as base64 text.\n\n**Remarks** \nAfter partitioning a query, the partitions can be serialized using this method, then deserialized\nwith [FromBase64String(string)](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.CommandPartition#Google_Cloud_Spanner_Data_CommandPartition_FromBase64String_System_String_) on multiple machines, allowing parallel processing."]]