BigQuery Firebase日内表未归档字段user_dim.user_properties.value.cleared咨询
user_dim.user_properties.value.cleared Field in Firebase BigQuery Exports Hey there! Let's break down your questions about this unexpected field in your Android Firebase event data step by step.
Why does the cleared field appear?
The cleared field is an internal metadata field used by the Firebase Android SDK to track when a user property has been explicitly cleared. This triggers when you call methods like FirebaseAnalytics.getInstance(context).clearUserProperty("property_name") (or when you set a user property to null).
It doesn't show up in the official Firebase BigQuery schema because it's considered an internal implementation detail, not a field intended for direct user analysis. Even so, it gets included in BigQuery exports automatically whenever a user property is cleared on the Android side.
Can you exclude it without modifying your SQL queries?
Unfortunately, there's no direct setting in the Firebase Android SDK to stop this field from being generated—it's tied to the SDK's core logic for handling property clearing. But here are two workarounds that let you avoid rewriting your existing UNION queries:
1. Avoid triggering the field entirely
If your business logic allows, skip calling user property clearing methods. Instead of clearing a property, overwrite it with a default value (like an empty string or unknown) when you no longer need the original value. This way, the cleared field won't be added to your event data at all.
2. Create a BigQuery view that removes the field
You can create a view of your Android event table that automatically excludes the cleared field, then use this view in your UNION queries instead of the raw table. Here's an example of how to define this view with BigQuery standard SQL:
CREATE OR REPLACE VIEW `your-project.your-dataset.android_events_view` AS SELECT * EXCEPT(user_dim.user_properties.value.cleared) FROM `your-project.your-dataset.android_events_intraday`
Once the view is set up, you can keep your existing queries completely unchanged—just swap the raw Android table reference with this view. The cleared field will be excluded automatically before you union with the iOS table.
内容的提问来源于stack exchange,提问作者Sergiiko

