Valid DAA-C01 Dumps shared by ExamDiscuss.com for Helping Passing DAA-C01 Exam! ExamDiscuss.com now offer the newest DAA-C01 exam dumps, the ExamDiscuss.com DAA-C01 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com DAA-C01 dumps with Test Engine here:
You are tasked with cleaning a 'COMMENTS table that contains user-generated comments in a column (VARCHAR). The comments often contain HTML tags, excessive whitespace, and potentially malicious scripts. Your goal is to remove all HTML tags, trim leading and trailing whitespace, and escape any remaining HTML entities to prevent script injection vulnerabilities. Which combination of Snowflake scalar functions provides the most robust and secure way to achieve this data cleaning?
Correct Answer: B
Option B is the most robust and secure method. Here's why: 'REGEXP REPLACE(comment_text, Y', "Y: This removes HTML tags. This attempts to parse the remaining text as XML. If there are still any unescaped or malformed HTML entities, this step will help to isolate them and get rid of the tags. If the text cannot be parsed as XML, PARSE_XML returns NULL. '$').$: This extracts the text content of the XML. Crucially, 'XMLGET' inherently performs HTML entity decoding, effectively escaping potentially dangerous characters (e.g., becomes This prevents script injection. This removes leading and trailing whitespace. Option A only removes the HTML tags and trims the text, but doesn't handle HTML entity encoding, and thus it is vulnerable to script injection. Option C is not correct as HTML ENTITY DECODE' is not an existing function in Snowflake. Option D is not correct as the text needs to be cleaned irrespective of whether it contains XML or not. Option E - if parsing the XML returns null then original value gets returned , which we don't want , we would need to make the value NULL.