DP-500 · Question #44
You are using an Azure Synapse Analytics serverless SQL pool to query network traffic logs in the Apache Parquet format. A sample of the data is shown in the following table. You need to create a…
The correct answer is A. JSON_VALUE. To extract the source IP address from semi-structured data within an Apache Parquet file using an Azure Synapse Analytics serverless SQL pool, you should use the JSON_VALUE function.
Question
Options
- AJSON_VALUE
- BFOR JSON
- CCONVERT
- DFIRST VALUE
How the community answered
(23 responses)- A91% (21)
- C4% (1)
- D4% (1)
Why each option
To extract the source IP address from semi-structured data within an Apache Parquet file using an Azure Synapse Analytics serverless SQL pool, you should use the JSON_VALUE function.
The JSON_VALUE function is used in Transact-SQL to extract a scalar value from a JSON string. Since network traffic logs often contain semi-structured data that can be interpreted as JSON within Parquet files, JSON_VALUE is the appropriate function to parse and retrieve a specific field like the source IP address.
FOR JSON is used to format query results as JSON text, not to parse JSON data to extract values.
CONVERT is used to change data types or character sets and is not designed for parsing JSON structures to extract specific fields.
FIRST_VALUE is a window function that returns the first value in an ordered set of rows, which is unrelated to parsing JSON data.
Concept tested: Azure Synapse serverless SQL pool - JSON parsing
Source: https://learn.microsoft.com/en-us/sql/t-sql/functions/json-value-transact-sql?view=sql-server-ver16
Topics
Community Discussion
No community discussion yet for this question.