<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Karthik S Raman on Medium]]></title>
        <description><![CDATA[Stories by Karthik S Raman on Medium]]></description>
        <link>https://medium.com/@karthiksraman?source=rss-e1874d59421f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*78vjlh5AoStRRuj6bMKd7A.png</url>
            <title>Stories by Karthik S Raman on Medium</title>
            <link>https://medium.com/@karthiksraman?source=rss-e1874d59421f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 03:08:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@karthiksraman/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Snowflake Cortex Series — Part 7 : Sentiment Analysis Reimagined with SENTIMENT Function]]></title>
            <link>https://medium.com/@karthiksraman/snowflake-cortex-series-part-7-sentiment-analysis-reimagined-with-sentiment-function-256467d86c1f?source=rss-e1874d59421f------2</link>
            <guid isPermaLink="false">https://medium.com/p/256467d86c1f</guid>
            <category><![CDATA[snowflake-cortex]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[snowflake]]></category>
            <dc:creator><![CDATA[Karthik S Raman]]></dc:creator>
            <pubDate>Sat, 11 Jan 2025 05:28:18 GMT</pubDate>
            <atom:updated>2026-07-17T05:20:33.043Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Snowflake Cortex Series — Part 7 : </strong>Sentiment Analysis Reimagined with SENTIMENT Function</h3><p>Welcome to Part 7 of our <strong>Snowflake Cortex Series</strong>! In this series, we’re exploring how Snowflake Cortex’s advanced functions are empowering businesses to extract actionable insights from data with ease.</p><p>In previous installments, we’ve explored how these functions empower businesses to harness the power of large language models (LLMs):</p><p>In <a href="https://medium.com/snowflake/unleashing-the-power-of-snowflake-cortex-llm-functions-a-deep-dive-35a1f443e9eb"><strong>Part1</strong></a>, we covered a high level overview of all the available Snowflake Cortex LLM functions namely the Complete function, Task-specific functions and the helper functions.</p><p>In <a href="https://medium.com/snowflake/cortex-series-part-2-unleash-the-power-of-natural-language-processing-with-the-complete-function-1494fd6ba150"><strong>Part 2</strong></a>, we introduced the <strong>COMPLETE</strong> function, demonstrating how it enables users to generate creative content, answer complex questions, and produce customized summaries effortlessly.</p><p>In <a href="https://medium.com/@karthiksraman/snowflake-cortex-series-part-3-classifying-text-with-precision-a-comprehensive-guide-to-the-8b37a95b0b56"><strong>Part 3</strong></a>, focused on the <strong>CLASSIFY_TEXT</strong> function, showcasing its ability to categorize unstructured text data, optimize workflows, and drive informed decision-making.</p><p>In <a href="https://medium.com/@karthiksraman/snowflake-cortex-series-part-4-supercharging-your-data-analysis-with-extract-answer-function-8429dd3ff4d8"><strong>Part 4</strong></a>, focused on <strong>EXTRACT_ANSWER</strong> function, revealing how users can retrieve precise, natural-language answers from structured and semi-structured datasets.</p><p>In <a href="https://medium.com/@karthiksraman/snowflake-cortex-series-part-5-mastering-document-parsing-with-parse-document-function-1154df007862"><strong>Part 5</strong></a>, we looked at how <strong>PARSE_DOCUMENT </strong>function helps to extract valuable insights from documents using OCR and machine learning, enhancing search, operations, and data-driven decision-making.</p><p>In <a href="https://medium.com/snowflake/snowflake-cortex-series-part-6-ai-powered-text-condensation-using-summarize-function-315c8e1647de"><strong>Part 6</strong></a>, we explored how <strong>SUMMARIZE </strong>function uses advanced AI to condense large text into concise, context-rich summaries for efficient analysis and decision-making.</p><p>In this instalment, <strong>Part 7</strong>, we turn our attention to the <strong>SENTIMENT function</strong>. This Blog will explore its core features, configurable parameters, and practical implementation strategies. By the end, you’ll be equipped with the knowledge to transform data queries into valuable insights faster than ever.</p><h3><strong>SENTIMENT Function:</strong></h3><p>In today’s data-driven world, understanding customer sentiment is crucial for delivering exceptional experiences, managing brand perception, and refining product offerings. The <strong>SENTIMENT function</strong> in Snowflake Cortex is a cutting-edge solution designed to address this need.</p><p>Leveraging advanced natural language processing (NLP) capabilities, this function identifies whether a given text expresses positive, negative, or neutral emotions, providing actionable insights for improving customer experience, brand reputation, and product feedback.</p><p>Whether it’s customer reviews, social media posts, or support tickets, this function excels at analyzing unstructured text data, uncovering emotional insights that might otherwise remain hidden. By seamlessly integrating into the Snowflake ecosystem, it ensures real-time, scalable sentiment analysis without the need for complex external processing, empowering organizations to make data-driven decisions faster and more effectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*NnBJmLUvEV9UJlKiNmmmyA.png" /></figure><h3><strong>Key Applications:</strong></h3><p>The <strong>SENTIMENT function</strong> opens the door to numerous opportunities across a wide range of domains, enabling businesses to gain deeper insights and drive impactful decisions:</p><h4><strong>Customer Feedback Analysis</strong>:</h4><p>· Identify customer satisfaction and pain points by analyzing sentiment in reviews, surveys, and support tickets for actionable improvements.</p><h4><strong>Social Media Monitoring</strong>:</h4><p>· Track brand reputation and detect potential crises by evaluating sentiment in social media mentions and online discussions.</p><h4><strong>Employee Sentiment Analysis</strong>:</h4><p>· Assess workplace morale and engagement through sentiment scoring of employee feedback and surveys.</p><h4><strong>Product Development Insights</strong>:</h4><p>· Gauge customer reactions to new features or services by analyzing sentiment in feedback to guide development priorities.</p><h4><strong>Competitive Intelligence</strong>:</h4><p>· Strengthen market strategies by analyzing sentiment in competitor reviews, news articles, and social media discussions to uncover valuable insights.</p><h3><strong>Understanding how SENTIMENT Function works</strong></h3><h4><strong>Syntax:</strong></h4><p>The basic syntax for using the SENTIMENT function is as follows:</p><p>SNOWFLAKE.CORTEX.SENTIMENT(&lt;text&gt;)</p><h4><strong>Required Parameters:</strong></h4><ol><li><strong><em>text</em>:</strong> A string containing the text for which a sentiment score should be calculated.</li></ol><h4><strong>Returns:</strong></h4><p>A floating-point number ranging from -1 to 1 (inclusive) that represents the sentiment of the text, with negative values indicating negative sentiment, positive values reflecting positive sentiment, and values near 0 signifying neutral sentiment.</p><h3><strong>Real-World Applications of the SENTIMENT Function:</strong></h3><p>The SENTIMENT function delivers tangible business value through practical applications in various real-world scenarios. Here are some key examples of its impactful use cases.</p><h4><strong>Demo 1: Analyzing Customer Reviews from Customers for e-commerce retailer to determine Customer Sentiment</strong></h4><p>E-commerce retailers often rely on customer reviews to measure satisfaction, uncover product issues, and enhance their offerings. The SENTIMENT function simplifies this process by automatically categorizing reviews as <strong>Positive</strong>, <strong>Negative</strong>, or <strong>Neutral</strong>, based on sentiment scores.</p><p>By leveraging this function, businesses can:</p><p>· Quickly gauge customer sentiment across their product portfolio.</p><p>· Identify recurring pain points or emerging trends.</p><p>· Adjust marketing strategies, refine product designs, and improve overall customer experiences to foster brand loyalty.</p><h4>A step by step guide for the demo 1:</h4><ol><li><strong>Table Creation</strong>: DDL statement to create the table required for the demo.</li></ol><pre>CREATE OR REPLACE TABLE PRODUCT_REVIEWS (<br>    REVIEW_ID INT,<br>    PRODUCT_ID INT,<br>    CUSTOMER_ID INT,<br>    REVIEW_TEXT STRING,<br>    REVIEW_DATE DATE<br>);</pre><p>2. <strong>Loading sample data</strong> : Insert statements to load data into the PRODUCT_REVIEWS table.</p><pre>INSERT INTO PRODUCT_REVIEWS (REVIEW_ID, PRODUCT_ID, CUSTOMER_ID, REVIEW_TEXT, REVIEW_DATE)<br>VALUES <br>(1, 101, 1, &#39;This product is absolutely amazing! It arrived on time and was exactly as described. The quality exceeded my expectations, and it’s been working perfectly. I’m thrilled with my purchase and will definitely buy from this brand again. Highly recommend it!&#39;, &#39;2024-12-01&#39;),<br>(2, 101, 2, &#39;I’m really disappointed with the product. It didn’t match the description, and after using it for a week, it broke. The customer service was also unhelpful, and I feel like I wasted my money. Definitely not satisfied with this purchase.&#39;, &#39;2024-12-02&#39;),<br>(3, 102, 3, &#39;The product is okay. It does what it says but nothing special. I was expecting better performance given the price. It’s fine for now, but I might look for alternatives next time.&#39;, &#39;2024-12-03&#39;),<br>(4, 103, 4, &#39;This blender is fantastic! It blends everything smoothly, even tough ingredients. The build quality is sturdy, and cleaning is a breeze. It’s exactly what I needed for my morning smoothies. I love it!&#39;, &#39;2024-12-04&#39;),<br>(5, 104, 5, &#39;I had high hopes for this jacket, but the fabric feels cheap, and it’s not as warm as advertised. The sizing was also off, and it didn’t fit me well. Overall, I wouldn’t recommend it.&#39;, &#39;2024-12-05&#39;),<br>(6, 105, 6, &#39;I am so happy with these headphones! The sound quality is top-notch, and they’re incredibly comfortable. I can wear them for hours without any discomfort. Worth every penny!&#39;, &#39;2024-12-06&#39;),<br>(7, 106, 7, &#39;The shoes are just okay. They look nice, but the comfort level isn’t what I expected. After wearing them for a few hours, my feet started to hurt. Not a bad product, but it could be better.&#39;, &#39;2024-12-07&#39;),<br>(8, 107, 8, &#39;I love this book! It’s well-written, informative, and engaging. I couldn’t put it down. A must-read for anyone interested in personal development. Highly recommend!&#39;, &#39;2024-12-08&#39;),<br>(9, 108, 9, &#39;I’m not happy with this camera. The picture quality is subpar, and the battery life is disappointing. It’s not worth the price, and I’ll be returning it. Definitely a letdown.&#39;, &#39;2024-12-09&#39;),<br>(10, 109, 10, &#39;This kitchen appliance is decent. It works well, but there’s nothing extraordinary about it. I was expecting more advanced features for the price, but it’s a functional product.&#39;, &#39;2024-12-10&#39;);</pre><p>3. <strong>Validating the data loaded:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pLWMqN10O-3-Wyr9eNz2cg.png" /></figure><p>4. <strong>Leveraging the SENTIMENT function</strong> to analyze the data in PRODUCT_REVIEWS table.</p><pre>WITH SENTIMENT_SCORE AS (<br>    SELECT REVIEW_TEXT, <br>           SNOWFLAKE.CORTEX.SENTIMENT(REVIEW_TEXT) AS SENTIMENT_SCORE<br>    FROM PRODUCT_REVIEWS<br>)<br>SELECT REVIEW_TEXT,<br>       SENTIMENT_SCORE,<br>       CASE<br>           WHEN SENTIMENT_SCORE &gt; 0.3 THEN &#39;POSITIVE&#39;<br>           WHEN SENTIMENT_SCORE &lt; -0.3 THEN &#39;NEGATIVE&#39;<br>           ELSE &#39;NEUTRAL&#39;<br>       END AS SENTIMENT_GROUP<br>FROM SENTIMENT_SCORE;</pre><p>The above query analyzes customer reviews in the PRODUCT_REVIEWS table by calculating the sentiment score for each review using the SNOWFLAKE.CORTEX.SENTIMENT function.</p><p>Each review is assigned a sentiment score, which is used to classify the sentiment:</p><p>· Scores greater than 0.3 are labeled as <strong>POSITIVE</strong>.</p><p>· Scores less than -0.3 are labeled as <strong>NEGATIVE</strong>.</p><p>· Scores between -0.3 and 0.3 are labeled as <strong>NEUTRAL</strong>.</p><p>The result includes the review text, sentiment score, and its corresponding sentiment category.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2R8nyl3HSXOrSksP1QAakw.png" /><figcaption><strong>Query Output</strong></figcaption></figure><h4><strong>Demo 2: Analyzing Semi Structured Text information from Customer Support Tickets Data</strong></h4><p>Businesses can analyze chat conversations to gauge the emotional tone of customer interactions by leveraging SENTIMENT function to analyze text data in semi-structured JSON format, specifically from customer support chat information to determine Customer Sentiment.</p><h4>A step by step guide for the demo 2:</h4><ol><li><strong>Table Creation</strong>: DDL statement to create the table required for the demo.</li></ol><pre>CREATE OR REPLACE TABLE CUSTOMER_SUPPORT_TICKETS (<br>    TICKET_ID INT,<br>    CUSTOMER_NAME VARCHAR(100),<br>    AGENT_NAME VARCHAR(100),<br>    TICKET_DATE DATE,<br>    CHAT_LOG VARIANT<br>);</pre><p>2. <strong>Loading sample data</strong> : Insert statements to load data into the CUSTOMER_SUPPORT_TICKETS table.</p><pre>INSERT INTO CUSTOMER_SUPPORT_TICKETS (TICKET_ID, CUSTOMER_NAME, AGENT_NAME, TICKET_DATE, CHAT_LOG)<br>SELECT<br>    4, <br>    &#39;David Harris&#39;, <br>    &#39;Olivia Brown&#39;, <br>    &#39;2023-12-04&#39;, <br>    PARSE_JSON(&#39;[<br>        {&quot;timestamp&quot;: &quot;2023-12-04T11:10:00Z&quot;, &quot;role&quot;: &quot;customer&quot;, &quot;message&quot;: &quot;Can you help me track my shipment?&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-04T11:10:30Z&quot;, &quot;role&quot;: &quot;agent&quot;, &quot;message&quot;: &quot;Of course, David. Could you provide your tracking number?&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-04T11:11:00Z&quot;, &quot;role&quot;: &quot;customer&quot;, &quot;message&quot;: &quot;It&#39;&#39;s 987654321.&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-04T11:11:30Z&quot;, &quot;role&quot;: &quot;agent&quot;, &quot;message&quot;: &quot;Thank you! Your package is expected to arrive by December 6th.&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-04T11:12:00Z&quot;, &quot;role&quot;: &quot;customer&quot;, &quot;message&quot;: &quot;Perfect! Thank you for your assistance!&quot;}<br>    ]&#39;)<br>UNION ALL<br>SELECT<br>    5, <br>    &#39;Eve Martin&#39;, <br>    &#39;Lucas King&#39;, <br>    &#39;2023-12-05&#39;, <br>    PARSE_JSON(&#39;[<br>        {&quot;timestamp&quot;: &quot;2023-12-05T15:30:00Z&quot;, &quot;role&quot;: &quot;customer&quot;, &quot;message&quot;: &quot;I want to cancel my recent order.&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-05T15:30:30Z&quot;, &quot;role&quot;: &quot;agent&quot;, &quot;message&quot;: &quot;I&#39;&#39;m sorry to hear that, Eve. May I know the order number?&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-05T15:31:00Z&quot;, &quot;role&quot;: &quot;customer&quot;, &quot;message&quot;: &quot;The order number is 56789.&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-05T15:31:30Z&quot;, &quot;role&quot;: &quot;agent&quot;, &quot;message&quot;: &quot;I have canceled the order successfully. You will receive a refund soon.&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-05T15:32:00Z&quot;, &quot;role&quot;: &quot;customer&quot;, &quot;message&quot;: &quot;Thanks! I appreciate your help.&quot;}<br>    ]&#39;)<br>UNION ALL<br>SELECT<br>    6, <br>    &#39;Grace Lee&#39;, <br>    &#39;Ethan Clark&#39;, <br>    &#39;2023-12-06&#39;, <br>    PARSE_JSON(&#39;[<br>        {&quot;timestamp&quot;: &quot;2023-12-06T10:00:00Z&quot;, &quot;role&quot;: &quot;customer&quot;, &quot;message&quot;: &quot;Can I get a refund for my damaged item?&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-06T10:00:30Z&quot;, &quot;role&quot;: &quot;agent&quot;, &quot;message&quot;: &quot;I&#39;&#39;m sorry for the inconvenience. Could you upload a photo of the damage?&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-06T10:01:00Z&quot;, &quot;role&quot;: &quot;customer&quot;, &quot;message&quot;: &quot;Sure, here is the photo.&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-06T10:01:30Z&quot;, &quot;role&quot;: &quot;agent&quot;, &quot;message&quot;: &quot;I see the damage. I will process the refund and send a return label.&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-06T10:02:00Z&quot;, &quot;role&quot;: &quot;customer&quot;, &quot;message&quot;: &quot;Great, thanks for the quick resolution.&quot;}<br>    ]&#39;)<br>UNION ALL<br>SELECT<br>    7, <br>    &#39;Harry Harris&#39;, <br>    &#39;Isla White&#39;, <br>    &#39;2023-12-07&#39;, <br>    PARSE_JSON(&#39;[<br>        {&quot;timestamp&quot;: &quot;2023-12-07T14:00:00Z&quot;, &quot;role&quot;: &quot;customer&quot;, &quot;message&quot;: &quot;I am having issues with my internet connection.&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-07T14:00:30Z&quot;, &quot;role&quot;: &quot;agent&quot;, &quot;message&quot;: &quot;Sorry to hear that, Harry. Can you confirm if all lights on your router are on?&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-07T14:01:00Z&quot;, &quot;role&quot;: &quot;customer&quot;, &quot;message&quot;: &quot;Yes, they are, but the internet is still not working.&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-07T14:01:30Z&quot;, &quot;role&quot;: &quot;agent&quot;, &quot;message&quot;: &quot;It seems there might be a service outage in your area. Let me confirm.&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-07T14:02:00Z&quot;, &quot;role&quot;: &quot;customer&quot;, &quot;message&quot;: &quot;Thanks for checking. I&#39;&#39;ll wait for an update.&quot;}<br>    ]&#39;)<br>UNION ALL<br>SELECT<br>    8, <br>    &#39;Ivy Turner&#39;, <br>    &#39;William King&#39;, <br>    &#39;2023-12-08&#39;, <br>    PARSE_JSON(&#39;[<br>        {&quot;timestamp&quot;: &quot;2023-12-08T09:00:00Z&quot;, &quot;role&quot;: &quot;customer&quot;, &quot;message&quot;: &quot;Can you assist me with updating my billing address?&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-08T09:00:30Z&quot;, &quot;role&quot;: &quot;agent&quot;, &quot;message&quot;: &quot;Certainly, Ivy. Please provide the new billing address.&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-08T09:01:00Z&quot;, &quot;role&quot;: &quot;customer&quot;, &quot;message&quot;: &quot;The new address is 123 New St, Springfield, IL.&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-08T09:01:30Z&quot;, &quot;role&quot;: &quot;agent&quot;, &quot;message&quot;: &quot;Thank you! The address has been updated successfully.&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-08T09:02:00Z&quot;, &quot;role&quot;: &quot;customer&quot;, &quot;message&quot;: &quot;Awesome, thank you for the help!&quot;}<br>    ]&#39;)<br>UNION ALL<br>SELECT<br>    9, <br>    &#39;John Davis&#39;, <br>    &#39;Lily Roberts&#39;, <br>    &#39;2023-12-09&#39;, <br>    PARSE_JSON(&#39;[<br>        {&quot;timestamp&quot;: &quot;2023-12-09T13:20:00Z&quot;, &quot;role&quot;: &quot;customer&quot;, &quot;message&quot;: &quot;I&#39;&#39;m unable to access my account. Can you help?&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-09T13:20:30Z&quot;, &quot;role&quot;: &quot;agent&quot;, &quot;message&quot;: &quot;I&#39;&#39;m sorry for the trouble, John. Can you confirm your username?&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-09T13:21:00Z&quot;, &quot;role&quot;: &quot;customer&quot;, &quot;message&quot;: &quot;My username is johnd123.&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-09T13:21:30Z&quot;, &quot;role&quot;: &quot;agent&quot;, &quot;message&quot;: &quot;Thank you! It seems there was an issue with your password. I&#39;&#39;ll reset it for you.&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-09T13:22:00Z&quot;, &quot;role&quot;: &quot;customer&quot;, &quot;message&quot;: &quot;Thanks for fixing it so quickly.&quot;}<br>    ]&#39;)<br>UNION ALL<br>SELECT<br>    10, <br>    &#39;Rachel Green&#39;, <br>    &#39;Mia Garcia&#39;, <br>    &#39;2023-12-10&#39;, <br>    PARSE_JSON(&#39;[<br>        {&quot;timestamp&quot;: &quot;2023-12-10T08:45:00Z&quot;, &quot;role&quot;: &quot;customer&quot;, &quot;message&quot;: &quot;My order status says delivered, but I haven&#39;&#39;t received it yet.&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-10T08:45:30Z&quot;, &quot;role&quot;: &quot;agent&quot;, &quot;message&quot;: &quot;I&#39;&#39;m sorry for the confusion, Rachel. Let me check the delivery details.&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-10T08:46:00Z&quot;, &quot;role&quot;: &quot;customer&quot;, &quot;message&quot;: &quot;I appreciate it, Mia.&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-10T08:46:30Z&quot;, &quot;role&quot;: &quot;agent&quot;, &quot;message&quot;: &quot;It looks like the package was mistakenly marked as delivered. I&#39;&#39;ll arrange for it to be re-shipped immediately.&quot;},<br>        {&quot;timestamp&quot;: &quot;2023-12-10T08:47:00Z&quot;, &quot;role&quot;: &quot;customer&quot;, &quot;message&quot;: &quot;Thanks for your help. I&#39;&#39;ll be waiting for the new shipment.&quot;}<br>    ]&#39;);</pre><p>3. <strong>Validating the data loaded:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1j2OF6QpmePc2-6MSsDx5A.png" /></figure><p>4. <strong>Leveraging the SENTIMENT function</strong> to analyze the semi-structured data in CUSTOMER_SUPPORT_TICKETS table.</p><pre>WITH SENTIMENT_SCORE AS (<br>    SELECT CHAT_LOG, <br>           SNOWFLAKE.CORTEX.SENTIMENT(CHAT_LOG) AS SENTIMENT_SCORE<br>    FROM CUSTOMER_SUPPORT_TICKETS<br>)<br>SELECT CHAT_LOG,<br>       SENTIMENT_SCORE,<br>       CASE<br>           WHEN SENTIMENT_SCORE &gt; 0.3 THEN &#39;POSITIVE&#39;<br>           WHEN SENTIMENT_SCORE &lt; -0.3 THEN &#39;NEGATIVE&#39;<br>           ELSE &#39;NEUTRAL&#39;<br>       END AS SENTIMENT_GROUP<br>FROM SENTIMENT_SCORE;</pre><p>The above query analyzes customer support chat logs from the CUSTOMER_SUPPORT_TICKETS table by calculating the sentiment score using the SNOWFLAKE.CORTEX.SENTIMENT function.</p><p>Each chat conversation is assigned a sentiment score, which is used to classify the sentiment:</p><p>· Scores greater than 0.3 are labeled as <strong>POSITIVE</strong>.</p><p>· Scores less than -0.3 are labeled as <strong>NEGATIVE</strong>.</p><p>· Scores between -0.3 and 0.3 are labeled as <strong>NEUTRAL</strong>.</p><p>The result includes the CHAT_LOG, sentiment score, and its corresponding sentiment category.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5lV6qBXIZbEQU_yEXXFpig.png" /><figcaption><strong>Query Output</strong></figcaption></figure><h3><strong>Conclusion:</strong></h3><p>In conclusion, the Snowflake Cortex LLM function SENTIMENT empowers organizations across various industries to unlock valuable insights from their text data. By seamlessly integrating advanced NLP capabilities within the Snowflake ecosystem, SENTIMENT enables real-time, scalable sentiment analysis for a wide range of applications, including: identifying customer satisfaction and pain points through analysis of reviews, surveys, and support tickets; tracking brand reputation and detecting potential crises by evaluating sentiment in social media; assessing workplace morale and engagement through sentiment scoring of employee feedback; gauging customer reactions to new features or services to guide product development priorities; and gaining market insights by analyzing sentiment in competitor reviews, news articles, and social media to refine strategies. These applications empower businesses to make data-driven decisions, enhance customer experiences, and improve overall business outcomes.</p><h3>About the Author</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/112/1*BbXwKeBbcHqiLd8ub9sZpQ.jpeg" /></figure><p><strong>Karthik Srinivasan Raman</strong> | <strong>Head of Snowflake Tech Consulting</strong> | <strong>LTIMindtree</strong></p><p>Karthik currently serves as the Head of Snowflake Practice at LTM. With over 21 years of expertise in the data sector, he has extensive experience in Data Architecture, Data Modeling, Data Modernization &amp; Technology consulting for customers across the globe. In his leisure time, Karthik enjoys spending time with his family. He is also a passionate supporter of Manchester United Football Club, ensuring that his weekends are never complete without watching his beloved team play.</p><p><a href="https://www.linkedin.com/in/karthik-s-raman">www.linkedin.com/in/karthik-s-raman</a></p><p><a href="https://medium.com/@karthiksraman">https://medium.com/@karthiksraman</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=256467d86c1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Snowflake Cortex Series — Part 6 : AI-Powered Text Condensation using SUMMARIZE Function]]></title>
            <link>https://medium.com/@karthiksraman/snowflake-cortex-series-part-6-ai-powered-text-condensation-using-summarize-function-315c8e1647de?source=rss-e1874d59421f------2</link>
            <guid isPermaLink="false">https://medium.com/p/315c8e1647de</guid>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[snowflake-cortex]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Karthik S Raman]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 13:40:36 GMT</pubDate>
            <atom:updated>2026-07-17T05:21:01.757Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Snowflake Cortex Series — Part 6 : AI-Powered Text Condensation using SUMMARIZE Function</strong></h3><p>Welcome to <strong>Part 6</strong> of our <strong>Snowflake Cortex Series</strong>! This series explores how Snowflake Cortex’s advanced functions are helping businesses effortlessly extract actionable insights from their data.</p><p>In previous parts, we introduced various Snowflake Cortex LLM functions:</p><p>In <a href="https://medium.com/snowflake/unleashing-the-power-of-snowflake-cortex-llm-functions-a-deep-dive-35a1f443e9eb"><strong>Part1</strong></a>: A high-level overview of the <strong>COMPLETE</strong>, <strong>task-specific</strong>, and <strong>helper functions</strong>.</p><p>In <a href="https://medium.com/snowflake/cortex-series-part-2-unleash-the-power-of-natural-language-processing-with-the-complete-function-1494fd6ba150"><strong>Part 2</strong></a>: The <strong>COMPLETE function</strong>, showcasing its ability to generate creative content, answer complex queries, and produce tailored summaries.</p><p>In <a href="https://medium.com/@karthiksraman/snowflake-cortex-series-part-3-classifying-text-with-precision-a-comprehensive-guide-to-the-8b37a95b0b56"><strong>Part 3</strong></a>: The <strong>CLASSIFY_TEXT function</strong>, highlighting how it categorizes unstructured data for better decision-making.</p><p>In <a href="https://medium.com/@karthiksraman/snowflake-cortex-series-part-4-supercharging-your-data-analysis-with-extract-answer-function-8429dd3ff4d8"><strong>Part 4</strong></a>: The <strong>EXTRACT_ANSWER function</strong>, enabling natural language answers from structured and semi-structured data.</p><p>In <a href="https://medium.com/@karthiksraman/snowflake-cortex-series-part-5-mastering-document-parsing-with-parse-document-function-1154df007862"><strong>Part 5</strong></a>: The <strong>PARSE_DOCUMENT function</strong>, demonstrating how OCR and machine learning extract insights from documents to streamline operations.</p><p>Now in this <strong>Part 6</strong> we turn our attention to how the <strong>SUMMARIZE</strong> function leverages advanced AI to condense large text data into concise summaries, preserving key information and context. It is ideal for applications like summarizing customer interactions, documents, or extensive text-based datasets for efficient analysis and decision-making.</p><p>In this installment, we’ll explore: How the <strong>SUMMARIZE function</strong> works, Its parameters and features, Best practices for effective implementation.</p><p>By the end, you’ll be equipped with the knowledge to transform data queries into valuable insights faster than ever.</p><h3><strong>SUMMARIZE Function:</strong></h3><p>The <strong>SUMMARIZE</strong> function in Snowflake Cortex is an advanced AI-powered feature that leverages the capabilities of Large Language Models (LLMs) to efficiently condense large volumes of text into concise summaries while maintaining accuracy and key information. This functionality significantly enhances productivity by automating the summarization process, enabling faster data analysis, and facilitating a deeper understanding of complex information within the Snowflake Data Cloud. Summarize can be applied to a wide range of text formats, including documents, articles, reports, customer feedback, and more, making it a valuable tool for various industries and use cases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*NnBJmLUvEV9UJlKiNmmmyA.png" /></figure><h3><strong>Key Applications:</strong></h3><p>The <strong>SUMMARIZE</strong> function unlocks a universe of possibilities across diverse domains:</p><h4><strong>Customer Service:</strong></h4><ul><li>Summarizing customer feedback from surveys, reviews, and support tickets to quickly identify key issues and areas for improvement.</li><li>Condensing lengthy chat logs to extract crucial information for customer support representatives.</li></ul><h4><strong>Market Research:</strong></h4><ul><li>Summarizing market research reports, competitor analysis reports to gain a comprehensive understanding of market trends and customer preferences.</li></ul><h4><strong>Financial Services:</strong></h4><ul><li>Summarizing financial news articles, regulatory documents, and risk assessments to facilitate faster decision-making and risk mitigation.</li></ul><h4><strong>Legal:</strong></h4><ul><li>Summarizing legal documents, contracts, and case files to streamline legal processes and improve efficiency.</li></ul><h4><strong>Content Creation:</strong></h4><ul><li>Creating concise summaries of long-form articles, blog posts, and research papers for easier consumption and sharing.</li></ul><h3><strong>Understanding how SUMMARIZE Function works:</strong></h3><h4><strong>Syntax:</strong></h4><p>The basic syntax for using the SUMMARIZE function is as follows:</p><p><strong>SNOWFLAKE</strong>.<strong>CORTEX</strong>.SUMMARIZE(&lt;text&gt;)</p><h4><strong>Required Parameters:</strong></h4><p><strong><em>text</em>:</strong> A string containing the English text from which a summary should be generated.</p><h4><strong>Returns:</strong></h4><p>A string containing a summary of the original text.</p><h3><strong>Real-World Applications of the SUMMARIZE Function:</strong></h3><p>The <strong>SUMMARIZE</strong> function is not just a theoretical concept; it’s driving concrete business value in numerous real-world scenarios. Below are few key examples of its impactful applications.</p><h4>· <strong>Summarizing Market Research articles</strong></h4><p>This example shows how the SUMMARIZE function summarizes long text content, specifically from research articles and papers, into concise summaries.</p><p>The below query retrieves data from the RESEARCH_PAPERS table, specifically focusing on summarizing the contents of a column named FULL_TEXT. It includes four key components in its output:</p><ol><li><strong>FULL_TEXT</strong>: Original content of the research paper.</li><li><strong>ORIGINAL_TEXT_SIZE</strong>: Number of characters in the original text.</li><li><strong>SUMMARY</strong>: version of the text generated using the SUMMARIZE function.</li><li><strong>SUMMARIZED_TEXT_SIZE</strong>: Number of characters in the summary, illustrating the reduction in text size.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*BLd2PUa9NTa1xQjd8EtDtA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*0zqUusmqvzssZRbzRKP48Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*juDVjW3xhf74fP5DN2MXYw.png" /><figcaption><strong>Original Text</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*G4lZc8rCWDe7TTPUFGe3wg.png" /><figcaption><strong>Summarized Text</strong></figcaption></figure><h4>· <strong>Summarizing Semi-Structured Customer Support Data</strong></h4><p>The below example shows how the SUMMARIZE function summarizes text data in semi-structured JSON format, specifically from customer support chat information, into concise summaries.</p><p>The below query extracts the CHAT_LOG column from the CUSTOMER_SUPPORT_TICKETS table and uses the Snowflake Cortex SUMMARIZE function to generate a concise summary of each chat log. The results include both the original chat transcripts (CHAT_LOG) and their corresponding summaries (CHAT_SUMMARY), enabling quick insights into the key points of customer interactions without reviewing the full logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*QUkGcVDD6_8lv33riaCEbQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*uMg0MliEoIipSyfh4vz4PQ.png" /></figure><h4><strong>Conclusion:</strong></h4><p>In conclusion, the Snowflake Cortex SUMMARIZE function empowers data professionals with a powerful AI-driven feature for efficiently condensing large volumes of text data into concise summaries. By leveraging the capabilities of Large Language Models, SUMMARIZE unlocks valuable insights from diverse sources and enables to streamline data analysis, improves decision-making, and enhance productivity across various industries. As demonstrated through real-world examples, the SUMMARIZE function is not merely a theoretical concept but a practical solution with the potential to revolutionize how organizations interact with and understand their textual data.</p><h3>About the Author</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/112/1*BbXwKeBbcHqiLd8ub9sZpQ.jpeg" /></figure><p><strong>Karthik Srinivasan Raman</strong> | <strong>Head of Snowflake Tech Consulting</strong> | <strong>LTIMindtree</strong></p><p>Karthik currently serves as the Head of Snowflake Practice at LTM. With over 21 years of expertise in the data sector, he has extensive experience in Data Architecture, Data Modeling, Data Modernization &amp; Technology consulting for customers across the globe. In his leisure time, Karthik enjoys spending time with his family. He is also a passionate supporter of Manchester United Football Club, ensuring that his weekends are never complete without watching his beloved team play.</p><p><a href="https://www.linkedin.com/in/karthik-s-raman">www.linkedin.com/in/karthik-s-raman</a></p><p><a href="https://medium.com/@karthiksraman">https://medium.com/@karthiksraman</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=315c8e1647de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Snowflake Cortex Series — Part 5 : Mastering Document Parsing with PARSE_DOCUMENT Function]]></title>
            <link>https://medium.com/snowflake/snowflake-cortex-series-part-5-mastering-document-parsing-with-parse-document-function-1154df007862?source=rss-e1874d59421f------2</link>
            <guid isPermaLink="false">https://medium.com/p/1154df007862</guid>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[document-parsing]]></category>
            <category><![CDATA[snowflake-cortex]]></category>
            <dc:creator><![CDATA[Karthik S Raman]]></dc:creator>
            <pubDate>Tue, 31 Dec 2024 10:14:53 GMT</pubDate>
            <atom:updated>2026-07-17T05:21:50.362Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Snowflake Cortex Series — Part 5 : Mastering Document Parsing with PARSE_DOCUMENT Function</strong></h3><p>Welcome to Part 5 of our <strong>Snowflake Cortex Series</strong>! In this series, we are exploring how Snowflake Cortex empowers users with advanced functions.</p><p><a href="https://medium.com/snowflake/unleashing-the-power-of-snowflake-cortex-llm-functions-a-deep-dive-35a1f443e9eb"><strong>Part1</strong></a><strong>:</strong> Overview of Cortex LLM functions, including Complete, task-specific, and helper functions.</p><p><a href="https://medium.com/snowflake/cortex-series-part-2-unleash-the-power-of-natural-language-processing-with-the-complete-function-1494fd6ba150"><strong>Part 2</strong></a><strong>:</strong> The <strong>COMPLETE</strong> function, enabling creative content generation, complex queries, and tailored summaries.</p><p><a href="https://medium.com/@karthiksraman/snowflake-cortex-series-part-3-classifying-text-with-precision-a-comprehensive-guide-to-the-8b37a95b0b56"><strong>Part 3</strong></a><strong>:</strong> The <strong>CLASSIFY_TEXT</strong> function, which simplifies categorizing unstructured data and enhances decision-making.</p><p><a href="https://medium.com/@karthiksraman/snowflake-cortex-series-part-4-supercharging-your-data-analysis-with-extract-answer-function-8429dd3ff4d8"><strong>Part 4</strong></a><strong>:</strong> The <strong>EXTRACT_ANSWER</strong> function, enabling natural language answers from structured and semi-structured data.</p><p>Now in this <strong>Part 5</strong> we turn our attention to the <strong>PARSE_DOCUMENT</strong> function — an innovative feature that allows users to query both structured and semi-structured data to retrieve natural language answers. It combines the power of Snowflake’s scalable data platform with the sophisticated text and data processing capabilities of LLMs to help businesses extract insights from their data in an intuitive way.</p><p>By the end, you’ll be equipped with the knowledge to transform data queries into valuable insights faster than ever.</p><h3><strong>PARSE_DOCUMENT Function:</strong></h3><p>The <strong>PARSE_DOCUMENT</strong> function in Snowflake Cortex is an advanced AI-powered feature that extracts and interprets text and layout data from documents stored in internal or external stages. By leveraging cutting-edge <strong>Optical Character Recognition (OCR)</strong> technology and sophisticated machine learning models, it accurately identifies text, tabular data, and structural elements within complex documents like PDFs.</p><p>This functionality unlocks the value of unstructured document archives by transforming them into actionable insights. With PARSE_DOCUMENT, you can streamline workflows, build robust information retrieval systems, and automate document processing. Extracted data can be seamlessly loaded into structured Snowflake tables, enabling effortless integration with downstream applications. Whether managing large-scale document repositories or optimizing data pipelines, PARSE_DOCUMENT delivers exceptional accuracy and scalability for document analytics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*NnBJmLUvEV9UJlKiNmmmyA.png" /></figure><h3><strong>Key Applications:</strong></h3><p>The <strong>PARSE_DOCUMENT</strong> function unlocks a universe of possibilities across diverse domains. By extracting actionable insights, it bridges the gap between raw document archives and meaningful analytics, driving efficiency and innovation.</p><ul><li><strong>Revolutionizing Information Retrieval: </strong>Construct sophisticated search engines that effortlessly navigate vast repositories of business documents, ensuring rapid access to critical information and accelerating decision-making.</li><li><strong>Unleashing the Power of Data Enrichment: </strong>Transform raw, unstructured data into actionable insights by seamlessly integrating extracted information into existing data warehouses and analytical pipelines, enriching existing datasets with valuable context.</li><li><strong>Comprehensive Document Analysis: </strong>Delve beyond surface-level analysis with insightful document comprehension. Uncover hidden patterns, identify key themes, and gain a holistic understanding of the content and structure of documents, empowering data-driven discoveries.</li><li><strong>Automating the Data Pipeline: </strong>Streamline operations and liberate valuable human resources by automating tedious data extraction and processing tasks. Enhance operational efficiency, minimize human error, and unlock significant time and cost savings.</li></ul><h3><strong>Understanding how PARSE_DOCUMENT Function works under the hood:</strong></h3><p>The PARSE_DOCUMENT function provides two powerful modes for processing PDF documents: <strong>OCR (default)</strong> and <strong>LAYOUT</strong>.</p><ul><li><strong>OCR Mode (Default)</strong>:<br> Optimized for extracting text from text-heavy documents, this mode is ideal for quick and straightforward text extraction. It is recommended for documents without a complex semantic structure, offering an efficient way to retrieve textual information with minimal processing overhead.</li><li><strong>LAYOUT Mode (Optional)</strong>:<br> Designed to extract both text and layout elements, such as tables, this mode is ideal for enhancing the contextual understanding of documents. It is particularly suited for improving document knowledge bases, optimizing information retrieval systems, and supporting Large Language Model (LLM) inference tasks. By isolating text sections using layout elements, this mode enables more precise and targeted entity extraction, making it a valuable tool for advanced analytical workflows.</li></ul><h4><strong>Syntax:</strong></h4><p>The basic syntax for using the PARSE_DOCUMENT function is as follows:</p><p><strong>SNOWFLAKE</strong>.<strong>CORTEX</strong>.<strong>PARSE_DOCUMENT</strong>( ‘@&lt;stage&gt;’, ‘&lt;path&gt;’, [ { ‘mode’: ‘&lt;mode&gt;’ }, ] )</p><h4><strong>Required Parameters:</strong></h4><ol><li><strong>stage:</strong> The name of the Snowflake stage where the document is stored.</li><li><strong>path:</strong> The relative path to the document within the stage.</li></ol><h4><strong>Optional Parameters:</strong></h4><p><strong>MODE :</strong> Specifies the processing mode for the document:</p><p>· <strong>OCR (default)</strong>: Extracts plain text content.</p><p>· <strong>LAYOUT</strong>: Extracts data as markdown, including structural elements like tables.</p><p>For example, with <strong>LAYOUT Mode</strong>, you can structured data to improve downstream tasks such as generating insights, enhancing search relevance, or enabling detailed content analysis.</p><h4><strong>Returns:</strong></h4><p>An OBJECT data type containing the extracted data as a JSON-encoded string under the key content. The format of the content depends on the selected mode:</p><p>· <strong>LAYOUT Mode</strong>: Provides markdown with structural details, including tables.</p><p>· <strong>OCR Mode</strong>: Provides plain text content.</p><h4><strong>Error Conditions</strong></h4><p>If the input arguments are invalid or the function encounters other issues, it will return an error message. Refer to the Snowflake documentation for a comprehensive list of potential errors and their corresponding error messages.</p><h3><strong>Real-World Applications of the PARSE_DOCUMENT Function:</strong></h3><p>The <strong>PARSE_DOCUMENT</strong> function goes beyond theory; it is actively generating significant business value in a wide array of real-world applications. Below are several key examples of how this powerful function is being leveraged.</p><h4><strong>Parsing of Documents using OCR Mode: — Parsing documents with Vehicle Service Estimates:</strong></h4><p>The below example illustrates how the <strong>PARSE_DOCUMENT</strong> function can be used in OCRM mode to perform parsing of the PDF documents containing Vehicle Service estimates. The PARSE_DOCUMENT function can be instrumental in automating the processing of such service estimates. By feeding the PDF into the function, it can intelligently extract key information fields like:</p><ul><li><strong>Customer Details:</strong> Name, GSTIN, Address, Phone Number.</li><li><strong>Vehicle Information:</strong> Model, Registration Number, Chassis Number, Engine Number, Next Service Due Date.</li><li><strong>Service Details:</strong> RO Number, RO Type, Visit Date, Mileage, Estimated Delivery Date.</li><li><strong>Service Items:</strong> Description, Quantity, Job Value, Discount, Taxable Amount, Tax, Total Amount.</li><li><strong>Service Categories:</strong> Periodic Maintenance, General Repair, Value Added Services.</li></ul><p>Furthermore, the function can likely identify and categorize different sections of the document, such as “BILL TO,” “SHIP TO,” “VEHICLE INFO,” and “REPAIR ORDER INFO.” This structured output can then be loaded directly into a Snowflake table, enabling further analysis, reporting, and integration with other business systems.</p><p>This powerful use case demonstrates how <em>PARSE_DOCUMENT</em> transforms unstructured documents into actionable insights, reducing manual effort and driving smarter decision-making.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*rN1OVtlsD4WaAYMi4fd3eQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*sJDar_pXtMiOu6R-j-LsYg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*X_E-xd9STvNaqhGDpu-YjQ.png" /></figure><h4>· <strong>Parsing of documents using LAYOUT Mode: — Information from Retail Store Purchase Receipt:</strong></h4><p>The below example illustrates how the PARSE_DOCUMENT function can be used in Layout mode to perform an analysis of the PDF documents containing Retail Store Purchase receipt, detailing purchased items, their quantities, prices, tax, and total payment information in a structured format. For this use case, PARSE_DOCUMENT can extract relevant data such as store details (address, manager name), transaction details (total, tax, change due), and individual item data (description, SKU, price, quantity). This structured data can then be used for further analytics, such as generating purchase insights, calculating total spending, or categorizing products. By leveraging PARSE_DOCUMENT, businesses can automate the process of transforming unstructured receipt data into actionable information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*NUMw9fbW_lYU2MY2HVYWeg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*XQe6xgAx5GLdhC2Ybmq3lQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*nEPn3n8FvF2pqFXUR8M7Lg.png" /></figure><h3><strong>Limitations &amp; Considerations</strong></h3><p>While the PARSE_DOCUMENT function is a powerful tool, it’s important to be aware of its limitations:</p><ul><li><strong>File Size &amp; Page Limits:</strong> Currently supports PDFs up to 100MB with a maximum of 100 pages.</li><li><strong>Language Support:</strong> Optimized for English; support for other languages (French, Portuguese, etc.) is in preview.</li><li><strong>Digital PDF Optimization:</strong> Best suited for digitally created PDFs, with limited support for scanned documents.</li><li><strong>Stage Encryption:</strong> Server-Side Encryption is mandatory for stages used with PARSE_DOCUMENT.</li><li><strong>Network Policy Compatibility:</strong> Currently incompatible with custom network policies.</li></ul><h3><strong>Conclusion:</strong></h3><p>In conclusion, the Snowflake Cortex <strong>PARSE_DOCUMENT</strong> function empowers businesses to unlock the hidden value within their document repositories. By seamlessly integrating advanced OCR technology and sophisticated machine learning models, this function enables the extraction of valuable insights from unstructured data with unprecedented speed and accuracy. With its ability to process both text and layout information, PARSE_DOCUMENT unlocks a wide range of applications, from streamlining data entry and automating workflows to building sophisticated search engines and gaining deeper insights into document content. While limitations such as file size restrictions and language support considerations exist, Snowflake continues to enhance the capabilities of PARSE_DOCUMENT, pushing the boundaries of what’s possible in document analysis. As businesses increasingly rely on data-driven decision making, the PARSE_DOCUMENT function is poised to play a critical role in transforming raw documents into actionable intelligence.</p><h3>About the Author</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/112/1*BbXwKeBbcHqiLd8ub9sZpQ.jpeg" /></figure><p><strong>Karthik Srinivasan Raman</strong> | <strong>Head of Snowflake Tech Consulting</strong> | <strong>LTIMindtree</strong></p><p>Karthik currently serves as the Head of Snowflake Practice at LTM. With over 21 years of expertise in the data sector, he has extensive experience in Data Architecture, Data Modeling, Data Modernization &amp; Technology consulting for customers across the globe. In his leisure time, Karthik enjoys spending time with his family. He is also a passionate supporter of Manchester United Football Club, ensuring that his weekends are never complete without watching his beloved team play.</p><p><a href="https://www.linkedin.com/in/karthik-s-raman">www.linkedin.com/in/karthik-s-raman</a></p><p><a href="https://medium.com/@karthiksraman">https://medium.com/@karthiksraman</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1154df007862" width="1" height="1" alt=""><hr><p><a href="https://medium.com/snowflake/snowflake-cortex-series-part-5-mastering-document-parsing-with-parse-document-function-1154df007862">Snowflake Cortex Series — Part 5 : Mastering Document Parsing with PARSE_DOCUMENT Function</a> was originally published in <a href="https://medium.com/snowflake">Snowflake Builders Blog: Data Engineers, App Developers, AI, &amp; Data Science</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Snowflake Cortex Series — Part 4 : Supercharging Your Data Analysis with EXTRACT_ANSWER Function]]></title>
            <link>https://medium.com/@karthiksraman/snowflake-cortex-series-part-4-supercharging-your-data-analysis-with-extract-answer-function-8429dd3ff4d8?source=rss-e1874d59421f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8429dd3ff4d8</guid>
            <category><![CDATA[snowflake-cortex]]></category>
            <category><![CDATA[snowflake-data-cloud]]></category>
            <category><![CDATA[snowflake]]></category>
            <dc:creator><![CDATA[Karthik S Raman]]></dc:creator>
            <pubDate>Mon, 11 Nov 2024 15:48:32 GMT</pubDate>
            <atom:updated>2026-07-17T05:22:18.060Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Snowflake Cortex Series — Part 4 : Supercharging Your Data Analysis with EXTRACT_ANSWER Function</strong></h3><p>Welcome to Part 4 of our <strong>Snowflake Cortex Series</strong>! In this series, we’re exploring how Snowflake Cortex’s advanced functions are empowering businesses to extract actionable insights from data with ease.</p><p>In <a href="https://medium.com/snowflake/cortex-series-part-2-unleash-the-power-of-natural-language-processing-with-the-complete-function-1494fd6ba150"><strong>Part 2</strong></a>, we looked at the <strong>COMPLETE</strong> function, demonstrating how it enables users to generate creative content, answer complex questions, and produce customized summaries effortlessly.</p><p><a href="https://medium.com/@karthiksraman/snowflake-cortex-series-part-3-classifying-text-with-precision-a-comprehensive-guide-to-the-8b37a95b0b56"><strong>Part 3</strong></a>, focused on the <strong>CLASSIFY_TEXT</strong> function, showing how businesses can categorize unstructured text data, streamline workflows, and make data-driven decisions.</p><p>Now in this <strong>Part 4,</strong> we turn our attention to the <strong>EXTRACT_ANSWER</strong> function — an innovative feature that allows users to query both structured and semi-structured data to retrieve natural language answers. It combines the power of Snowflake’s scalable data platform with the sophisticated text and data processing capabilities of LLMs to help businesses extract insights from their data in an intuitive way.</p><p>We will delve into the details of the <strong>EXTRACT_ANSWER</strong> function, reviewing its parameters, features, and best practices for effective implementation. By the end, you’ll be equipped with the knowledge to transform data queries into valuable insights faster than ever.</p><h3><strong>EXTRACT_ANSWER Function:</strong></h3><p>Snowflake Cortex’s <strong>EXTRACT_ANSWER</strong> LLM function empowers users to extract specific information from text documents using natural language queries. By inputting a question and a source document (plain text or JSON), the function leverages advanced LLM technology to identify relevant text passages, process them, and return a concise answer. This capability significantly simplifies data analysis, enabling users to efficiently extract insights from unstructured data without complex SQL queries, accelerating data-driven decision-making.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*klPHBh1RLGKMyxJyMz2iIw.png" /></figure><h3><strong>Key Applications:</strong></h3><p>· <strong>Analyzing Customer Support Tickets: </strong>By leveraging the EXTRACT_ANSWER function, customer support teams can efficiently analyze ticket data to identify core issues, determine customer sentiment, and suggest relevant solutions from knowledge bases. This automation not only speeds up resolution times but also improves customer satisfaction by providing timely and accurate responses.</p><p>· <strong>Extracting Information from Product Reviews: </strong>The EXTRACT_ANSWER function can effectively analyze product reviews to extract valuable insights. By identifying key features, sentiments, and common issues, businesses can make data-driven decisions to improve product quality, marketing strategies, and customer experience.</p><p>· <strong>Extracting Information from News Articles: </strong>The EXTRACT_ANSWER function can be used to automate the process of extracting key information from news articles. By identifying the main topic, keywords, and summary of an article, businesses can stay updated on industry trends, monitor brand reputation, and identify potential opportunities or threats.</p><h3><strong>Understanding the parameters of the EXTRACT_ANSWER Function in Snowflake Cortex LLM</strong></h3><h4><strong>Syntax:</strong></h4><p>The basic syntax for using the EXTRACT_ANSWER function is as follows:</p><p>SNOWFLAKE.CORTEX.EXTRACT_ANSWER(&lt;source_document&gt;, &lt;question&gt;)</p><h4><strong>Required Parameters:</strong></h4><ol><li><strong>source_document:</strong> A string containing the plain-text or JSON document to be analyzed.</li><li><strong>question:</strong> A string specifying the question to be answered based on the source document.</li></ol><p><strong>Return Value:</strong> A string containing the extracted answer to the given question, based on the content of the source_document.</p><h4><strong>Error Conditions</strong></h4><p>If the input arguments are invalid or the function encounters other issues, it will return an error message. Refer to the <a href="https://docs.snowflake.com/en/user-guide/snowflake-cortex/llm-functions#label-cortex-llm-task-specific-functions">Snowflake documentation</a> for a comprehensive list of potential errors and their corresponding error codes.</p><h3><strong>Real-World Applications of the EXTRACT_ANSWER Function:</strong></h3><p>The <strong>EXTRACT_ANSWER</strong> function goes beyond theory; it is actively generating significant business value in a wide array of real-world applications. Below are several key examples of how this powerful function is being leveraged.</p><h4>· <strong>Analyzing Customer Support Tickets:</strong></h4><p>The below example illustrates how the EXTRACT_ANSWER function can be used to perform an analysis of the Customer Support Ticket data. This SQL query analyzes the structured data stored in the customer support ticket table to extract the main issue described by the customer. The SNOWFLAKE.CORTEX.EXTRACT_ANSWER function processes the ticket_description field to identify the core problem. The LATERAL FLATTEN clause is used to unpack the JSON output of the EXTRACT_ANSWER function, making the extracted issue accessible as the extracted_issue column. The final result includes the ticket ID, ticket description, and the identified main issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*KU8DX8fjHKH7QFLn8pevlg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*iqlrP_UxDs4iBZW_zh078A.png" /></figure><h4>· <strong>Extracting Information from Product Reviews:</strong></h4><p>The following SQL query demonstrates how to use the <strong>EXTRACT_ANSWER</strong> function to analyze structured data from product reviews stored in a table. For each review record, it applies the EXTRACT_ANSWER function twice: once to identify the main feature and once to determine the product color. The LATERAL FLATTEN clause is used to unpack the JSON output of the EXTRACT_ANSWER function, allowing the extracted information to be joined back to the original product_reviews table. The final result provides valuable insights, displaying the product name, review text, the extracted main feature, and the identified product color, giving companies a better understanding of customer feedback on specific product attributes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*mzQ5QmgI2taZDs7YC95QGg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*_HcaRPLgJn2qoYJjxrqZgQ.png" /></figure><h4>· <strong>Extracting Information from News Articles:</strong></h4><p>This SQL query analyses the semi-structured information stored in the news_articles table using the SNOWFLAKE.CORTEX.EXTRACT_ANSWER function. For each article, it applies the EXTRACT_ANSWER function multiple times to extract information like main topic, author, published date, summary, categories, and keywords. The LATERAL FLATTEN clause is used to unpack the JSON output of the EXTRACT_ANSWER function, making the extracted information accessible as separate columns. The final result includes the original article ID, article data, and the extracted information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*Uaawdo6T7cYmzXeI9ajGpg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*Twd_y48tF5la8UZdTZbFtQ.png" /></figure><h3><strong>Guidelines and Best Practices</strong></h3><p>To maximize the effectiveness of the EXTRACT_ANSWER function, it’s crucial to adhere to these best practices:</p><h4><strong>Effective Query Crafting:</strong></h4><ul><li><strong>Clarity and Specificity:</strong> Frame clear, concise questions with precise keywords.</li><li><strong>The More Specific, the Better:</strong> Detailed queries yield more accurate results.</li></ul><h4><strong>Optimizing Source Documents:</strong></h4><ul><li><strong>Clear Structure:</strong> Ensure well-formatted documents with clear headings and paragraphs.</li><li><strong>JSON for Structure:</strong> Consider JSON for structured data to enhance extraction.</li></ul><h4><strong>Iterative Refinement and Contextual Clues:</strong></h4><ul><li><strong>Experimentation:</strong> Refine queries if initial results are suboptimal. Experiment with different parameters and phrasings to optimize results.</li><li><strong>Contextual Understanding:</strong> Provide relevant context for improved accuracy, especially for complex queries.</li><li><strong>Monitor and Fine-tune:</strong> Continuously monitor the performance of the EXTRACT_ANSWER function and make adjustments as needed.</li></ul><p>By adhering to these guidelines and best practices, you can harness the full potential of the <strong>EXTRACT_ANSWER</strong> function to uncover valuable insights within your data. This approach empowers you to transform raw information into actionable intelligence, making data-driven decision-making more accessible and effective across your organization.</p><h3><strong>Conclusion:</strong></h3><p>Snowflake Cortex’s EXTRACT_ANSWER function is a powerful tool that revolutionizes data analysis by enabling users to extract meaningful insights from unstructured text data. By leveraging advanced natural language processing techniques, this function empowers businesses to streamline operations, improve decision-making, and uncover hidden patterns within their data. Whether it’s analyzing customer support tickets, product reviews, or news articles, the EXTRACT_ANSWER function simplifies complex tasks and accelerates the journey from raw data to actionable insights. As AI and ML continue to advance, we can expect even more innovative applications of this function in the future, making it an essential tool for data-driven organizations.</p><h3>About the Author</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/112/1*BbXwKeBbcHqiLd8ub9sZpQ.jpeg" /></figure><p><strong>Karthik Srinivasan Raman</strong> | <strong>Head of Snowflake Tech Consulting</strong> | <strong>LTIMindtree</strong></p><p>Karthik currently serves as the Head of Snowflake Practice at LTM. With over 21 years of expertise in the data sector, he has extensive experience in Data Architecture, Data Modeling, Data Modernization &amp; Technology consulting for customers across the globe. In his leisure time, Karthik enjoys spending time with his family. He is also a passionate supporter of Manchester United Football Club, ensuring that his weekends are never complete without watching his beloved team play.</p><p><a href="https://www.linkedin.com/in/karthik-s-raman">www.linkedin.com/in/karthik-s-raman</a></p><p><a href="https://medium.com/@karthiksraman">https://medium.com/@karthiksraman</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8429dd3ff4d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Snowflake Cortex Series — Part 3 : Classifying Text with Precision: A Comprehensive Guide to the…]]></title>
            <link>https://medium.com/@karthiksraman/snowflake-cortex-series-part-3-classifying-text-with-precision-a-comprehensive-guide-to-the-8b37a95b0b56?source=rss-e1874d59421f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b37a95b0b56</guid>
            <category><![CDATA[snowflake-data-cloud]]></category>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[snowflake-cortex]]></category>
            <dc:creator><![CDATA[Karthik S Raman]]></dc:creator>
            <pubDate>Mon, 04 Nov 2024 14:01:23 GMT</pubDate>
            <atom:updated>2026-07-17T05:22:55.015Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Snowflake Cortex Series -Part 3 : Classifying Text with Precision using CLASSIFY_TEXT Function</strong></h3><p>In <a href="https://medium.com/snowflake/cortex-series-part-2-unleash-the-power-of-natural-language-processing-with-the-complete-function-1494fd6ba150"><strong>Part 2</strong></a> of our Snowflake Cortex series, we explored the transformative potential of the <strong>COMPLETE</strong> function, a core element of Snowflake Cortex LLM that redefines natural language processing tasks. This powerful tool enables users to effortlessly generate creative content, address complex queries, and provide concise summaries. From sentiment analysis and synthetic data generation to customized summaries, the COMPLETE function opens up a world of possibilities for businesses across industries.</p><p>Now, in <strong>Part 3</strong>, we continue our journey by diving deeper into another powerful function within the Snowflake Cortex arsenal: the <strong>CLASSIFY_TEXT</strong> function. This function empowers users to categorize free-form text data into predefined categories, unlocking valuable insights and streamlining workflows. It enables organizations to make data-driven decisions and uncover critical insights hidden in unstructured text.</p><p><strong>We’ll explore the nuances of the CLASSIFY_TEXT function</strong>, examining its parameters, capabilities, and best practices for optimal implementation. By understanding the intricacies of this function, you can unlock new levels of innovation, efficiency, and data-driven insights.</p><h3><strong>CLASSIFY_TEXT Function: A Closer Look</strong></h3><p>The <strong>CLASSIFY_TEXT</strong> function is a powerful tool within Snowflake Cortex LLM that enables you to categorize free-form text data into predefined categories. This function leverages the power of natural language processing to accurately classify text, making it a valuable asset for a variety of applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*klPHBh1RLGKMyxJyMz2iIw.png" /></figure><h4><strong>Key Applications:</strong></h4><p>· <strong>Sentiment Analysis:</strong> By classifying text as positive, negative, or neutral, businesses can gain valuable insights into customer sentiment. This data-driven understanding can highlight areas for improvement, track brand reputation, and guide decisions to enhance customer satisfaction.</p><p>· <strong>Topic Classification:</strong> Categorizing text into specific topics allows organizations to efficiently organize and filter large volumes of information. This can help in tasks like news aggregation, document categorization, and social media monitoring. By understanding the topics discussed in text data, businesses can identify trends, extract relevant information, and make informed decisions.</p><p>· <strong>Intent Recognition:</strong> By accurately identifying the intent behind a user’s query, businesses can provide more relevant and efficient responses. This is particularly useful in chatbot and virtual assistant applications, While understanding user intent helps businesses deliver personalized, helpful assistance, creating a better user experience.</p><p>· <strong>Document Categorization:</strong> Automating the categorization of documents can save time and effort, especially for large organizations with extensive document repositories. By classifying documents into specific categories, businesses can improve search and retrieval capabilities, facilitate knowledge management, and streamline workflows.</p><h3><strong>Understanding the parameters of the CLASSIFY_TEXT Function in Snowflake Cortex LLM</strong></h3><h4><strong>Syntax:</strong></h4><p>The basic syntax for using the CLASSIFY_TEXT function is as follows:</p><p>SNOWFLAKE.CORTEX.CLASSIFY_TEXT(&lt;input&gt;, &lt;list_of_categories&gt;)</p><h4><strong>Required Parameters:</strong></h4><p><strong>Input:</strong></p><ul><li>A string representing the text data to be classified.</li><li>Case-sensitive, meaning that slight variations in capitalization can lead to different classification results.</li></ul><p><strong>List_of_categories:</strong></p><ul><li>An array of strings defining the potential categories for classification.</li><li>Must contain at least two and at most 100 unique categories.</li><li>Case-sensitive, so the exact capitalization of categories in the input text must match the defined categories.</li><li>If these requirements are not met, the function will return an error message.</li></ul><h4><strong>Return Value</strong></h4><p>The function returns a JSON object containing the following information:</p><ul><li><strong>Category:</strong> The category that the input text was classified into.</li></ul><h4><strong>Error Conditions</strong></h4><p>If the input arguments are invalid or the function encounters other issues, it will return an error message. Refer to the Snowflake documentation for a comprehensive list of potential errors and their corresponding error codes.</p><h3><strong>Live applications of CLASSIFY_TEXT Function:</strong></h3><p>The <strong>CLASSIFY_TEXT</strong> function isn’t just theoretical — it’s driving real business value across various real-world applications. Below are some examples of how this function is being utilized.</p><p>· <strong>Sentiment Analysis:</strong> Here is an example of how the CLASSIFY_TEXT function helps to uncover the nuances of customer sentiment by identifying and analyzing specific aspects of a text.</p><p>The below example illustrates how the CLASSIFY_TEXT function can be used to perform a sentiment analysis of the Review data stored in a table. The query classifies the review data stored in a table into one of the categories specified and returns a JSON object for each row of the table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*kgNgyTHGg9RljIYDr2qEbw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*k_Tlh-NaGJi9oA-ZOUqIng.png" /></figure><p>· <strong>Topic Classification:</strong> Here is an example of how the CLASSIFY_TEXT function helps to classify text data into categories and helps to organize the data and filter information. In the below example, The query uses CLASSIFY_TEXT function to classify and categorize mews articles stored in a table into different categories which can then help in creating a personalized news feed or analyzing trends in specific domains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*ccgHMpkkrr9YrT5lexBM9Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*Fx5TZdt4Px8wW6iefrDF4w.png" /></figure><p>· <strong>Intent Recognition:</strong> Here is an example of how the CLASSIFY_TEXT function can be used to precisely identify the underlying meaning of a user’s query and classify then in to a relevant category, which can help businesses to offer more targeted and effective solutions. This is particularly beneficial for chatbot and virtual assistant technologies, where accurate intent recognition is essential for providing personalized and helpful support.</p><p>In the following example, customer queries and their corresponding categories are stored in separate table columns. The CLASSIFY_TEXT function categorizes each query into its most relevant category.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*sBXNv38RNYJgF33CfQUP7g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*7988anSCgBIuY3WlWYnU3A.png" /></figure><p>· <strong>Document Categorization:</strong> Here is an example of how the CLASSIFY_TEXT function can help to automate the process of classifying and sorting documents into specific categories significantly reducing manual effort, particularly for large organizations with vast document repositories.</p><p>In the following example, document name and their corresponding categories are stored in separate table columns. The CLASSIFY_TEXT function categorizes each document into its most relevant category.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*Hb-ZXpP1EsUdPEWffH9Nkg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*lD3BgO14YMpUaCA___wPoA.png" /></figure><h3><strong>Guidelines and Best Practices</strong></h3><p>To maximize the effectiveness of the CLASSIFY_TEXT function, it’s crucial to adhere to these best practices:</p><h4><strong>Input Text Quality:</strong></h4><ul><li><strong>Plain English:</strong> Use clear and concise language in the input text to ensure accurate classification.</li><li><strong>Minimal Non-Text Content:</strong> Limit the inclusion of code snippets, logs, or other non-textual elements in the input to avoid misclassification.</li><li><strong>Open-Source Formats:</strong> Avoid using proprietary or company-specific formats, as they may hinder the classification process.</li></ul><h4><strong>Category Definition:</strong></h4><ul><li><strong>Descriptive Categories:</strong> Use clear and meaningful category labels that accurately reflect the content they represent.</li><li><strong>Avoid Abbreviations and Jargon:</strong> Employ full words and phrases to prevent misinterpretation.</li><li><strong>Mutual Exclusivity:</strong> Ensure that categories are distinct and non-overlapping to minimize confusion.</li></ul><p>By following these guidelines, you can significantly improve the accuracy and reliability of the CLASSIFY_TEXT function, leading to better data categorization and analysis.</p><h3><strong>Conclusion:</strong></h3><p>The CLASSIFY_TEXT function is a powerful tool within Snowflake Cortex LLM that empowers businesses to harness the potential of natural language processing. By accurately categorizing text data, organizations can gain valuable insights, improve operational efficiency, and enhance customer experiences. Whether applied to sentiment analysis, topic classification, intent recognition, or document categorization, the potential of this function is extensive and impactful. By adhering to best practices and leveraging the capabilities of the CLASSIFY_TEXT function, you can unlock new levels of innovation and drive data-driven decision-making.</p><h3>About the Author</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/112/1*BbXwKeBbcHqiLd8ub9sZpQ.jpeg" /></figure><p><strong>Karthik Srinivasan Raman</strong> | <strong>Head of Snowflake Tech Consulting</strong> | <strong>LTIMindtree</strong></p><p>Karthik currently serves as the Head of Snowflake Practice at LTM. With over 21 years of expertise in the data sector, he has extensive experience in Data Architecture, Data Modeling, Data Modernization &amp; Technology consulting for customers across the globe. In his leisure time, Karthik enjoys spending time with his family. He is also a passionate supporter of Manchester United Football Club, ensuring that his weekends are never complete without watching his beloved team play.</p><p><a href="https://www.linkedin.com/in/karthik-s-raman">www.linkedin.com/in/karthik-s-raman</a></p><p><a href="https://medium.com/@karthiksraman">https://medium.com/@karthiksraman</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b37a95b0b56" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cortex Series -Part 2 : Unleash the Power of Natural Language Processing with the COMPLETE Function]]></title>
            <link>https://medium.com/@karthiksraman/cortex-series-part-2-unleash-the-power-of-natural-language-processing-with-the-complete-function-1494fd6ba150?source=rss-e1874d59421f------2</link>
            <guid isPermaLink="false">https://medium.com/p/1494fd6ba150</guid>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[snowflake-cortex]]></category>
            <category><![CDATA[snowflake-data-cloud]]></category>
            <dc:creator><![CDATA[Karthik S Raman]]></dc:creator>
            <pubDate>Fri, 18 Oct 2024 14:29:07 GMT</pubDate>
            <atom:updated>2026-07-17T05:23:29.226Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Snowflake Cortex Series -Part 2 : Unleash the Power of Natural Language Processing with the COMPLETE Function</strong></h3><p>In <a href="https://medium.com/@karthiksraman/unleashing-the-power-of-snowflake-cortex-llm-functions-a-deep-dive-35a1f443e9eb"><strong>Part 1</strong></a> of this series, we explored the groundbreaking potential of <strong>Snowflake Cortex LLM Functions</strong> and how they are reshaping the way businesses interact with data. By integrating the power of <strong>Large Language Models (LLMs)</strong> directly into the Snowflake platform, organizations are revolutionizing data-driven operations, improving insights, and accelerating innovation. We discussed how Cortex empowers businesses to perform tasks like sentiment analysis, entity recognition, and real-time decision-making with ease.</p><p>Now, in <strong>Part 2</strong>, we continue our journey by diving deeper into one of Cortex’s most transformative functions: the <strong>COMPLETE</strong> function. This function is a cornerstone of LLM applications, enabling a wide range of use cases from text generation and summarization to question answering and creative writing.</p><p><strong>We’ll explore the intricacies of the COMPLETE function</strong>, including its parameters, capabilities, and best practices for effective implementation. Understanding its functionality will enable you to unlock new levels of innovation, efficiency, and insight from your data.</p><h3><strong>COMPLETE Function: Your Customizable NLP Workhorse</strong></h3><p><strong>The COMPLETE function</strong> is a versatile tool within Snowflake Cortex LLM that empowers you to perform a wide range of natural language processing tasks with unparalleled customization. From fine-tuning sentiment analysis to generating synthetic data, its capabilities are vast and adaptable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*klPHBh1RLGKMyxJyMz2iIw.png" /></figure><h4><strong>Key Applications:</strong></h4><ul><li><strong>Aspect-Based Sentiment Analysis:</strong> Delve deeper than just the overall sentiment. Identify specific aspects of a text and analyze the associated feelings, providing valuable insights for businesses.</li><li><strong>Synthetic Data Generation:</strong> Create realistic, artificial data to augment training datasets, improve model performance, and address data scarcity challenges.</li><li><strong>Customized Summaries:</strong> Generate summaries that align with your specific needs, whether you require concise overviews or detailed breakdowns.</li></ul><h4><strong>Safety and Reliability:</strong></h4><p>Cortex Guard ensures the safety and reliability of the COMPLETE function by filtering out potentially harmful or inappropriate responses. You can trust that the generated output will be aligned with your organization’s values and guidelines.</p><h4><strong>Fine-Tuning for Optimal Performance:</strong></h4><p>The <strong>COMPLETE</strong> function offers extensive flexibility, allowing you to fine-tune its parameters to better align with your business objectives. Whether you need more <strong>creative outputs</strong>, <strong>informative responses</strong>, or <strong>concise summaries</strong>, the COMPLETE function can be tailored to generate outputs that meet your specific needs.</p><h4><strong>Unlock the Versatility of the COMPLETE Function</strong></h4><p>With its powerful capabilities and customizable options, the COMPLETE function is a valuable asset for any organization looking to leverage the power of natural language processing. Discover how the COMPLETE function can enhance your business operations and drive innovation.</p><h3><strong>Understanding the parameters of the COMPLETE Function in Snowflake Cortex LLM</strong></h3><h4><strong>Required Parameters</strong></h4><p><strong>Model:</strong> Specifies the LLM model to be used for generating the completion.</p><p>Options include gemma-7b, jamba-1.5-mini, llama2–70b-chat, llama3–8b, llama3–70b, llama3.1–8b, llama3.2–1b, llama3.2–3b, mistral-large, mistral-large2, mistral-7b, mixtral-8x7b, reka-core, reka-flash, snowflake-arctic etc</p><p>The choice of model will impact the quality and cost of the generated response.</p><p><strong>Prompt_or_history:</strong> This is the input text or conversation history that the LLM will use to generate a completion.</p><ul><li>If options is not specified, the prompt must be a string.</li><li>If options is specified, the prompt must be an array of objects representing a conversation in chronological order. Each object must contain a role key and a content key. The content value is the prompt or response, and the role must be one of system, user, or assistant.</li></ul><h4><strong>Optional Parameters</strong></h4><p><strong>options:</strong> An object containing zero or more of the following options that affect the LLM’s hyperparameters:</p><ul><li><strong>temperature:</strong> Controls the randomness of the output (default: 0). Higher values result in more diverse and random output, while lower values make the output more deterministic.</li><li><strong>top_p:</strong> Controls randomness and diversity, similar to temperature, but restricts the set of possible tokens (default: 0).</li><li><strong>max_tokens:</strong> Sets the maximum number of output tokens in the response. Adjust the max_tokens value to control the length of the generated response. Be mindful of the computational cost associated with longer responses.</li><li><strong>guardrails:</strong> Filters potentially unsafe or harmful responses (default: False). If you’re concerned about potentially unsafe or harmful content, enable the guardrails option. However, note that this might limit the creativity and diversity of the generated text.</li></ul><h4><strong>Output</strong></h4><p>The output of the COMPLETE function depends on whether the options argument is specified:</p><p><strong>When options argument is not specified:</strong> A string representing the generated response.</p><p><strong>When options argument is specified:</strong> A JSON object containing-</p><ul><li>choices: An array of the model’s responses (usually only one).</li><li>created: UNIX timestamp of when the response was generated.</li><li>model: The name of the model used.</li><li>usage: An object recording the number of tokens consumed and generated.</li></ul><h3><strong>Live applications of COMPLETE Functions:</strong></h3><p>The <strong>COMPLETE</strong> function isn’t just theoretical — it’s driving real business value in various live applications. Below are some examples of how this function is being utilized.</p><p>· <strong>Aspect-Based Sentiment Analysis:</strong> Here are a couple of examples of how the COMPLETE function helps to uncover the nuances of customer sentiment by identifying and analyzing specific aspects of a text.</p><p><strong>Example 1: </strong>The below example illustrates how the COMPLETE function can be used to perform a sentiment analysis of the data stored in a table. The query returns a string response for each row of the table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4gH2Q4pK9LIsxYNihFk3JQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HUlftivojd90WfDlsoJi1Q.png" /></figure><p><strong>Example 2: </strong>The below example illustrates the use of a system prompt to perform a sentiment analysis of a food review. The prompt argument here is an array of objects, each having an appropriate role value. This query returns a JSON object containing the response information from the LLM Model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*_sJh6RNxnyujMcoSuL1ILA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*NjyrYglkOeRQ60E2VWOVUA.png" /></figure><p>· <strong>Synthetic Data Generation:</strong> Here is an example of how the COMPLETE function helps to create synthetic data that mirrors real-world patterns, enabling you to train more robust models and tackle challenges associated with limited data availability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*KTSNnIqipOXQ2QNoD_T4rg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*CR3Lkk1lIPF0-PLO7tJTUA.png" /></figure><p>· <strong>Customized Summaries:</strong> Here is an example of how the COMPLETE function helps to generate summaries from your text data to suit your specific preferences, from concise summaries to detailed breakdowns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*yPN6-gnM3eWyVaU1ihAflg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*_SdiBItQJsjA9Ll30PeJ2A.png" /></figure><h4><strong>Limitations and Considerations</strong></h4><p>While the COMPLETE function is a powerful tool, it’s important to be aware of its limitations:</p><ul><li><strong>Hallucinations:</strong> The model may sometimes generate information that is factually incorrect or misleading. This is known as a hallucination, and it’s important to validate outputs when accuracy is critical.</li><li><strong>Bias:</strong> Since the model is trained on large datasets, it can sometimes reflect the biases present in that data. Users should be cautious of unintended bias in the outputs.</li><li><strong>Computational Cost:</strong> Generating high-quality completions can be computationally expensive, especially for larger models.</li></ul><h4><strong>Conclusion:</strong></h4><p>The COMPLETE function within Snowflake Cortex LLM Functions offers a powerful and versatile tool for natural language processing tasks. By understanding its parameters, capabilities, and best practices, you can effectively leverage this function to generate creative text, answer questions, summarize information, and more.</p><p>Whether you’re a data scientist, developer, or business analyst, the COMPLETE function provides a valuable resource for unlocking the potential of Large Language Models within your data ecosystem. Embrace this function as part of your toolkit to transform how you interact with data and scale your organization’s capabilities.</p><h3>About the Author</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/112/1*BbXwKeBbcHqiLd8ub9sZpQ.jpeg" /></figure><p><strong>Karthik Srinivasan Raman</strong> | <strong>Head of Snowflake Tech Consulting</strong> | <strong>LTIMindtree</strong></p><p>Karthik currently serves as the Head of Snowflake Practice at LTM. With over 21 years of expertise in the data sector, he has extensive experience in Data Architecture, Data Modeling, Data Modernization &amp; Technology consulting for customers across the globe. In his leisure time, Karthik enjoys spending time with his family. He is also a passionate supporter of Manchester United Football Club, ensuring that his weekends are never complete without watching his beloved team play.</p><p><a href="https://www.linkedin.com/in/karthik-s-raman">www.linkedin.com/in/karthik-s-raman</a></p><p><a href="https://medium.com/@karthiksraman">https://medium.com/@karthiksraman</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1494fd6ba150" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Snowflake Cortex Series -Part1: Unleashing the Power of Snowflake Cortex LLM Functions: A Deep Dive]]></title>
            <link>https://medium.com/@karthiksraman/unleashing-the-power-of-snowflake-cortex-llm-functions-a-deep-dive-35a1f443e9eb?source=rss-e1874d59421f------2</link>
            <guid isPermaLink="false">https://medium.com/p/35a1f443e9eb</guid>
            <category><![CDATA[snowflake-cortex]]></category>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[snowflake-data-cloud]]></category>
            <dc:creator><![CDATA[Karthik S Raman]]></dc:creator>
            <pubDate>Mon, 07 Oct 2024 01:12:41 GMT</pubDate>
            <atom:updated>2026-07-17T05:24:16.180Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Introduction</strong></h3><p>Snowflake AI Data Cloud, continues to reshape how businesses manage and analyze their data by integrating the transformative capabilities of Large Language Models (LLMs). With Snowflake’s Cortex platform, organizations can seamlessly leverage these advanced models within Snowflake’s robust Data and AI ecosystem. This blog post will delve into the world of Snowflake Cortex LLM functions, providing a comprehensive overview of their capabilities, use cases, and the immense value they bring to organizations across various industries. By understanding how LLM functions can be harnessed within Snowflake’s powerful data platform, businesses can unlock new insights, streamline operations, and drive innovation.</p><h3><strong>Snowflake Cortex: Your Gateway to Cutting-Edge LLMs</strong></h3><p>Cortex provides businesses with the power to access industry-leading Large Language Models (LLMs) directly within the Snowflake platform. Cortex provides instant access to innovative models developed by renowned research teams at companies like Mistral, Reka, Meta, and Google. <strong>Plus, benefit from Snowflake Arctic</strong>, Snowflake’s own open enterprise-grade model designed to deliver exceptional performance and scalability.</p><h4><strong>Simplified and Seamless Integration:</strong></h4><p>One of the most compelling aspects of Snowflake Cortex is its ease of use. There’s no need for complex setup or management of infrastructure, as Cortex fully hosts and manages these LLMs. Your data remains securely within the Snowflake environment, guaranteeing the performance, scalability, and governance you’ve come to expect. You can immediately begin using LLMs without worrying about technical overhead or security risks, allowing your teams to focus on extracting valuable insights.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*klPHBh1RLGKMyxJyMz2iIw.png" /></figure><h3><strong>Snowflake Cortex: A Versatile Toolkit of LLM Functions</strong></h3><p>Snowflake Cortex offers a comprehensive suite of LLM functions, accessible through both SQL and Python, to cater to a wide range of natural language processing tasks. These functions can be categorized into:</p><h4><strong>COMPLETE Function: Your Customizable Workhorse</strong></h4><p>The <strong>COMPLETE</strong> function is an incredibly versatile tool, capable of executing a broad range of user-specified tasks. This flexibility makes it ideal for many natural language processing scenarios, including:</p><p>· <strong>Aspect-Based Sentiment Analysis:</strong> Pinpoint specific sentiments within a text, such as “product quality is excellent” or “customer service is poor.”</p><p>· <strong>Synthetic Data Generation:</strong> Create realistic, artificial data to augment training datasets or test models.</p><p>· <strong>Customized Summaries:</strong> Generate summaries that align with specific requirements or preferences.</p><p><strong>Cortex Guard</strong> ensures the safety and reliability of the COMPLETE function by filtering out potentially harmful or inappropriate responses. Additionally, the COMPLETE function can be fine-tuned, giving you control over how it operates to better suit your business objectives.</p><h4><strong>Task-Specific Functions: Streamlined Solutions</strong></h4><p>For common NLP tasks, Snowflake Cortex provides pre-built, managed functions that streamline your workflows. These functions are ready-to-use, reducing the complexity of integrating advanced language models into your operations.</p><p>· <strong>CLASSIFY_TEXT:</strong> Categorize text into predefined classes.</p><p>· <strong>EXTRACT_ANSWER:</strong> Retrieve answers from unstructured data based on specific questions.</p><p>· <strong>PARSE_DOCUMENT:</strong> Extract text and layout elements from documents.</p><p>· <strong>SENTIMENT:</strong> Determine the overall sentiment of a text, helping businesses gauge customer feedback or market sentiment.</p><p>· <strong>SUMMARIZE:</strong> Generate concise summaries of longer texts.</p><p>· <strong>TRANSLATE:</strong> Translate text between supported languages, facilitating communication across diverse linguistic regions.</p><p>· <strong>EMBED_TEXT_768:</strong> Create 768-dimensional vector embeddings for text representation.</p><p>· <strong>EMBED_TEXT_1024:</strong> Create 1024-dimensional vector embeddings for text representation.</p><h4><strong>Helper Functions: Ensuring Smooth Operations</strong></h4><p>To enhance the reliability and efficiency of your LLM workflows, Snowflake Cortex offers helper functions:</p><p>· <strong>COUNT_TOKENS:</strong> Calculate the token count of an input text, ensuring compliance with model limits.</p><p>· <strong>TRY_COMPLETE:</strong> Run the COMPLETE function with built-in error handling, returning NULL in case of an error, ensuring your workflows continue uninterrupted.</p><p>By leveraging this diverse set of LLM functions, you can enhance your data analysis, automate tasks, and gain valuable insights from your unstructured data and unlock the full potential of natural language processing within your Snowflake environment.</p><h3><strong>Cost Considerations for Snowflake Cortex LLM Functions</strong></h3><p>Snowflake Cortex LLM functions are charged based on the number of tokens processed. Below is a breakdown of how token-based pricing works and how you can optimize costs for your workloads.</p><h4><strong>Token-Based Pricing:</strong></h4><ul><li>A token is approximately equivalent to four characters.</li><li><strong>Input and Output Tokens:</strong> Functions that generate new text (COMPLETE, CLASSIFY_TEXT, SUMMARIZE, TRANSLATE) count both input and output tokens.</li><li><strong>Input Tokens Only:</strong> CORTEX GUARD, EMBED_TEXT_*, EXTRACT_ANSWER, and SENTIMENT count only input tokens.</li><li><strong>Prompt Addition:</strong> SUMMARIZE, TRANSLATE, EXTRACT_ANSWER, CLASSIFY_TEXT, and SENTIMENT add a prompt to the input text, slightly increasing the input token count.</li></ul><h4><strong>Cost Optimization:</strong></h4><ul><li><strong>Right Size Warehouses:</strong> Use smaller warehouses (no larger than MEDIUM) for Snowflake Cortex LLM functions and PARSE_DOCUMENT to optimize costs without sacrificing performance.</li><li><strong>TRY_COMPLETE:</strong> Leverage TRY_COMPLETE to avoid unnecessary costs for error handling.</li><li><strong>Token Management:</strong> Be mindful of token usage to minimize costs.</li><li><strong>Function Selection:</strong> Choose the most appropriate function for your task to avoid unnecessary token processing.</li></ul><p>By understanding these cost considerations and implementing optimization strategies, you can effectively manage your Snowflake Cortex LLM function expenses while maximizing the value of your applications.</p><h3><strong>Choosing the Ideal Model for Your Needs</strong></h3><p>Snowflake Cortex supports a diverse range of models, each tailored to specific use cases and performance requirements. Selecting the right model is essential to optimize performance, cost, and application outcomes. Below is a guide to help you make the right choice based on your needs.</p><h4><strong>Large Models:</strong></h4><p>Large models are designed for tasks that require extensive computational power, deeper reasoning capabilities, or multilingual support.</p><ul><li><strong>reka-core:</strong> Reka AI’s flagship model, excelling in reasoning, code generation, and multilingual tasks.</li><li><strong>mistral-large2:</strong> Mistral AI’s advanced model, ideal for complex tasks requiring strong reasoning and multilingual capabilities.</li><li><strong>llama3.1–405b:</strong> A powerful open-source model from Meta, well-suited for long document processing, multilingual support, and synthetic data generation.</li></ul><h4><strong>Medium Models:</strong></h4><p>Medium models strike a balance between performance and efficiency, making them suitable for a wide range of applications.</p><ul><li><strong>llama3.1–70b:</strong> A versatile model for chat applications, content creation, and enterprise use cases.</li><li><strong>snowflake-arctic:</strong> Snowflake’s enterprise-focused model, optimized for SQL generation, coding, and instruction following.</li><li><strong>reka-flash:</strong> A high-performance multilingual model for fast-paced workloads requiring high-quality output.</li><li><strong>mixtral-8x7b:</strong> Ideal for text generation, classification, and question answering, offering low latency and high throughput.</li><li><strong>jamba-Instruct:</strong> An efficient model for long documents and extensive knowledge bases, supporting summarization, Q&amp;A, and entity extraction.</li><li><strong>jamba-1.5-mini/large:</strong> State-of-the-art models for structured output and grounded generation.</li></ul><h4><strong>Small Models:</strong></h4><p>Small models in Snowflake Cortex are designed for simpler, more focused tasks where speed and cost-efficiency are priorities. These models offer sufficient power for basic operations while minimizing computational overhead.</p><ul><li><strong>llama3.2–1b/3b:</strong> Compact models for summarization, instruction following, and rewriting tasks, supporting multiple languages.</li><li><strong>llama3.1–8b:</strong> A lightweight model for low to moderate reasoning tasks.</li><li><strong>mistral-7b:</strong> Suitable for simple summarization, structuration, and question answering tasks.</li><li><strong>gemma-7b:</strong> Optimized for simple code and text completion tasks.</li></ul><h4><strong>Key Considerations:</strong></h4><ul><li><strong>Task Complexity:</strong> Evaluate the complexity of your task to determine the required model capabilities.</li><li><strong>Performance Requirements:</strong> Consider latency, throughput, and cost constraints when selecting a model.</li><li><strong>Data Characteristics:</strong> Assess the size, format, and content of your data to ensure compatibility with the chosen model.</li><li><strong>Experimentation:</strong> Start with a suitable model and gradually refine your selection based on performance and results.</li></ul><p>By carefully considering these factors, you can choose the most appropriate Snowflake Cortex LLM model to drive optimal results in your applications.</p><h3><strong>Benefits of Snowflake Cortex LLM Functions</strong></h3><ul><li><strong>Enhanced Data Insights:</strong> LLMs can analyze unstructured text, identify patterns, and generate meaningful summaries, providing a more comprehensive understanding of your information.</li><li><strong>Improved Efficiency:</strong> Snowflake Cortex streamlines the process of integrating LLMs into data workflows. The platform’s user-friendly interface and SQL-based commands make it easy for data analysts and developers to implement LLM functions without extensive programming knowledge.</li><li><strong>Scalability and Performance:</strong> Snowflake’s distributed architecture ensures that LLM functions can handle large datasets and complex queries efficiently. This scalability allows businesses to process vast amounts of data without compromising performance.</li><li><strong>Security and Governance:</strong> Snowflake Cortex is built on a secure and compliant data platform, providing robust security measures to protect sensitive information. This ensures that LLM applications can be deployed with confidence, adhering to industry standards and regulations.</li><li><strong>Seamless Workflow Integration:</strong> Cortex seamlessly integrates with Snowflake’s existing ecosystem, allowing businesses to incorporate LLM functions into their existing data pipelines and workflows. This minimizes disruption and maximizes the value of LLM applications.</li></ul><h3><strong>Applications of Snowflake Cortex LLM Functions:</strong></h3><p>Unlock the potential of advanced natural language processing and data analysis capabilities to drive innovation and efficiency across diverse industries.</p><ul><li><strong>Natural Language Processing (NLP):</strong> Sentiment analysis, text classification, topic modeling, named entity recognition.</li><li><strong>Data Analysis:</strong> Data summarization, data exploration, anomaly detection, predictive analytics.</li><li><strong>Customer Service:</strong> Chatbots, virtual assistants, automated customer support.</li><li><strong>Content Generation:</strong> Article writing, product descriptions, creative content.</li><li><strong>Research and Development:</strong> Literature review, hypothesis generation, knowledge discovery.</li></ul><h3><strong>Conclusion:</strong></h3><p>In today’s data-driven world, leveraging advanced tools like Snowflake Cortex LLM Functions is not just an option; it’s a necessity for staying competitive. By embracing these capabilities, organizations can transform their data strategies and lead the way in innovation. Snowflake Cortex LLM Functions offers a powerful and versatile toolkit for organizations seeking to leverage the capabilities of Large Language Models. By integrating LLMs directly into Snowflake’s data platform, businesses can unlock new insights, automate tasks, and drive innovation. The comprehensive suite of LLM functions, combined with Snowflake’s scalability, security, and ease of use, provides a compelling solution for a wide range of applications. Whether you’re looking to enhance data analysis, improve customer experiences, or streamline content creation, Snowflake Cortex LLM Functions offer the tools and flexibility you need to achieve your goals.</p><h3>About the Author</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/112/1*BbXwKeBbcHqiLd8ub9sZpQ.jpeg" /></figure><p><strong>Karthik Srinivasan Raman</strong> | <strong>Head of Snowflake Tech Consulting</strong> | <strong>LTIMindtree</strong></p><p>Karthik currently serves as the Head of Snowflake Practice at LTM. With over 21 years of expertise in the data sector, he has extensive experience in Data Architecture, Data Modeling, Data Modernization &amp; Technology consulting for customers across the globe. In his leisure time, Karthik enjoys spending time with his family. He is also a passionate supporter of Manchester United Football Club, ensuring that his weekends are never complete without watching his beloved team play.</p><p><a href="https://www.linkedin.com/in/karthik-s-raman">www.linkedin.com/in/karthik-s-raman</a></p><p><a href="https://medium.com/@karthiksraman">https://medium.com/@karthiksraman</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35a1f443e9eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Maximize Snowflake Warehouse Utilization: A Deep Dive into Warehouse_Cluster_Utilization View]]></title>
            <link>https://medium.com/@karthiksraman/understanding-warehouse-cluster-utilization-in-snowflake-42fe3aeafef8?source=rss-e1874d59421f------2</link>
            <guid isPermaLink="false">https://medium.com/p/42fe3aeafef8</guid>
            <category><![CDATA[cost-optimization]]></category>
            <category><![CDATA[warehouse-management]]></category>
            <category><![CDATA[snowflake-data-cloud]]></category>
            <dc:creator><![CDATA[Karthik S Raman]]></dc:creator>
            <pubDate>Fri, 27 Sep 2024 08:26:32 GMT</pubDate>
            <atom:updated>2024-09-27T09:29:11.938Z</atom:updated>
            <content:encoded><![CDATA[<p>In my earlier blog post, we explored how <a href="https://medium.com/snowflake/mastering-snowflake-warehouse-utilization-a-deep-dive-into-the-warehouse-utilization-view-855fa72fdf11">Snowflake Warehouse Utilization feature</a>, helps organizations optimize resource consumption and reduce costs by offering detailed insights into warehouse usage patterns. Building on that foundation, this post will delve into the WAREHOUSE_CLUSTER_UTILIZATION feature (currently in private preview). We’ll examine how this feature further aids organizations in optimizing costs and managing resources efficiently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*Lsw1TiUeDYj2weN9Wm6cAw.jpeg" /></figure><h3><strong>WAREHOUSE_CLUSTER_UTILIZATION View: New Feature — Currently in Private Preview</strong></h3><p>The <strong>WAREHOUSE_CLUSTER_UTILIZATION</strong> view, now available in Snowflake’s Account Usage schema, offers a detailed look into the resource consumption of Snowflake warehouses and clusters. It presents a comprehensive breakdown of utilization metrics over the past 365 days, helping users optimize performance, manage costs, and allocate resources more efficiently.</p><p>The WAREHOUSE_CLUSTER_UTILIZATION view offers a new level of transparency into Snowflake’s resource consumption, making it easier for organizations to understand and optimize their warehouse clusters.</p><p>Let’s explore the key features this view provides</p><h3><strong>Key Features</strong></h3><p><strong>Time-Based Analysis:</strong> The view presents Cluster utilization data for a specified time window, typically the last year, enabling users to track trends and identify patterns.</p><p><strong>Granular Level:</strong> It provides metrics at the warehouse cluster level, allowing for detailed analysis of individual resource performance.</p><p><strong>Comprehensive Metrics:</strong> The view includes the following key metrics:</p><ul><li><strong>Start Time:</strong> The beginning of the utilization time window.</li><li><strong>End Time:</strong> The end of the utilization time window.</li><li><strong>Warehouse ID:</strong> A unique identifier for the warehouse.</li><li><strong>Warehouse Name:</strong> The user-friendly name of the warehouse.</li><li><strong>Cluster Number:</strong> Unique identifier of the cluster.</li><li><strong>Utilization:</strong> A percentage value indicating the level of resource utilization, ranging from 0 (idle) to 100 (fully utilized).</li><li><strong>Number of Queries Running:</strong> The count of queries executing during the specified time period.</li></ul><h3><strong>Benefits and Applications</strong></h3><p>The WAREHOUSE_CLUSTER_UTILIZATION view offers several significant advantages for Snowflake users, transforming raw utilization data into actionable insights. By leveraging this view, users can:</p><ul><li><strong>Optimize performance:</strong> Identify underutilized or overloaded clusters to improve query execution times and overall system efficiency.</li><li><strong>Manage costs:</strong> Determine the cost-effectiveness of warehouse cluster sizing and usage patterns, helping to reduce unnecessary expenses.</li><li><strong>Ensure efficient resource allocation:</strong> Make data-driven decisions about scaling warehouses up or down based on workload demands, preventing resource bottlenecks and maximizing utilization.</li><li><strong>Monitor resource trends:</strong> Track historical utilization data to identify patterns, anticipate future needs, and proactively adjust resource allocations.</li><li><strong>Identify resource anomalies:</strong> Detect unusual spikes or dips in utilization, which could indicate issues such as query performance problems or resource contention.</li></ul><h3><strong>Considerations and Limitations</strong></h3><p>While the WAREHOUSE_CLUSTER_UTILIZATION view is a valuable tool, there are certain considerations and limitations that users should keep in mind to ensure effective utilization of this feature:</p><p>· <strong>Potential Latency:</strong> The view might have a maximum delay of six hours between the actual utilization and the reported data. This means that real-time insights may be slightly delayed.</p><p>· <strong>Reporting Interval :</strong> Utilization data is collected at a one-minute interval, which may not capture very short-lived query execution patterns.</p><p>· <strong>Inactive Clusters:</strong> The view does not provide utilization data for clusters that are currently inactive or have been inactive for an extended period.</p><p>· <strong>Short-Running Queries:</strong> Utilization metrics might be less reliable for clusters with a high proportion of very short-running queries (typically under 100 milliseconds). These queries can introduce noise into the overall utilization calculation.</p><p>· <strong>Data Availability:</strong> Data for the number of queries running is available starting from July 15, 2024.</p><h3><strong>Few live Examples:</strong></h3><p>By applying real-world scenarios, users can better understand how the WAREHOUSE_CLUSTER_UTILIZATION view provides actionable insights for optimizing their Snowflake environment. Here are some practical examples</p><ol><li><strong>Warehouse Cluster utilization by query concurrency:</strong> This can help you understand how warehouse Cluster utilization changes with the number of concurrent queries, which can be useful for optimizing number of clusters, warehouse sizing and query concurrency settings.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*nHEFr0EyBXy-jGxYwFkEtA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*Us2yJ0vZMOF_vqLnm6nQfA.png" /></figure><p><strong>2.</strong> <strong>Warehouse cluster Idle time and active time for the specific time period</strong>: This can help you understand the idle time and percentage of Idle time for each warehouse cluster in a Snowflake account. It filters the data for the past 7 days and groups the results by warehouse name and cluster number. The output includes the warehouse name, cluster number, start date, idle minutes, total minutes, and idle percentage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*9ql1yH-T8tdqZFHILQFVgg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*0_KPMZEz6uEW_5lNEGqwWw.png" /></figure><p>By utilizing these insights, organizations can proactively manage their Snowflake resources, ensuring optimal performance and cost-effectiveness. The WAREHOUSE_CLUSTER_UTILIZATION view serves as a powerful tool to guide strategic decisions related to warehouse scaling, query performance, and resource allocation.</p><h3><strong>Conclusion:</strong></h3><p>Snowflake’s Warehouse_cluster_utilization feature offer valuable insights for organizations seeking to optimize resource consumption and reduce costs. By providing detailed metrics on warehouse and cluster utilization, this feature enable users to make data-driven decisions about resource allocation, query optimization, and cost management. Through effective analysis and application of these features, organizations can enhance system performance, reduce expenses, and ensure efficient resource utilization within their Snowflake environments.</p><h3><strong>About the Author</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/112/1*BbXwKeBbcHqiLd8ub9sZpQ.jpeg" /></figure><p><strong>Karthik Srinivasan Raman</strong> | <strong>Head of Snowflake Tech Consulting</strong> | <strong>LTIMindtree</strong></p><p>Karthik currently serves as the Head of the Snowflake Tech Consulting group at LTIMindtree. With over 21 years of expertise in the data sector, he has extensive experience in Data Architecture, Data Modeling, Data Modernization &amp; Technology consulting for customers across the globe. In his leisure time, Karthik enjoys spending time with his family. He is also a passionate supporter of Manchester United Football Club, ensuring that his weekends are never complete without watching his beloved team play.</p><p><a href="https://www.linkedin.com/in/karthik-s-raman">www.linkedin.com/in/karthik-s-raman</a></p><p><a href="https://medium.com/@karthiksraman">https://medium.com/@karthiksraman</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42fe3aeafef8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Harnessing the Power of QUERY_ATTRIBUTION_HISTORY: A Snowflake Deep Dive]]></title>
            <link>https://medium.com/@karthiksraman/harnessing-the-power-of-query-attribution-history-a-snowflake-deep-dive-0910cbd2f2eb?source=rss-e1874d59421f------2</link>
            <guid isPermaLink="false">https://medium.com/p/0910cbd2f2eb</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[snowflake-cost-management]]></category>
            <category><![CDATA[query-optimization]]></category>
            <dc:creator><![CDATA[Karthik S Raman]]></dc:creator>
            <pubDate>Thu, 19 Sep 2024 17:24:29 GMT</pubDate>
            <atom:updated>2024-09-19T17:24:29.480Z</atom:updated>
            <content:encoded><![CDATA[<h4>Introduction</h4><p><strong>Queries are the backbone of data processing and analysis in Snowflake.</strong> Understanding the cost associated with each query is essential for organizations to optimize their resource utilization and control expenses. By identifying Resource intensive queries, organizations can pinpoint areas where performance improvements can be made. This knowledge enables them to refine query execution plans, leverage indexing strategies, and optimize warehouse sizing, ultimately reducing costs and enhancing query performance. Moreover, cost per query analysis provides valuable insights into the resource consumption patterns of different workloads, facilitating informed decision-making regarding resource allocation and capacity planning.</p><p>Traditionally, calculating the exact cost of a single query in Snowflake has been a complex endeavour due to several factors. Snowflake’s pay-as-you-go pricing model, where users are charged based on resource consumption, introduces challenges in isolating the specific costs attributed to individual queries. The platform’s dynamic infrastructure, which scales resources up or down according to workload demands, further complicates cost attribution. Additionally, the potential for concurrent query execution and the sharing of resources among multiple queries can make it difficult to pinpoint the precise cost associated with a particular query. These complexities have necessitated the development of sophisticated methodologies and tools to estimate and approximate query costs, providing users with valuable insights for optimizing their Snowflake environments.</p><h4><strong>New Feature in GA — Per query cost attribution</strong></h4><p>Snowflake’s new feature in GA, per query cost attribution, addresses the longstanding challenge of calculating the cost per query by providing a granular and accurate method for attributing warehouse compute costs to individual SQL queries. This feature introduces the QUERY_ATTRIBUTION_HISTORY view, which tracks query-specific costs. This allows users to accurately measure and analyze the resource consumption of their queries, enabling more effective cost management and optimization.</p><h4><strong>Cost Per Query:</strong></h4><p>In the realm of Snowflake, understanding the cost per query is paramount for optimizing resource utilization and minimizing expenses. The cost per query represents the warehouse credits consumed specifically for executing a given SQL query. By providing a granular view of resource demands, it enables users to make informed decisions about query optimization and cost management.</p><h4><strong>Key Points to Note:</strong></h4><p>To effectively manage and optimize query costs, consider the following important aspects:</p><ul><li><strong>Granular Cost Attribution:</strong> The cost per query provides a precise measurement of the resources consumed by a specific query, allowing for targeted optimization efforts.</li><li><strong>Exclusions:</strong> The cost per query does not include additional costs incurred during query execution, such as data transfer, storage, cloud services, or serverless feature costs. This ensures a focused view of query-specific expenses.</li><li><strong>Concurrent Query Attribution:</strong> For concurrently executing queries, the cost is distributed among them based on their relative resource consumption, providing a fair allocation of costs.</li><li><strong>Idle Time Exclusion:</strong> Warehouse idle time, when no queries are running, is not included in the cost per query calculation. This helps to isolate the costs directly attributable to query execution.</li></ul><h4><strong>QUERY_ATTRIBUTION_HISTORY (New feature in GA): A Deep Dive into Snowflake Query Costs</strong></h4><p>Snowflake’s new feature in GA, per query cost attribution, addresses the longstanding challenge of calculating the cost per query by providing a granular and accurate method for attributing warehouse compute costs to individual SQL queries. This feature introduces the QUERY_ATTRIBUTION_HISTORY view, which tracks query-specific costs. This allows users to accurately measure and analyze the resource consumption of their queries, enabling more effective cost management and optimization.</p><p>The QUERY_ATTRIBUTION_HISTORY view in Snowflake is a valuable tool for gaining insights into the cost of individual queries executed within your account. It provides detailed information about the resource consumption of each query, enabling you to optimize performance and manage costs effectively.</p><p><strong>Key Columns and Their Significance:</strong></p><ul><li><strong>query_id:</strong> A unique identifier for the SQL statement.</li><li><strong>parent_query_id:</strong> The ID of the parent query, if applicable.</li><li><strong>root_query_id:</strong> The ID of the topmost query in the query chain.</li><li><strong>warehouse_id:</strong> The internal ID of the warehouse where the query was executed.</li><li><strong>warehouse_name:</strong> The name of the warehouse where the query was executed.</li><li><strong>query_hash, query_parameterized_hash:</strong> Hash values derived from the SQL text, potentially used for caching or optimization.</li><li><strong>query_tag:</strong> A user-defined label for the query.</li><li><strong>user_name:</strong> The user who executed the query.</li><li><strong>start_time:</strong> The time when query execution began.</li><li><strong>end_time:</strong> The time when query execution ended.</li><li><strong>credits_attributed_compute, credits_used_query_acceleration: </strong>Metrics related to the computational cost of the query, including credits consumed for query execution and acceleration services.</li></ul><h4><strong>Leveraging the View for Cost Analysis</strong></h4><p>To fully benefit from the QUERY_ATTRIBUTION_HISTORY view, consider the following strategies for cost analysis:</p><ul><li><strong>Identify Expensive Queries:</strong> Pinpoint queries that consume significant resources and contribute to higher costs.</li><li><strong>Analyze Query Performance:</strong> Evaluate the efficiency of queries and identify areas for optimization.</li><li><strong>Track Cost Trends:</strong> Monitor changes in query costs over time to identify potential issues or improvements.</li><li><strong>Optimize Resource Allocation:</strong> Make informed decisions about warehouse sizing and resource allocation based on query costs.</li></ul><h4><strong>Important Considerations:</strong></h4><p>When using the QUERY_ATTRIBUTION_HISTORY view, keep the following factors in mind:</p><ul><li><strong>Latency:</strong> The QUERY_ATTRIBUTION_HISTORY view may have a latency of up to six hours.</li><li><strong>Role Requirements:</strong> You must have the USAGE_VIEWER database role to access this view.</li><li><strong>Short-Running Queries:</strong> Queries that are shorter than approximately 100 milliseconds may not be included in the view due to the current limitations of per query cost attribution.</li></ul><p>By effectively utilizing the QUERY_ATTRIBUTION_HISTORY view, you can gain valuable insights into your Snowflake query costs and make data-driven decisions to optimize your environment.</p><h4><strong>Few live Examples:</strong></h4><p>By applying real-world scenarios, users can see how the QUERY_ATTRIBUTION_HISTORY view provides actionable insights. For instance:</p><ol><li>R<strong>ecurrent Query Costs:</strong> To track the costs associated with recurring or similar queries, you can leverage QUERY_PARAMETERIZED_HASH. For a detailed breakdown of costs over time, consider grouping your queries by QUERY_PARAMETERIZED_HASH. This will help you identify the top cost drivers and optimize your query performance.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*r9Iz1r3zZMk7_i-pWsHI3A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*D-7YCxWHmRquzRfw9t5_tQ.png" /></figure><p><strong>2.</strong> <strong>Query Cost by User:</strong> To gain insights into user-specific costs, consider analyzing the QUERY_ATTRIBUTION_HISTORY view. By examining the USER_NAME column, you can allocate costs to individual users, facilitating responsibility, financial planning, and more precise predictions. This analysis can also identify users who are particularly adept at utilizing Snowflake.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*53fLWBlMHaG7ojXSH9g4WQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*iEPyzqifv9EmdY5-VRFZWg.png" /></figure><h4><strong>Conclusion</strong></h4><p>By leveraging the QUERY_ATTRIBUTION_HISTORY view, Snowflake users can now gain a deeper understanding of query costs and optimize their Snowflake environments. This powerful tool provides granular insights into resource consumption, enabling users to identify expensive queries, analyze query performance, track cost trends, and make informed decisions about warehouse sizing and resource allocation. With the ability to pinpoint areas for improvement, Snowflake users can effectively reduce costs and enhance query performance, ultimately maximizing the value of their Snowflake investments.</p><h4><strong>About the Author</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/112/1*BbXwKeBbcHqiLd8ub9sZpQ.jpeg" /></figure><p><strong>Karthik Srinivasan Raman</strong> | <strong>Head of Snowflake Tech Consulting</strong> | <strong>LTIMindtree</strong></p><p>Karthik currently serves as the Head of the Snowflake Tech Consulting group at LTIMindtree. With over 21 years of expertise in the data sector, he has extensive experience in Data Architecture, Data Modeling, Data Modernization &amp; Technology consulting for customers across the globe. In his leisure time, Karthik enjoys spending time with his family. He is also a passionate supporter of Manchester United Football Club, ensuring that his weekends are never complete without watching his beloved team play.</p><p><a href="https://www.linkedin.com/in/karthik-s-raman">www.linkedin.com/in/karthik-s-raman</a></p><p><a href="https://medium.com/@karthiksraman">https://medium.com/@karthiksraman</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0910cbd2f2eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Snowflake Warehouse Utilization: A Deep Dive into the WAREHOUSE_UTILIZATION View]]></title>
            <link>https://medium.com/snowflake/mastering-snowflake-warehouse-utilization-a-deep-dive-into-the-warehouse-utilization-view-855fa72fdf11?source=rss-e1874d59421f------2</link>
            <guid isPermaLink="false">https://medium.com/p/855fa72fdf11</guid>
            <category><![CDATA[cost-optimization]]></category>
            <category><![CDATA[warehouse-management]]></category>
            <category><![CDATA[snowflake-data-cloud]]></category>
            <dc:creator><![CDATA[Karthik S Raman]]></dc:creator>
            <pubDate>Thu, 29 Aug 2024 15:58:37 GMT</pubDate>
            <atom:updated>2024-11-01T23:39:39.741Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Introduction</strong></h3><p>In the quest for optimizing resource management and cost efficiency, understanding warehouse utilization is paramount for organizations leveraging Snowflake. Accurate tracking provides valuable insights into resource consumption patterns, enabling effective cost optimization. By identifying periods of low utilization, organizations can adjust warehouse sizes or suspend them during off-peak hours, significantly reducing costs. Moreover, tracking warehouse utilization helps in capacity planning, ensuring that sufficient resources are available to meet future workload demands while avoiding unnecessary overprovisioning. Additionally, analyzing utilization data can reveal bottlenecks and inefficient query patterns, allowing for targeted optimization efforts and improved performance.</p><h3><strong>Warehouse Utilization Metrics in Snowflake</strong></h3><p>Snowflake provides comprehensive utilization metrics to help you monitor and optimize your warehouse performance. These metrics offer insights into warehouse idle time, query load, spillage to remote storage, and overall resource consumption. By analyzing these data points, you can make well-informed decisions regarding warehouse sizing, auto-suspend settings, and consolidation strategies, optimizing both performance and cost efficiency.</p><h3><strong>WAREHOUSE_UTILIZATION View: New Feature - Currently in Private Preview</strong></h3><p>The <strong>WAREHOUSE_UTILIZATION</strong> view, now available in Snowflake’s Account Usage schema, offers a detailed look into the resource consumption of individual warehouses or clusters. By offering a comprehensive breakdown of utilization metrics over the past 365 days, this view empowers users to optimize performance, manage costs, and ensure efficient resource allocation.</p><h4><strong>Key Features</strong></h4><p><strong>Time-Based Analysis:</strong> The view presents utilization data for a specified time window, typically the last year, enabling users to track trends and identify patterns.</p><p><strong>Granular Level:</strong> It provides metrics at the warehouse level, allowing for detailed analysis of individual resource performance.</p><p><strong>Comprehensive Metrics:</strong> The view includes the following key metrics:</p><ul><li><strong>Start Time:</strong> The beginning of the utilization time window.</li><li><strong>End Time:</strong> The end of the utilization time window.</li><li><strong>Warehouse ID:</strong> A unique identifier for the warehouse.</li><li><strong>Warehouse Name:</strong> The user-friendly name of the warehouse.</li><li><strong>Utilization:</strong> A percentage value indicating the level of resource utilization, ranging from 0 (idle) to 100 (fully utilized).</li><li><strong>Number of Queries Running:</strong> The count of queries executing during the specified time period.</li></ul><h4><strong>Benefits and Applications</strong></h4><p>The WAREHOUSE_UTILIZATION view offers a range of benefits that enhance operational efficiency and cost-effectiveness:</p><ul><li><strong>Performance Optimization:</strong> By identifying underutilized or overloaded warehouses, users can optimize resource allocation and improve overall system performance.</li><li><strong>Cost Management:</strong> Understanding warehouse utilization patterns can help organizations effectively manage their Snowflake costs by ensuring that resources are allocated efficiently.</li><li><strong>Capacity Planning:</strong> The view provides valuable data for forecasting future resource needs and planning for capacity expansions.</li><li><strong>Troubleshooting:</strong> It can be used to identify potential performance bottlenecks or issues related to warehouse utilization.</li><li><strong>Compliance:</strong> The view can assist in compliance efforts by providing data on resource usage and utilization patterns.</li></ul><h4><strong>Considerations and Limitations</strong></h4><p>While the WAREHOUSE_UTILIZATION view is a valuable tool, users should be aware of certain considerations and limitations:</p><ul><li><strong>Latency:</strong> The view might have a latency of up to 360 minutes (6 hours), meaning the data may be up to 6 hours old.</li><li><strong>Reporting Interval:</strong> Utilization data is reported at a 60-second (1-minute) interval, which may not capture very short-lived query execution patterns.</li><li><strong>Short-Running Queries:</strong> The utilization metric may not be reliable for warehouses with a significant proportion of short-running queries (&lt;= ~100ms).</li><li><strong>Warehouse State Changes:</strong> If a warehouse is resumed or suspended during a reporting period, the utilization value may not accurately reflect the overall usage for that period.</li><li><strong>Data Availability:</strong> The number_of_queries_running column is available starting from July 15, 2024.</li></ul><h3><strong>Few live Examples:</strong></h3><p>By applying real-world scenarios, users can see how the WAREHOUSE_UTILIZATION view provides actionable insights. For instance:</p><p>1. <strong>Warehouse utilization by query concurrency</strong>: This can help you understand how warehouse utilization changes with the number of concurrent queries, which can be useful for optimizing warehouse sizing and query concurrency settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*xbpO85ULoMOh3vAYqnm0Cg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*k1oCzeI0Ip3eK3aZwS77rw.png" /></figure><p><strong>2.</strong> <strong>Warehouse Idle time and active time for the specific time period</strong>: This can help you understand the idle time and percentage of Idle time for each warehouse in a Snowflake account. It filters the data for the past 7 days and groups the results by warehouse name. The output includes the warehouse name, start date, idle minutes, total minutes, and idle percentage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*rlUiuXpiv2P8eo6S2KMHIw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*rJ8uu3PPEeRp-3K9k0eY1Q.png" /></figure><h3><strong>How to Optimize Your Warehouses Using Utilization Metrics</strong></h3><p>Now, Using above metrics, you can make data-driven decisions about warehouse configurations and operations.</p><h4><strong>Adjusting Auto-Suspend Settings:</strong></h4><ul><li><strong>Idle Time:</strong> Calculate idle time using the provided query to determine if a warehouse is frequently suspended.</li><li><strong>Auto-Suspend Property:</strong> Set the auto-suspend property to a low value (e.g., 60 seconds) if idle time is significant and query performance is not critical. Set it to a few minutes (e.g., 2–5 minutes) if query performance is important.</li></ul><h4><strong>Resizing Warehouses:</strong></h4><ul><li><strong>Low Utilization:</strong> Consider downsizing or reducing clusters if utilization is consistently low (for example, &lt; 1) and there’s no spillage.</li><li><strong>High Utilization:</strong> Consider upsizing the warehouse if utilization is high (for example, &gt; 75%) and there’s spillage to remote or local storage.</li></ul><h4><strong>Consolidating Warehouses:</strong></h4><ul><li><strong>Outlier Queries:</strong> Move outlier queries to a new warehouse if they have similar resource needs.</li><li><strong>Moderately Utilized Warehouses:</strong> Consolidate similar workloads into a single multi-cluster or standard warehouse.</li><li><strong>Ad-Hoc Queries:</strong> Consider a common ad-hoc warehouse for multiple teams to improve efficiency.</li></ul><h4><strong>Adjusting Multi-Cluster Warehouse Settings:</strong></h4><ul><li><strong>Scaling Policy:</strong> Adjust the scaling policy (economy or standard) based on median utilization and queuing.</li><li>If the median utilization is low: changing the scaling policy to economy</li><li>If utilization is high (for example, &gt; 70%) : Snowflake recommends leaving it set to standard</li></ul><h4><strong>Additional Considerations</strong></h4><ul><li><strong>Comprehensive Analysis:</strong> Use multiple metrics from QUERY_HISTORY and WAREHOUSE_LOAD_HISTORY for a deeper understanding of warehouse usage.</li><li><strong>Optimize Queries:</strong> Improve query performance to reduce resource consumption and improve utilization.</li><li><strong>Leverage Snowflake Features:</strong> Utilize features like Clustering, SOS, time travel, and Query Acceleration Service (QAS) for optimization.</li></ul><h3><strong>Conclusion:</strong></h3><p>In Conclusion, Snowflake’s Warehouse Utilization feature (currently in Private Preview) offers a comprehensive solution for optimizing resource consumption and reducing costs. By providing detailed insights into warehouse usage patterns, it empowers users to make data-driven decisions regarding auto-suspend settings, warehouse sizing, consolidation, and multi-cluster scaling. This ultimately leads to improved efficiency and reduced expenses, making Warehouse Utilization an invaluable tool for organizations seeking to maximize the return on their Snowflake investment.</p><h3>About the Author</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/112/1*BbXwKeBbcHqiLd8ub9sZpQ.jpeg" /></figure><p><strong>Karthik Srinivasan Raman</strong> | <strong>Head of Snowflake Tech Consulting</strong> | <strong>LTIMindtree</strong></p><p>Karthik currently serves as the Head of the Snowflake Tech Consulting group at LTIMindtree. With over 21 years of expertise in the data sector, he has extensive experience in Data Architecture, Data Modeling, Data Modernization &amp; Technology consulting for customers across the globe. In his leisure time, Karthik enjoys spending time with his family. He is also a passionate supporter of Manchester United Football Club, ensuring that his weekends are never complete without watching his beloved team play.</p><p><a href="https://www.linkedin.com/in/karthik-s-raman">www.linkedin.com/in/karthik-s-raman</a></p><p><a href="https://medium.com/@karthiksraman">https://medium.com/@karthiksraman</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=855fa72fdf11" width="1" height="1" alt=""><hr><p><a href="https://medium.com/snowflake/mastering-snowflake-warehouse-utilization-a-deep-dive-into-the-warehouse-utilization-view-855fa72fdf11">Mastering Snowflake Warehouse Utilization: A Deep Dive into the WAREHOUSE_UTILIZATION View</a> was originally published in <a href="https://medium.com/snowflake">Snowflake Builders Blog: Data Engineers, App Developers, AI, &amp; Data Science</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>