0

I need to parse the column message and fetch the key value pairs from the same object and i need to create new columns with the fetched data. The data looks like this:

{"segCode":"C002","segName":"Message Extras Test Segment Name", "segAssignType":"OFFER","offerStatic":"true","offerLoyLineItem":"1","offerCode":"654","offerLabel":"Sip Club: $1 Bagel","offerType":"SINGLE USE","offerDaysTilRwdStart":"","offerDaysTilRwdEnd":"","offerNbrVisitsToEarnRwd":"1","offerNbrDaysTilRwdExpire":"0","offerRwdLoadType":"ATL","offerEarnStartDt":"2023-05-18","offerEarnEndDt":"2023-05-28","offerRedeemStartDt":"2023-05-18","offerRedeemEndDt":"2023-05-28"}

desired output

enter image description here

enter image description here

........ like all the keys should get converted to columns

Jaytiger
  • 11,626
  • 2
  • 5
  • 15
Praneet T
  • 1
  • 1
  • You can use json functions like `JSON_VALUE(data, '$.segCode') AS segcode`. see [here](https://cloud.google.com/bigquery/docs/reference/standard-sql/json_functions) – Jaytiger Jun 09 '23 at 00:18

0 Answers0