Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleBigQuery JSON Schema
Code Block
languagejson
[
      {
  
     "description": "the name of the attribute (should match the name of the attribute provided in the doc_product table in either string_attributes, numeric_attributes or localized_numeric_attributes",
        "type": "STRING",
        "name": "attribute_name",
 
      "mode": "REQUIRED"
   
  },

     {
        "type": "BOOLEAN",
   
    "name": "numerical",
  
     "description": "are the provided attribute value identifiers numerical? fyi - in this tables, the values are always provided as strings, but not in the doc_products and other tables"
   
  },
 
    {
   
    "description": "the value id to map to it's related value labels (always a string, but must be castable to numeric if numerical = true)",

       "type": "STRING",
        "name": "value_id",
   
    "mode": "REQUIRED"
  
   },
   
  {
 
      "fields": [
   
      {

           "type": "STRING",
   
        "name": "language",
   
        "mode": "REQUIRED"
  
       },
   
      {
 
          "type": "STRING",
   
        "name": "value",

           "mode": "REQUIRED"
      }
   }
        ],
 
      "description": "the labels of the value id",
        "type": "RECORD",

       "name": "value_label",
   
    "mode": "REPEATED"
      },
      {
   
    "description": "the value ids of the parent (only for hierarchical attributes), (always a string, but must be castable to numeric if numerical = true)",
 
      "type": "STRING",
   
    "name": "parent_value_ids",

       "mode": "REPEATED"
   
  },
      {
        "fields": [
   
      {
 
          "type": "STRING",
   
        "name": "type"

         },
   
      {
   
        "type": "STRING",
  
         "name": "name"
   
      },
 
        {
   
        "type": "STRING",

           "name": "product_line"
   
      },
          {
            "type": "STRING",
  
         "name": "product_group"
          },
          {
 
          "type": "STRING",
   
        "name": "sku"

         },
          {
   
        "type": "NUMERIC",
  
         "name": "value"
   
      }
 
      ],
   
    "description": "connections to products (normally not needed, as should be provided in the doc_product table",

       "type": "RECORD",
        "name": "products",
   
    "mode": "REPEATED"
  
   },
   
  {
 
      "description": "the stores",
   
    "type": "STRING",

       "name": "stores",
   
    "mode": "REPEATED"
   
  },
  
   {
   
    "fields": [
 
        {
   
        "type": "STRING",

           "name": "language",
            ""mode": "REQUIRED"
 
        },
 
        {
            "type": "STRING",

           "name": "value",
   
        "mode": "REQUIRED"
          }
        ],
   
    "description": "the title of the attribute value",
 
      "type": "RECORD",
   
    "name": "title",

       "mode": "REPEATED"
   
  },
      {
        "fields": [
   
      {
 
          "type": "STRING",
   
        "name": "language",

           "mode": "REQUIRED"
   
      },
   
      {
  
         "type": "STRING",
   
        "name": "value",
 
          "mode": "REQUIRED"
   
      }

       ],
   
    "description": "the short description of the attribute value",
        "type": "RECORD",
        "name": "short_description",
  
     "mode": "REPEATED"
      },
      {
 
      "fields": [
   
      {

           "type": "STRING",
            "name": "language",
   
        "mode": "REQUIRED"
  
       },
   
      {
 
          "type": "STRING",
   
        "name": "value",

           "mode": "REQUIRED"
          }
   
    ],
  
     "description": "the description of the attribute value",
   
    "type": "RECORD",
 
      "name": "description",
   
    "mode": "REPEATED"

     },
   
  {
   
    "fields": [
  
       {
   
        "type": "STRING",
 
          "name": "name"
   
      },

         {
            ""fields": [
 
            {
 
              "type": "STRING",
                "name": "language",value_id"
          },
       "mode": "REQUIRED"
   {
             },"fields": [
              {
                "type": "STRING",
                "name": "valuelanguage",
                "mode": "REQUIRED"
              },
              {
   ],             "type": "RECORDSTRING",
                "name": "value",
                "mode": "REPEATEDREQUIRED"
          }    }
    ],         "description": "the images of the attribute value",],
            "type": "RECORD",
            "name": "imagesvalue",
            "mode": "REPEATED"
      },    }
  {      ],
  "fields": [     "type": "RECORD",
    {    "name": "values",
        "typemode": "STRING",REPEATED"
      }
    ],
    "namedescription": "language"the images of the attribute value",
     }"type": "RECORD",
    "name": "images",
    {
"mode": "REPEATED"
  },
   {
    "typefields": "STRING", [
      {
        "nametype": "valueSTRING",
   
        "modename": "REQUIREDlanguage"
   
      },
        ],{
        "descriptiontype": "the link of the attribute valueSTRING",
        "typename": "RECORDvalue",
        "namemode": "link",REQUIRED"
      }
    ],
    "modedescription": "REPEATED"the link of the attribute value",
 },   "type": "RECORD",
  {  "name": "link",
    "mode": "fields": [REPEATED"
  },
  {
    "fields": [
  {    {
        "type": "STRING",
 
          "name": "type"
   
      },

         {
   
        "type": "STRING",
   
        "name": "value"
  
       },
   
      {
 
          "fields": [
   
          {

               "type": "STRING",
                ""name": "language",
 
              "mode": "REQUIRED"
 
            },
              {

               "type": "STRING",
   
            "name": "value",
                "mode": "REQUIRED"
              }
   
        ],
 
          "type": "RECORD",
   
        "name": "loc_values",

           "mode": "REPEATED"
   
      }
        ],
        "description": "the tags of the attribute value, e.g.: [STRUCT('tag', 'hello world', [STRUCT('de', 'hello world')])]",
   
    "type": "RECORD",
 
      "name": "tags",
   
    "mode": "REPEATED"

     },
   
  {
   
    "fields": [
  
       {
   
        "type": "STRING",
 
          "name": "type"
   
      },

         {
   
        "type": "STRING",
            "name": "name",
            "mode": "REQUIRED"
  
       },
          {
            "type": "STRING",
 
          "name": "value"
   
      },

         {
            "fields": [
   
          {
  
             "type": "STRING",
   
            "name": "language",
 
              "mode": "REQUIRED"
   
          },

             {
                "type": "STRING",
   
            "name": "value",
  
             "mode": "REQUIRED"
   
          }
 
          ],
   
        "type": "RECORD",

           "name": "loc_values",
   
        "mode": "REPEATED"
   
      }
  
     ],
   
    "description": "the labels of the attribute value, e.g.: [STRUCT('symbol', 'delivery', '24h', [STRUCT('de', '24-H Versand')])]",
 
      "type": "RECORD",
   
    "name": "labels",

       "mode": "REPEATED"
      },
 },
    {
 
      "fields": [
          {

           "type": "STRING",
   
        "name": "type",
            "mode": "REQUIRED"
          },
 
        {
            "fields": [

             {
   
            "type": "STRING",
                "name": "language",
                "mode": "REQUIRED"
              },
              {
                "type": "STRING",
                "name": "value",
                "mode": "REQUIRED"
              }
            ],
            "type": "RECORD",
            "name": "label",
            "mode": "REPEATED"
          },
          {
            "fields": [
              {
                "type": "STRING",
                "name": "language",
                "mode": "REQUIRED"
              },
              {
                "type": "STRING",
                "name": "value",
                "mode": "REQUIRED"
              }
            ],
            "type": "RECORD",
            "name": "value",
            "mode": "REPEATED"
          },
          {
            "fields": [
    "STRING",
          {  "name": "language",
             "typemode": "STRINGREQUIRED",
          },
     "name": "language",    {
            "modetype": "REQUIREDSTRING",
            "name": "label"
  },        },
      {    {
            "type": "STRING",
  
             "name": "value",
                "mode": "REQUIRED"
 
            },
            ],{
            "type": "RECORDSTRING",
            "name": "sign",
          }
 "mode": "REPEATED"      ],
    }         ]"type": "RECORD",
        "typename": "RECORDvalues",
        "mode": "name": "pricing",REPEATED"
      }
    ],
    "description": "pricing information about the attribute value, e.g.: STRUCT('discountde',[STRUCT('dediscount','Bis:')],[STRUCT('de',, '-50:.-')],[STRUCT( 'deCHF','%')])"
