1
votes

T-SQL has a couple of functions that can parse JSON data, but none of them are applicable to Azure SQL Data Warehouse.

I have data in JSON format in a VARCHAR column that looks like:

{'Purpose': 'Purpose 1', 'Activity': 'This activity'}

I could extract the 'Purpose' field in SQL Server by using the JSON_VALUE function:

SELECT JSON_VALUE('{'Purpose': 'Purpose 1', 'Activity': 'This activity'}', '$.Purpose');

But this is not supported in SQL Data Warehouse. Is there a way to do this in SQL Data Warehouse?

https://docs.microsoft.com/en-us/sql/t-sql/functions/json-functions-transact-sql

1
FYI - this is in preview now. Soon you'll be able to use the JSON functions just as you currently do in SQL Server. azure.microsoft.com/en-us/blog/…Gabe

1 Answers

0
votes

Update June 2019: This feature is in preview as at end of May 2019:

https://azure.microsoft.com/en-us/blog/azure-sql-data-warehouse-releases-new-capabilities-for-performance-and-security/

You should still consider if this is appropriate to do in your expensive Azure SQL Data Warehouse.


No. Do this kind of processing in Azure SQL Database which does actually support JSON processing. Start here:

Getting started with JSON features in Azure SQL Database

https://docs.microsoft.com/en-us/azure/sql-database/sql-database-json-features

You should also read this SQL Data Warehouse patterns and anti-patterns article. Consider if your expensive MPP is the right place for this type of processing: https://blogs.msdn.microsoft.com/sqlcat/2017/09/05/azure-sql-data-warehouse-workload-patterns-and-anti-patterns/