Skip to main content

BMW BigQuery Source

BQ is used as a backfill source across multiple entities. The primary BQ project for dealer and inventory data is bmw-prod-309117; product/feature data lives in app-template-382723.product.


BmwDealerEntity

BQ source of truth: bmw-prod-309117.inventory.dealer_locator_data

BQ sample (US, 349 total): 34400 Herb Chambers BMW, Boston MA · 56357 BMW of Westlake, OH · 16815 Nashua NH

New fields to add (in BQ, not yet in entity)

BQ columnEntity fieldC2B pathBQ backfillC2B sampleBQ ✓manual checkcode note
dealer_idnew: us_dealer_id34400 · 56357 · 16815US-market operational dealer ID — what the InvSearch feed uses in dealerid. No C2B equivalent; BQ-backfill only. Needed to join dealer records to inventory. Different from ag_code for ~30% of dealers (e.g. Rallye BMW: dealer_id=69000, ag_code=56519).
address_line_two_primarynewadditionalStreet`` (empty)Herb Chambers BMW · BMW of WestlakeBQ stores the DBA/marketing display name here, not a secondary street address; no direct C2B equivalent
zipcode_long_primarynew02134-4618 · 44145-1531 · 03060-5224ZIP+4 format; C2B only provides short zip
market_idnew10 (New England) · 4 (Cleveland/Dayton)US BMW market ID; all 349 BQ rows populated; no C2B equivalent
market_namenewNew England · Cleveland/Dayton · Central Southall 349 BQ rows populated; no C2B equivalent
region_codenewE · C · A1-letter code; all 349 BQ rows populated; no C2B equivalent
region_namenewEastern · Central · Southernall 349 BQ rows populated; no C2B equivalent

BQ columns not mapped

BQ columnTypeBQ sampleNotes
lat_wavgFLOAT42.350171weighted-average lat — likely a derived/enriched field
long_wavgFLOAT-71.128163weighted-average long — likely a derived/enriched field
sitesRECORDunknown structure — needs inspection

BmwModelEntity

BQ source table: app-template-382723.product.raw_model_metadata — one row per model code, full specs

BQ samples (all i7, MY2026): 267S = i7 M70, 267R = i7 eDrive50, 267Q = i7 xDrive60

New fields to add (BQ-only)

BQ columnProposed entity fieldBQ 1 (267S)BQ 2 (267R)BQ 3 (267Q)manual checkcode note
namemodel_namei7 M70i7 eDrive50i7 xDrive60need UCP path for non-BQ population
yearmodel_year202620262026BQ only; Stolo has no model year (same as inventory)
body_stylebody_type_nameSedanSedanSedannatural language; consistent
bodystyle_codebody_type_code020202numeric code; same coding as inventory bodystyle_code
fuel_typefuel_typeEEEsingle-letter code (E=electric); same coding as inventory fueltype
drive_traindrive_typexDrive all-wheel driveRear-wheel drivexDrive all-wheel drivelong-form natural language string; different from inventory enginedrivetype_name (xDrive)
pricebase_price168500105700124200
horsepowerhorsepower650449536
series_codeseries_codei7i7i7same as series for i-models; may differ for others
sports_flag (BOOL)sports_flagfalsefalsefalse
m_performance_flag (BOOL)m_performance_flagtruefalsefalse

Notes:

  • series vs series_code in BQ: identical for i-models (i7). For standard numeric series likely match too — to confirm with a broader sample.
  • model_to_visible_features.code is the model code (matches raw_model_metadata.code). The features array gives all visible feature codes for that model with their family_type.

BmwFeatureEntity

BQ source tables (access via app-template-382723.product):

  • raw_feature_metadata — one row per feature/option code, full metadata
  • model_to_visible_features — junction: model code → feature codes with family_type

BQ samples from raw_feature_metadata: S08S6 ("Prespecified for Export"), S08S9 ("Non Fuel Fahrzeug"), S08SM ("Visible chassis number") — these are internal/export-marker features with list_price=0 and empty family_code. More typical consumer option codes appear in model_to_visible_features (e.g., P0300=paint, S01T6=wheel, S0ZDY=package).

