出现异常 - “属性值大于表服务允许的值”,azure 存储表中行的最大大小是多少

发布于 2024-10-02 16:56:03 字数 501 浏览 2 评论 0原文

尝试在 Azure 表存储中插入记录时出现异常“属性值大于表服务允许的值”。

以下是我的表结构, string PartitionKey,String RowKey,string Id , string site, string name , byte[ ] content,
public DateTime createdtime

我试图在内容字段中保存 83755 字节数组(82KB),其他字段最多为 35 个字符。

谁能告诉我天蓝色存储表的行的最大大小是多少?

以下是我提到的 url..其中提到该行最多可以有 1MB。但我的不超过100KB。

链接

谢谢,

戈皮纳特

Getting exception "The property value is larger than allowed by the Table Service" while trying to insert a record in azure table storage.

Follwing is my table structure,
string PartitionKey,String RowKey,string Id , string site, string name , byte[ ] content,
public DateTime createdtime

And i am trying to save 83755 bytes array ( 82KB ) in content field and other fields are max of 35 chars.

Can anyone please tell me what is the max size of a row for azure storage table?

Following is the url which i referred.. there its mentioned the row can have 1MB max. But mine doesn't exceed 100 KB.

Link

Thanks,

Gopinath

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

む无字情书 2024-10-09 16:56:03

是的,每行最多可以有 1MB。但是,每个字节数组属性或字符串属性限制为 64K。有关每种数据类型的详细信息,请参阅此 MSDN 参考

Yes, each row may have up to 1MB. However, each byte array property or string property is limited to 64K. See this MSDN reference for specifics on each data type.

許願樹丅啲祈禱 2024-10-09 16:56:03

我建议查看 Lokad.Cloud for Azure 框架(开源)。有一个经过生产测试的代码,用于将大型实体序列化到表存储中,限制为 960KB(属性分割和管理由框架处理)

以下是来自 FatEntities 维基

// TODO: change your connection string here
var providers = Standalone.CreateProviders(
   "DefaultEndpointsProtocol=https;AccountName=;AccountKey=");

// 'books' is the name of the table
var books = new CloudTable<Book>(providers.TableStorage, "books");

var potterBook = new Book 
   { Author = "J. K. Rowling", Title = "Harry Potter" };

var poemsBook = new Book 
   { Author = "John Keats", Title = "Complete Poems" };

// inserting (or updating record in Table Storage)
books.Upsert(new[]
    {
        new CloudEntity<Book> {
            PartitionKey = "UK", RowRey = "potter", Value = potterBook},
        new CloudEntity<Book> {
            PartitionKey = "UK", RowRey = "poems", Value = poemsBook}
    });

// reading from table
foreach(var entity in books.Get())
{
    Console.WriteLine("{0} by {1} in partition '{2}' and rowkey '{3}'",
        entity.Value.Title, entity.Value.Author, 
        entity.PartitionKey, entity.RowRey);
}

Console.WriteLine("Press enter to exit.");
Console.ReadLine();

I recommend to check out Lokad.Cloud for Azure framework (Open Source). There is a production-tested code for serializing large entities into the table storage with 960KB limit (property splitting and management is handled by the framework)

Here's the sample usage from FatEntities wiki

// TODO: change your connection string here
var providers = Standalone.CreateProviders(
   "DefaultEndpointsProtocol=https;AccountName=;AccountKey=");

// 'books' is the name of the table
var books = new CloudTable<Book>(providers.TableStorage, "books");

var potterBook = new Book 
   { Author = "J. K. Rowling", Title = "Harry Potter" };

var poemsBook = new Book 
   { Author = "John Keats", Title = "Complete Poems" };

// inserting (or updating record in Table Storage)
books.Upsert(new[]
    {
        new CloudEntity<Book> {
            PartitionKey = "UK", RowRey = "potter", Value = potterBook},
        new CloudEntity<Book> {
            PartitionKey = "UK", RowRey = "poems", Value = poemsBook}
    });

// reading from table
foreach(var entity in books.Get())
{
    Console.WriteLine("{0} by {1} in partition '{2}' and rowkey '{3}'",
        entity.Value.Title, entity.Value.Author, 
        entity.PartitionKey, entity.RowRey);
}

Console.WriteLine("Press enter to exit.");
Console.ReadLine();
贩梦商人 2024-10-09 16:56:03

2017 年 5 月,Azure 推出了 Premium Table,实际上将 Azure Cosmos DB(以前称为 Azure DocumentDB)与 Azure 表 API 结合使用。

Premium Table 对每个实体(行)具有相同的 1MB 限制,但它允许单个属性最多 1MB(无 64K 限制)。

此外,它允许专用 RU 内无限数量的属性(Azure 表:255)和属性名称长度(Azure 表:255)。请求单位是 Cosmos DB 的资源消耗单位。

In May 2017, Azure introduced Premium Table which actually utilizes Azure Cosmos DB (formerly called Azure DocumentDB) with Azure Table API.

Premium Table has same 1MB limit for each entity(row), but it allows up to 1MB for single property (no 64K limit).

Moreover, it allows unlimited number of property (Azure Table: 255) and property name length (Azure Table: 255) within dedicated RU. Request Unit is a resource consumption unit for Cosmos DB.

  • Remarks: Premium Table is different from Premium Storage which does not support Table
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文