",
    "type": "RECORD",
     }"name": "pricing",
    "mode": "REPEATED"
 { },
  {
    "fields": [
   
      {
  
         "type": "STRING",
   
        "name": "customer_groups",
 
          "mode": "REPEATED"
   
      },

         {
   
        "fields": [
   
          {
  
             "type": "STRING",
   
            "name": "language",
   
            "mode": "REQUIRED"
 
            },
 
            {
                "type": "INTEGER",

               "name": "value",
   
            "mode": "REQUIRED"
              }
            ],
   
        "type": "RECORD",
 
          "name": "values",
   
        "mode": "REPEATED"

         }
   
    ],
        "description": "the attribute value visibility :VISIBILITY_NOT_VISIBLE = 1; VISIBILITY_IN_CATALOG = 2; VISIBILITY_IN_SEARCH = 3; VISIBILITY_BOTH = 4;",
        "type": "RECORD",
   
    "name": "visibility",
 
      "mode": "REPEATED"
   
  },

     {
   
    "fields": [
   
      {
  
         "type": "STRING",
   
        "name": "language",
 
          "mode": "REQUIRED"
   
      },

         {
   
        "type": "INTEGER",
   ,
        "name": "value",
   
        "mode": "REQUIRED"

         }

       ],
        "description": "the attribute value status",
   
    "type": "RECORD",
  
     "name": "status",
        "mode": "REPEATED"
 
    },
   
  {

       "fields": [
   
      {
   
        "fields": [
  
           {
                "type": "STRING",
 
              "name": "language",
   
            "mode": "REQUIRED"

             },
   
          {
   
            "type": "DATETIME",
  
             "name": "value",
   
            "mode": "REQUIRED"
 
            }
   
        ],

           "type": "RECORD",
   
        "name": "start_datetime",
   
        "mode": "REPEATED"
    "REPEATED"
      },
   
      {
            "fields": [
              {
                "type": "STRING",
   
            "name": "language",
 
              "mode": "REQUIRED"
              },

             {
   
            "type": "DATETIME",
   
            "name": "value",
  
             "mode": "REQUIRED"
   
          }
 
          ],
            "type": "RECORD",

           "name": "end_datetime",
   
        "mode": "REPEATED"
   
      }
  
     ],
   
    "description": "information about the activity periods of the attribute value",
 
      "type": "RECORD",
    "name": "periods",
    "namemode": "periodsREPEATED"
  },
  {
     "modefields": "REPEATED" [
      {
  },       {"type": "STRING",
        "fieldsname": ["type"
      },
   {    {
        "type": "STRING",
  
         "name": "typename",
        "mode": "REQUIRED"
},      },
    {    {
        "type": "STRING",
 
          "name": "namevalues",
  
         "mode": "REQUIREDREPEATED"
          },
    ],
     {
       "description": "additional string (not localized) attributes of the attribute value",
    "type": "STRINGRECORD",
      "name": "string_attributes",
     "namemode": "valuesREPEATED",
  },
    {
    "mode": "REPEATED"
fields": [
      {
  }         ]"type": "STRING",
        "descriptionname": "additional string (not localized) attributes of the attribute value","type"
      },
      {
        "type": "RECORDSTRING",
        "name": "string_attributesname",
        "mode": "REPEATEDREQUIRED"
      },
      {
        "fields": [
          {
            "type": "STRING",
            "name": "typevalue_id"
          },
          {
            "typefields": "STRING",[
              {
                "nametype": "nameSTRING",
                "modename": "REQUIREDlanguage",
          },      "mode": "REQUIRED"
   {             "fields": [},
               {
                "type": "STRING",
                "name": "languagevalue",
                "mode": "REQUIRED"
              },
              {],
                "type": "STRINGRECORD",
                "name": "value",

               "mode": "REQUIREDREPEATED"
 
            }
            ],

           "type": "RECORD",
   
        "name": "values",
   
        "mode": "REPEATED"
  
       }
   
    ],
 
      "description": "additional localized string attributes of the attribute value",
        "type": "RECORD",

       "name": "localized_string_attributes",
   
    "mode": "REPEATED"
  },
  {
     },"fields": [
      {
        "fieldstype": [
 "STRING",
        "name": "type"
      },
  {    {
        "type": "STRING",
   ,
        "name": "typename",
        "mode": "REQUIRED"
},       },
   {   {
         "type": "STRINGNUMERIC",
  
         "name": "namevalues",
            "mode": "REQUIREDREPEATED"
   
      },
    ],
     {
       "description": "additional numeric (not localized) attributes of the attribute value",
    "type": "NUMERICRECORD",
       "name": "numeric_attributes",
    "namemode": "valuesREPEATED",
  },
  {
      "modefields": "REPEATED" [
      {
       } "type": "STRING",
      ],  "name": "type"
     "description": "additional numeric (not localized) attributes of the attribute value", },
      {
        "type": "RECORDSTRING",
        "name": "numeric_attributesname",
        "mode": "REPEATEDREQUIRED"
      },
      {
        "fields": [
          {
            "type": "STRING",
            "name": "typevalue_id"
          },
          {
            "typefields": "STRING", [
              {
                "nametype": "nameSTRING",
                "modename": "REQUIREDlanguage",
          },      "mode": "REQUIRED"
   {             "fields": [},
              {
                "type": "STRINGNUMERIC",
                "name": "languagevalue",
                "mode": "REQUIRED"
              },
              {
   ],
            "type": "NUMERICRECORD",
   
            "name": "value",
   
            "mode": "REQUIREDREPEATED"
              }
            ],
            "type": "RECORD",
   
        "name": "values",
 
          "mode": "REPEATED"
          }

       ],
   
    "description": "additional localized numeric attributes of the attribute value",
   
    "type": "RECORD",
  
     "name": "localized_numeric_attributes",
   
    "mode": "REPEATED"
  },
   },{
    "fields": [
      {
        "fieldstype": [
 "STRING",
        "name": "type"
      },
  {    {
        "type": "STRING",
 
          "name": "type"name",
        "mode": "REQUIRED"
      },
   
      {
  
         "type": "STRINGDATETIME",

           "name": "namevalues",
 
          "mode": "REQUIREDREPEATED"
  
       },
    ],
     {
       "description": "additional datetime (not localized) attributes of the attribute value",
    "type": "DATETIMERECORD",
    "name": "datetime_attributes",
      "namemode": "valuesREPEATED",
  },
    {
    "modefields": "REPEATED"[
      {
   }         ]"type": "STRING",
        "descriptionname": "additional datetime (not localized) attributes of the attribute value","type"
      },
      {
        "type": "RECORDSTRING",
        "name": "datetime_attributesname",
        "mode": "REPEATEDREQUIRED"
      },
      {
        "fields": [
          {
            "type": "STRING",
            "name": "typevalue_id"
          },
          {
            "typefields": "STRING", [
              {
                "nametype": "nameSTRING",
                "modename": "REQUIREDlanguage",
          },      "mode": "REQUIRED"
   {             "fields": [},
               {
                "type": "STRINGDATETIME",
                "name": "languagevalue",
                "mode": "REQUIRED"
              },
              {
 ],
              "type": "DATETIMERECORD",
  
             "name": "value",
   
            "mode": "REQUIREDREPEATED"
   
          }
  
         ],
   
        "type": "RECORD",
   
        "name": "values",
 
          "mode": "REPEATED"
 
        }
        ],

       "description": "additional localized datetime attributes of the attribute value",
   
    "type": "RECORD",
        "name": "localized_datetime_attributes",
        "mode": "REPEATED"
   
  },
 
    {
   
    "description": "technical field",

       "type": "DATETIME",
   
    "name": "creation_tm",
        "mode": "REQUIRED"
      },
   
  {
 
      "description": "technical field",
   
    "type": "INTEGER",

       "name": "client_id",
   
    "mode": "REQUIRED"
   
  },
  
   {
   
    "description": "technical field",
 
      "type": "INTEGER",
   
    "name": "src_sys_id",

       "mode": "REQUIRED"
   
  }
   
]
Expand
titleBigQuery DDL
Code Block
languagesql
CREATE OR REPLACE TABLE `YOUR_PROJECT.YOUR_DATASET.doc_attribute_value_F_20201030`   (
	  attribute_name STRING NOT NULL OPTIONS(description="the name of the attribute (should match the name of the attribute provided in the doc_product table in either string_attributes, numeric_attributes or localized_numeric_attributes")
	, numerical BOOLEAN OPTIONS(description="are the provided attribute value identifiers numerical? fyi - in this tables, the values are always provided as strings, but not in the doc_products and other tables")
	, value_id STRING NOT NULL OPTIONS(description="the value id to map to it's related value labels (always a string, but must be castable to numeric if numerical = true)")
	, value_label ARRAY<STRUCT<language STRING NOT NULL, value STRING NOT NULL>> OPTIONS(description="the labels of the value id")
	, parent_value_ids ARRAY<STRING NOT NULL> OPTIONS(description="the value ids of the parent (only for hierarchical attributes), (always a string, but must be castable to numeric if numerical = true)")
	, products ARRAY<STRUCT<type STRING, name STRING, product_line STRING, product_group STRING, sku STRING, value NUMERIC>> OPTIONS(description="connections to products (normally not needed, as should be provided in the doc_product table")
	, stores ARRAY<STRING> OPTIONS(description="the stores")
	, title ARRAY<STRUCT<language STRING NOT NULL, value STRING NOT NULL>> OPTIONS(description="the title of the attribute value")
	, short_description ARRAY<STRUCT<language STRING NOT NULL, value STRING NOT NULL>> OPTIONS(description="the short description of the attribute value")
	, description ARRAY<STRUCT<language STRING NOT NULL, value STRING NOT NULL>> OPTIONS(description="the description of the attribute value")
	, images ARRAY<STRUCT<name STRING, values ARRAY<STRUCT<value_id STRING, value ARRAY<STRUCT<language STRING NOT NULL, value STRING NOT NULL>>>>>> OPTIONS(description="the images of the attribute value")
	, link ARRAY<STRUCT<language STRING, value STRING NOT NULL>> OPTIONS(description="the link of the attribute value")
	, tags ARRAY<STRUCT<type STRING, value STRING, loc_values ARRAY<STRUCT<language STRING NOT NULL, value STRING NOT NULL>>>> OPTIONS(description="the tags of the attribute value, e.g.: [STRUCT('tag', 'hello world', [STRUCT('de', 'hello world')])]")
	, labels ARRAY<STRUCT<type STRING, name STRING NOT NULL, value STRING, loc_values ARRAY<STRUCT<language STRING NOT NULL, value STRING NOT NULL>>>> OPTIONS(description="the labels of the attribute value, e.g.: [STRUCT('symbol', 'delivery', '24h', [STRUCT('de', '24-H Versand')])]")
	, pricing ARRAY<STRUCT<type STRING, values ARRAY<STRUCT<language STRING NOT NULL, label STRING, value STRING NOT NULL, sign STRING>>>> OPTIONS(description="pricing information about the attribute value, e.g.: STRUCT('de','discount','Bis:', '-50.-', 'CHF'")
	, visibility ARRAY<STRUCT<customer_groups ARRAY<STRING NOT NULL>, values ARRAY<STRUCT<language STRING NOT NULL, value INT64 NOT NULL>>>> OPTIONS(description="the attribute value visibility :VISIBILITY_NOT_VISIBLE = 1; VISIBILITY_IN_CATALOG = 2; VISIBILITY_IN_SEARCH = 3; VISIBILITY_BOTH = 4;")
	, status ARRAY<STRUCT<language STRING NOT NULL, value INT64 NOT NULL>> OPTIONS(description="the attribute value status")
	, periods ARRAY<STRUCT<start_datetime ARRAY<STRUCT<language STRING NOT NULL, value DATETIME NOT NULL>>, end_datetime ARRAY<STRUCT<language STRING NOT NULL, value DATETIME NOT NULL>>>> OPTIONS(description="information about the activity periods of the attribute value")
	, string_attributes ARRAY<STRUCT<type STRING, name STRING NOT NULL, values ARRAY<STRING NOT NULL>>> OPTIONS(description="additional string (not localized) attributes of the attribute value")
	, localized_string_attributes ARRAY<STRUCT<type STRING, name STRING NOT NULL, values ARRAY<STRUCT<value_id STRING, value ARRAY<STRUCT<language STRING NOT NULL, value STRING NOT NULL>>>>>> OPTIONS(description="additional localized string attributes of the attribute value")
	, numeric_attributes ARRAY<STRUCT<type STRING, name STRING NOT NULL, values ARRAY<NUMERIC NOT NULL>>> OPTIONS(description="additional numeric (not localized) attributes of the attribute value")
	, localized_numeric_attributes ARRAY<STRUCT<type STRING, name STRING NOT NULL, values ARRAY<STRUCT<value_id STRING, value ARRAY<STRUCT<language STRING NOT NULL, value NUMERIC NOT NULL>>>>>> OPTIONS(description="additional localized numeric attributes of the attribute value")
	, datetime_attributes ARRAY<STRUCT<type STRING, name STRING NOT NULL, values ARRAY<DATETIME NOT NULL>>> OPTIONS(description="additional datetime (not localized) attributes of the attribute value")
	, localized_datetime_attributes ARRAY<STRUCT<type STRING, name STRING NOT NULL, values ARRAY<STRUCT<value_id STRING, value ARRAY<STRUCT<language STRING NOT NULL, value DATETIME NOT NULL>>>>>> OPTIONS(description="additional localized datetime attributes of the attribute value")
    , creation_tm   DATETIME NOT NULL OPTIONS(description="technical field")
    , client_id     INT64 NOT NULL OPTIONS(description="technical field")
    , src_sys_id    INT64 NOT NULL OPTIONS(description="technical field")
    )
OPTIONS(description="The attribute values to map string or numeric attributes to (possibly hierarchical) localized attributes");