title: Cannot sort purchasers by content in BigQuery/Firebase
body: <p>I'm using Firebase to analyze a mobile app. Data from Firebase is exported to BigQuery.</p>
  
  <p>I'm trying to use the following query, written in standard SQL, to count purchasers relevant to a specific content:</p>
  
  <pre><code>SELECT COUNT(user_dim.app_info.app_instance_id) AS purchasers
      ,eventParams.value.string_value AS eventName
      ,event.DATE AS eventDate
  FROM `id.TABLE.app_events_ * `
      ,UNNEST(event_dim) AS event
      ,UNNEST(event.params) AS eventParams
  WHERE (
          event.NAME = 'select_content'
          AND eventParams.KEY = 'item_id'
          )
      AND user_dim.app_info.app_instance_id IN (
          SELECT [user_dim.app_info.app_instance_id]
          FROM `id.TABLE.app_events_ * `
              ,UNNEST(event_dim) AS event
              ,UNNEST(event.params) AS eventParams
          WHERE event.NAME = 'in_app_purchase'
              AND eventParams.KEY = 'quantity'
          )
  GROUP BY eventDate
      ,eventName
  ORDER BY eventDate DESC
  </code></pre>
  
  <p>But I get the error message: 'Cannot execute IN subquery with uncomparable types STRING and ARRAY'</p>
  
  <p>I have tried to use 'UNNEST' function after the 'IN' operator.
  But then I got the error: 'Scalar subquery produced more than one element'</p>
  
  <p>Please, help me to find out where my mistake is.</p>