Microsoft Fabric 中的 Cosmos DB 中的示例数据集(预览版)

重要

此功能目前为预览版

Microsoft Fabric 的 Cosmos DB 数据库工作负荷附带了一个内置示例数据集,旨在帮助你探索、学习和试验。 此数据集表示产品集合,每个产品都具有反映真实电子商务方案的各种属性。

数据集结构和架构

示例数据集中的每个项都表示一个产品,并包含以下属性:

类型 DESCRIPTION
id string 以全局唯一标识符 (GUID) 格式的产品唯一标识符
name string 产品名称
price number 产品的当前价格
category string 产品类别,例如Electronics,、MediaAccessoryPeripheralOther
description string 产品的简要说明
stock number 库存项数
countryOfOrigin string 生产产品的区域
firstAvailable string 产品首次以 ISO 8601 格式提供日期和时间
priceHistory array 产品以前的价格数组(数字数组)
customerRatings array 客户评级对象的数组
customerRatings[].username string 提供评级的客户用户名
customerRatings[].stars number 数值分级值
customerRatings[].date string 评级的日期和时间采用 ISO 8601 格式
customerRatings[].verifiedUser boolean 指示用户是否已验证的布尔值
rareProperty boolean 可选)指示产品是否具有罕见的属性

注释

有关 ISO 8601 格式的详细信息,请参阅 国际日期和时间标准。 有关 GUID 格式的详细信息,请参阅 通用唯一标识符

示例项

下面是示例数据集中的产品示例:

{
  "id": "dddddddd-3333-4444-5555-eeeeeeeeeeee",
  "name": "Awesome Stand Micro (Red)",
  "price": 1073.12,
  "category": "Accessory",
  "description": "This Awesome Stand Micro (Red) is rated 4.6 out of 5 by 3.\n\nRated 3 out of 5 by Thomas Margrand (tmargand) from A great deal So this is a very nice buy, but the price is a little high, so I will not be buying again. Good price for it, but I still don't know if all i love about it is the high",
  "stock": 11,
  "countryOfOrigin": "France",
  "firstAvailable": "2020-05-04 16:01:42",
  "priceHistory": [
    1143.82,
    1098.56
  ],
  "customerRatings": [
    {
      "username": "cthomas",
      "stars": 1,
      "date": "2021-09-25 11:29:23",
      "verifiedUser": true
    },
    {
      "username": "tmargand",
      "stars": 3,
      "date": "2022-05-13 21:56:20",
      "verifiedUser": true
    }
  ]
}

如何使用示例数据

可以使用此数据集在 Microsoft Fabric 中练习查询、筛选和聚合 Cosmos DB 中的数据。 尝试按类别搜索产品、分析价格趋势或浏览客户反馈。

示例数据集的 JSON 架构

如果要在自己的环境中使用此示例数据集,下面是描述每个产品项结构的 JSON 架构:

{
  "type": "object",
  "properties": {
    "id": { "type": "string" },
    "name": { "type": "string" },
    "price": { "type": "number" },
    "category": { "type": "string" },
    "description": { "type": "string" },
    "stock": { "type": "number" },
    "countryOfOrigin": { "type": "string" },
    "firstAvailable": { "type": "string" },
    "priceHistory": {
      "type": "array",
      "items": { "type": "number" }
    },
    "customerRatings": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "username": { "type": "string" },
          "stars": { "type": "number" },
          "date": { "type": "string" },
          "verifiedUser": { "type": "boolean" }
        },
        "required": ["username", "stars", "date", "verifiedUser"]
      }
    },
    "rareProperty": { "type": "boolean" }
  },
  "required": [
    "id", "name", "price", "category", "description", "stock", "countryOfOrigin", "firstAvailable", "priceHistory", "customerRatings"
  ]
}

此架构可帮助你验证或生成自己的 Cosmos DB 工作负载的类似数据。