title: Parsing a string of 'single quotes' as json in presto
body: <p>~I want to cast a string of 'single quotes' string like below code.~</p>
  <hr />
  <p>Sorry, I changed the question.
  i replace the 'single quotes' to &quot;double quotes&quot;</p>
  <p>Example</p>
  <pre class="lang-sql prettyprint-override"><code>WITH data as (
      SELECT 
          '{&quot;svod&quot;: True, &quot;awards&quot;: [], &quot;copyright&quot;: &quot;© ROI VISUAL / EBS All rights Reserved.&quot;, &quot;providerId&quot;: &quot;50176b59-9bae-40ed-bedd-167786953c73&quot;, &quot;releaseYear&quot;: 2018, &quot;rating_levels&quot;: {&quot;drugs&quot;: &quot;none&quot;, &quot;theme&quot;: &quot;none&quot;, &quot;horror&quot;: &quot;none&quot;, &quot;language&quot;: &quot;none&quot;, &quot;violence&quot;: &quot;none&quot;, &quot;sex_and_nudity&quot;: &quot;none&quot;, &quot;imitable_behavior&quot;: &quot;none&quot;}, &quot;display_runtime&quot;: &quot;00:05:00&quot;, &quot;production_company&quot;: &quot;ROIVISUAL&quot;}' as meta
  )
  
  SELECT 
      -- json_parse(meta) -- X (Error : Cannot convert value to JSON)
      cast(meta as json) as meta_json, -- O &gt; &quot;{\&quot;svod\&quot;: True, \&quot;awards\&quot;: [], \&quot;copyright\&quot;: \&quot;© ROI VISUAL / EBS All rights Reserved.\&quot;, \&quot;providerId\&quot;: \&quot;50176b59-9bae-40ed-bedd-167786953c73\&quot;, \&quot;releaseYear\&quot;: 2018, \&quot;rating_levels\&quot;: {\&quot;drugs\&quot;: \&quot;none\&quot;, \&quot;theme\&quot;: \&quot;none\&quot;, \&quot;horror\&quot;: \&quot;none\&quot;, \&quot;language\&quot;: \&quot;none\&quot;, \&quot;violence\&quot;: \&quot;none\&quot;, \&quot;sex_and_nudity\&quot;: \&quot;none\&quot;, \&quot;imitable_behavior\&quot;: \&quot;none\&quot;}, \&quot;display_runtime\&quot;: \&quot;00:05:00\&quot;, \&quot;production_company\&quot;: \&quot;ROIVISUAL\&quot;}&quot;
      json_extract_scalar(cast(meta as json), '$.providerId') as meta_providerId -- Empty Return
  FROM data
  </code></pre>
  <p>Expected Results</p>
  <pre class="lang-sql prettyprint-override"><code>SELECT 
   json_extract_scalar(cast(meta as json), '$.releaseYear'), -- 2018
   json_extract_scalar(cast(meta as json), '$.providerId') -- &quot;50176b59-9bae-40ed-bedd-167786953c73&quot;
  FROM data
  </code></pre>
  <p>I've referred to this before, but it didn't work out.</p>
  <ul>
  <li><a href="https://stackoverflow.com/questions/55279784/how-to-cast-varchar-to-mapvarchar-varchar-in-presto">How to cast varchar to MAP(VARCHAR,VARCHAR) in presto</a></li>
  <li><a href="https://stackoverflow.com/questions/32478518/how-to-extract-keys-in-a-nested-json-array-object-in-presto">How to extract keys in a nested json array object in Presto?</a></li>
  <li><a href="https://stackoverflow.com/questions/72040483/presto-build-json-array-with-different-data-types">Presto Build JSON Array with Different Data Types</a></li>
  </ul>
  <p>Do you have any advice for me?</p>
  <p>Thanks!</p>