raw_feature_metadata — key columns

BQ columnTypeMaps to entity fieldNotes
codeSTRINGfeature_code5-char option code (e.g. S08SM)
product_codeSTRINGmodel_codemodel the feature belongs to (e.g. 242R)
nameSTRINGnameEnglish name (e.g. "Visible chassis number")
long_descriptionSTRINGdescriptionappears empty in sampled rows; marketing_text also null for service codes
typeSTRINGfeature_typesingle-letter code (S, F, I, P) — same format as UCP ✓
family_codeSTRINGfamily_codeempty string for sampled service codes; non-empty for other types
is_standardBOOLis_standardboolean — format matches UCP ✓
list_priceFLOAT64price_grossonly price field — no separate net price column
is_packageBOOLno entity field yet; candidate for future addition
sales_groupSTRUCT<code, name>e.g. {code: "Others", name: "Others"}
short_nameSTRING
marketing_textSTRINGseparate from long_description
rgb_valuesARRAY<STRING>paint colors
cosy_urlSTRING360° image URL
is_paint, is_upholstery, is_wheel, is_trim, is_accessory, is_package, is_line, is_individualBOOLfeature category flags
package_contentSTRUCTpackage slot definitions
update_timestampTIMESTAMP

Not in BQ: price_net, currency, brand — currency is USD (inferred for US market); brand must be set from request context.

raw_feature_metadata sample rows

feature_codenamefeature_typefamily_codeis_standardlist_priceproduct_codeis_package
S08S6Prespecified for ExportS``false0242Rfalse
S08S9Non Fuel FahrzeugS``false0242Rfalse
S08SMVisible chassis numberS``true0242Rfalse

242R is a model code — these service-type S options have empty family_code and 0 price. Real option prices and descriptions will appear in non-service feature records.

model_to_visible_features — structure

BQ columnTypeNotes
codeSTRINGmodel code (e.g. 26TQ, 268A)
featuresARRAY<STRUCT<code STRING, family_type STRING>>visible features per model
upload_timestampDATETIME

family_type values: OPTION, PACKAGE, PAINT, WHEEL, FABRIC, TRIM, PROGRAM — this is a model-level grouping distinct from raw_feature_metadata.type.

model_to_visible_features sample (model 26TQ)

family_type distribution: 14× PAINT, 6× WHEEL, 16× FABRIC, 3× TRIM, 4× PACKAGE, 5× PROGRAM, 14× OPTION (incl. S07ME).

Paint codes (P0300, P0475, P0C31, ...) appear here — confirms paint codes are tracked in this US system as visible features, separate from the options table.

BQ options table cross-check (public_invsearchvehicles_options)

CodeUS BQ foundUS BQ nameRows
S05DMParking Assistant185k
S06NXWireless Device Charging1.21M
S0534Automatic climate control / Dual Zone Auto Climate Control1.01M
S03DZWithout Lines designation1.41M
S0478❌ EUchild seat ISOFIX EU standard
S0654❌ EUDAB radio — EU-only
P0C6RIndividual paint — tracked in model_to_visible_features as PAINT, not options table

orderable_attributes cross-check (bmw-prod-309117.dataform)

Schema: series_code, body_style_group, sports_group, model_id, model_code, attribute_type, attribute_code, attribute_name.

CodefoundUS name
S05DMParking Assistant
S06NXWireless Device Charging
S0534Automatic climate control
S07MEM Driver's Package
S07DSEU service package
FKUFUupholstery code

Notes

  • family_type in model_to_visible_features (OPTION, PACKAGE, PAINT, ...) ≠ type in raw_feature_metadata (single-letter) — different categorization systems.
  • family_code in BQ appears empty for service-type options; populated for paint/fabric/trim.
  • Paint codes (P*) tracked as features in model_to_visible_features (family_type=PAINT), not in InvSearch options table.
  • is_package is in BQ as a BOOL; no entity field yet — candidate addition.
  • raw_feature_metadata.product_code (e.g., 242R) is a product-line grouping, not a model code — do not confuse with model_code.