<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>SQL BI</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/karang/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/karang/feed.xml</link>
    <description>My Experience - Troubleshooting SQL BI Stack</description>
    <lastBuildDate>Sun, 18 Nov 2018 10:56:49 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Azure Data Factory V2– Pipeline Functional Testing</title>
      <link>https://docs.microsoft.com/archive/blogs/karang/azure-data-factory-v2-pipeline-functional-testing</link>
      <pubDate>Sun, 18 Nov 2018 09:59:40 GMT</pubDate>
      <dc:creator><![CDATA[Karan Gulati (SSAS Maestro)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/karang/?p=1515</guid>
      <description><![CDATA[This article helps you to understand functional testing with pipelines in Azure Data...]]></description>
      <content:encoded><![CDATA[This article helps you to understand functional testing with pipelines in Azure Data Factory.

<span style="text-decoration: underline"><strong>Note:-</strong></span>

This article applies to Azure Data Factory V2.

This article assumes that you have gone through <a href="https://docs.microsoft.com/en-us/azure/data-factory/introduction">Introduction to Azure Data Factory</a> and the <a href="https://docs.microsoft.com/en-us/azure/data-factory/quickstart-create-data-factory-powershell">QuickStart Tutorial</a>.

<strong>Credits -</strong> Thanks to ADFv2 Product Group <span style="float: none;background-color: #ffffff;color: #333333;cursor: text;font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size: 16px;font-style: normal;font-variant: normal;font-weight: 400;letter-spacing: normal;text-align: left;text-decoration: none;text-indent: 0px">(</span><span>Anudeep Sharma, Hermine Vermishyan &amp; Abhishek Narain ) </span> for reviewing and all assistance with my ADFv2 <span>and my partner in awesomeness David Kuo for testing the script</span>

<b>Overview</b>

During development phase of an Azure Data Factory pipeline you have a debugging functionality in UX which you can use to debug a pipeline and find out if anything is failing due to reasons like incorrect connection string, object not present in database, wrong query, etc.

Keeping same idea in mind I have extended the functionality of debugging from pipelines' development stage to release stage, where you can use PowerShell script to perform pipelines' functional testing in Test or Integration or UAT environment ensuring all issues are caught at that stage instead of hitting in Production environment and in this article series will share the process of achieving same with PowerShell script and good news is that you can use same script in your environment without making any code change.

<b>Concept</b>

Function test with ADF can be used to validate if pipeline is working and if anything related to functionality is failing then stop release, fix issue and iterate. It's more aligned with build verification ensuring objects like linked service, tables, storage, etc. which are required for a pipeline are successfully validated before releasing to production environment.

<b>Scope</b>

Testing functionality of pipelines ensuring configurations like databases, server, storage, etc. are configured correctly and pipeline is not failing due to misconfiguration like database not exist or something on same lines. Errors due to data quality, performance or anything related to data sanctity is outside the scope of functional testing.

<b>How it Works </b>

Let's go in details of understanding working of functional testing with ADFv2.

First of all you need to understand how debugging works in pipeline and good news is that there is very informative video done by Gaurav Malhotra from ADF team (highly recommended if you want to get insight of pipeline debugging): <a href="https://azure.microsoft.com/en-us/blog/iteratively-develop-and-debug-your-etl-elt-workflows-using-data-factory/">Iterative development and debugging using Data Factory</a>

As you have seen in this video that for debugging you need to run a pipeline and for running a pipeline it requires parameters defined for your pipeline and run the pipeline in debug mode with an output showing whether pipeline succeeded or failed, keeping same approach in mind I attempted to write this functionality with following flow:-

<b>Functional Testing Flow: -</b>

<a href="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image0022.jpg"><img width="244" height="64" title="clip_image002" style="margin: 0px" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image002_thumb1.jpg" border="0" /></a>

Now let's look into each step in this flow:-

1. Azure Active Directory (AAD) Authentication - AAD is required for silent authentication of PowerShell script which is used during automation of testing and PowerShell script needs to access Azure Data Factory for getting list of pipelines so we need to ensure Application ID should also have access to Azure Data Factory. There are few handy articles which you can follow for creating Application ID mentioned as follow:-

a. <a href="https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal">How to create an AAD application and service principal </a>

b. How to give access to Application ID

i. Go to Azure Data Factory in Azure Portal

ii. Under All settings select Users and click Add as shown in following figure: -

<b><u>Settings: -</u></b>

<a href="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image0041.jpg"><img width="234" height="244" title="clip_image004" style="margin: 0px" alt="clip_image004" src="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image004_thumb1.jpg" border="0" /></a>

iii. After hitting Add it will open another windows which will allow you to add Application ID which you had crated in Step1, as there is need of only getting list of pipelines so we are making Application member of Reader Role as shown in following figure where Application name is FunctionalTesting and added member of <b>Reader Role:- </b>

<a href="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image0061.jpg"><img width="244" height="191" title="clip_image006" style="margin: 0px" alt="clip_image006" src="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image006_thumb1.jpg" border="0" /></a>

iv. In PowerShell we will be leveraging Application ID for silent authentication and its recommended to use Key Vault for pulling secrets in this case we need a Application ID secret (password), in PowerShell I have parameterized secret field so you can either pass it as plain text or make a call to Key Vault during release process and pass along the secret. Code snippet as follow in which we are doing silent authentication using Application ID which is also knowns as Service Principal, you can refer this article for getting <a href="https://support.office.com/en-us/article/find-your-office-365-tenant-id-6891b561-a52d-4ade-9f39-b492285e2c9b">TenantID </a>

<a href="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image0081.jpg"><img width="244" height="51" title="clip_image008" style="margin: 0px" alt="clip_image008" src="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image008_thumb1.jpg" border="0" /></a>

2. Functional Testing Logic -

a. Get list of Pipeline from ADF

<a href="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image0101.jpg"><img width="244" height="16" title="clip_image010" style="margin: 0px" alt="clip_image010" src="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image010_thumb1.jpg" border="0" /></a>

b. Check for Pipeline Exclusion

<a href="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image009.png"><img width="244" height="16" title="clip_image009" style="margin: 0px" alt="clip_image009" src="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image009_thumb.png" border="0" /></a>

Example of exclusion file:-

<a href="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image012.jpg"><img width="244" height="34" title="clip_image012" style="margin: 0px" alt="clip_image012" src="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image012_thumb.jpg" border="0" /></a>

c. Pipeline Test file - Following is an example of test file, in my case I have a pipeline named as pl-testValidation in data factory and that pipeline expects a parameter known as SubFolder, I need to ensure then I am creating a parameter file with respect to my pipeline which will be used a functional test file by testing logic, also need to ensure that test file name matches with the pipeline name and should have all parameters stated in a pipeline, and if this file is missing then it will be marked as failed with missing test file

Example of test file as the pipeline name is pl-testValidation so I have created test file as pl-testValidation.json (PipelineName.json) with a parameter consumed by pipeline and TestTimeout value as I want to run this test for 80 seconds, if I will miss this value then it will default to 30 seconds.

<a href="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image0141.jpg"><img width="244" height="56" title="clip_image014" style="margin: 0px" alt="clip_image014" src="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image014_thumb1.jpg" border="0" /></a>

d. In following code if you notice we are iterating through pipelines and checking if PipelineName.json exist and also checking what is the TestTimeout value if missing then defaulting it to 30 seconds.

<a href="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image0161.jpg"><img width="244" height="108" title="clip_image016" style="margin: 0px" alt="clip_image016" src="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image016_thumb1.jpg" border="0" /></a>

e. Running Pipeline test by using following command

<a href="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image0181.jpg"><img width="244" height="12" title="clip_image018" style="margin: 0px" alt="clip_image018" src="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image018_thumb1.jpg" border="0" /></a>

f. Using value of $runId to get current status (refer <a href="https://github.com/karanspeaks/adfv2samplecode/tree/master/adfv2functionaltest">GIT</a> - PS script for full code)

<a href="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image020.jpg"><img width="244" height="49" title="clip_image020" style="margin: 0px" alt="clip_image020" src="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image020_thumb.jpg" border="0" /></a>

g. Using value of $runId to get status (refer <span style="float: none;background-color: #ffffff;color: #333333;cursor: text;font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size: 16px;font-style: normal;font-variant: normal;font-weight: 400;letter-spacing: normal;text-align: left;text-decoration: none;text-indent: 0px"> </span><a href="https://github.com/karanspeaks/adfv2samplecode/tree/master/adfv2functionaltest">GIT</a><span style="float: none;background-color: #ffffff;color: #333333;cursor: text;font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size: 16px;font-style: normal;font-variant: normal;font-weight: 400;letter-spacing: normal;text-align: left;text-decoration: none;text-indent: 0px"> </span>- PS script for full code)

<a href="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image021.jpg"><img width="244" height="48" title="clip_image021" style="margin: 0px" alt="clip_image021" src="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image021_thumb.jpg" border="0" /></a>

h. Fail test if it exceeds timeout setting

<a href="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image023.jpg"><img width="244" height="39" title="clip_image023" alt="clip_image023" src="https://msdnshared.blob.core.windows.net/media/2018/11/clip_image023_thumb.jpg" border="0" /></a>

i.If you are integrated with Release Manager then it will generate exception in-case of failure resulting in failed release and give an output of failed pipelines which needs to be fixed before deploying to production environment but don’t be dis-heartened you can still code even though you are not using Release Manager by using following command.

.\AzureDatafactoryFunctionalTesting.ps1 -dataFactoryName "Your Factory Name" -resourceGroupName "Factory Resource Group Name" -azureSubscription "Subscription ID" -applicationSecret "Application Secret from Point 1" -applicationID "Application ID from Point 1" -tenantID "Tenant ID from Point 1" -excludedPipelinesFilePath ".\" -functionalTestJsonFilePath ".\"

<b>Conclusion</b>

As you have seen in this article I have gone through step by step of achieving functional testing with ADFv2 and in subsequent article I will be discussing more about how to integrate same with <strong>Release Manager</strong> so that you can have this testing framework as a part of Pipeline Release process to Production.

<strong>Code Location</strong>

<span><a href="https://github.com/karanspeaks/adfv2samplecode/tree/master/adfv2functionaltest">Git</a></span> – feel free to download and contribute

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>ADF - Azure Data Factory Learning Path</title>
      <link>https://docs.microsoft.com/archive/blogs/karang/adf-azure-data-factory-learning-path</link>
      <pubDate>Wed, 10 May 2017 23:08:38 GMT</pubDate>
      <dc:creator><![CDATA[Karan Gulati (SSAS Maestro)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/karang/?p=1235</guid>
      <description><![CDATA[If you are looking to learn Azure Data Factory (ADF) it’s a good path to start, as it covers various...]]></description>
      <content:encoded><![CDATA[<p>If you are looking to learn Azure Data Factory (ADF) it’s a good path to start, as it covers various components of ADF like all kind of supported flows with code samples. <p>I would suggest to start with Portal as you don’t require any coding experience on same and if you are coming from DevOps or DBA background then you can follow PowerShell path, further if you are coming from pure development background then you can use APIs provided by ADF through Nugget. <p>Here is link of learning path:-<br><a href="https://azure.microsoft.com/en-us/documentation/learning-paths/data-factory/">https://azure.microsoft.com/en-us/documentation/learning-paths/data-factory/</a> <p>Following link shows how Microsoft Studios (XBOX) team is using Azure Data Factory:-<br><a href="https://channel9.msdn.com/Blogs/raw-tech/Halo-Minecraft-and-More-How-Microsoft-Studios-Processes-Gaming-Event-Data">https://channel9.msdn.com/Blogs/raw-tech/Halo-Minecraft-and-More-How-Microsoft-Studios-Processes-Gaming-Event-Data</a> <p>Happy Learning</p>]]></content:encoded>
    </item>
    <item>
      <title>SQLDW: Could not allocate a new page for database</title>
      <link>https://docs.microsoft.com/archive/blogs/karang/sqldw-could-not-allocate-a-new-page-for-database</link>
      <pubDate>Thu, 16 Feb 2017 07:15:56 GMT</pubDate>
      <dc:creator><![CDATA[Karan Gulati (SSAS Maestro)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/karang/?p=1225</guid>
      <description><![CDATA[Issue:  Recently I faced an issue where Stored Procedure running on SQLDW failing with error as...]]></description>
      <content:encoded><![CDATA[<p><strong>Issue:</strong>  <p>Recently I faced an issue where Stored Procedure running on SQLDW failing with error as follow  <p>An error occurred in Stored Procedure Activity execution. Diagnostic details: Database operation failed on server ‘xxxyyyy123.centralus1-a.worker.database.windows.net,11087' with SQL Error Number '1101'. Error message from database execution :<strong> Could not allocate a new page for database 'Distribution_11' because of insufficient disk space in filegroup</strong> 'PRIMARY'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.</p> <p>&nbsp;</p> <p><strong>Resolution:</strong></p> <p>After working with SQLDW Support team found that issue can occur when you hit max size of the database which is by default 10TB(if not stated while creating a database) and it can be resolved by increasing the size of database using following command:-</p> <p><font color="#0000ff">ALTER DATABASE [SQLDWDB] MODIFY ( MAXSIZE=245760 GB );</font> <p>In this case I set it to 240 TB but you can size it based on your requirement. <p><strong>Note:</strong>  <p>Before you run these examples, make sure the database you are altering is not the current database. The current database must be a different database than the one you are altering, therefore <strong>ALTER must be run while connected to the master database.</strong>  <p><strong></strong>&nbsp; <p><strong></strong></p> <p><strong>Credits:</strong></p> <p>P V Suhas from SQLDW Support Team</p>]]></content:encoded>
    </item>
    <item>
      <title>HDInsight: How to find Long Running Queries</title>
      <link>https://docs.microsoft.com/archive/blogs/karang/hdinsight-how-to-find-a-long-running-jobs-2-2-2</link>
      <pubDate>Wed, 25 Jan 2017 09:40:00 GMT</pubDate>
      <dc:creator><![CDATA[Karan Gulati (SSAS Maestro)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/karang/?p=1215</guid>
      <description><![CDATA[Coming from SQL background where you have dependency on SQL Profiler Trace for understanding what’s...]]></description>
      <content:encoded><![CDATA[<p>Coming from SQL background where you have dependency on SQL Profiler Trace for understanding what’s going on SQL Server like who is running non optimized long query, where its scanning through all partitions and yes who is using non indexed columns for filter right? So coming to HDInsight world wondering do we have something like SQL Profiler for tracking bad jobs – Yes we do, as a part of Apache Ambari Project – (as per wiki) Whole objective of Ambari is to make Hadoop management easy by providing a mechanism of managing or monitoring Hadoop&nbsp; clusters with it's easy to use&nbsp; UI, in this Post I will show how to use Ambari for getting long running or resource intensive jobs.</p> <p><strong>Objective: How to find long running or resource intensive Hive query? <br></strong>Steps:-</p> <ul> <li>Open following link of HDInsight Cluster (<a href="https://%3cHDInsightClusterName%3e.azurehdinsight.net/">https://&lt;HDInsightClusterName&gt;.azurehdinsight.net/</a> )  <ul> <li>Enter username (admin) and password  <li>Successful login will open Ambari dashboard which looks something like this:- </li></ul></li></ul> <p><a href="https://msdnshared.blob.core.windows.net/media/2017/01/clip_image00142.png"><img title="clip_image001[4]" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="clip_image001[4]" src="https://msdnshared.blob.core.windows.net/media/2017/01/clip_image0014_thumb1.png" width="755" height="462"></a></p> <p>&nbsp;</p> <ul> <li>Click Yarn &gt; Quick Links &gt; Active Head Node &gt;&gt;Resource Manager UI </li></ul> <p><a href="https://msdnshared.blob.core.windows.net/media/2017/01/clip_image00251.png"><img title="clip_image002[5]" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="clip_image002[5]" src="https://msdnshared.blob.core.windows.net/media/2017/01/clip_image0025_thumb.png" width="772" height="455"></a></p> <p>Or if you don’t want to go through the whole hassle just type <a href="https://%3cHDInsightClusterName%3e.azurehdinsight.net/yarnui/hn/cluster">https://&lt;HDInsightClusterName&gt;.azurehdinsight.net/yarnui/hn/cluster</a>, in popup provide security information admin and its password - and it would open Resource Manager - it provides you all information about jobs (running/pending/finished/etc.) on HDI cluster</p> <ul> <li>In following screenshot - you can notice multiple options for checking Jobs like in this case I have this specific job which is consuming:-  <ul> <li>A - Memory - 2.2 TB  <li>B - % of Queue - 64%  <li>C - % of Cluster - 60% </li></ul></li></ul> <p><a href="https://msdnshared.blob.core.windows.net/media/2017/01/image685.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/01/image_thumb599.png" width="786" height="199"></a></p> <ul> <li>In this case filtered job may be problem making query which is causing other jobs to wait in queue as its consuming 60% of resource and 2.2 TB of total 3.75TB allocated for this cluster. I can further look into job by clicking into job id (Job ID &gt; Logs and Pull query from there dag) and check how's query look like and what's its doing under the hood - is it scanning TBs of partitions or filtering on non-partitioned fields or what. </li></ul> <p><a href="https://msdnshared.blob.core.windows.net/media/2017/01/clip_image0047.png"><img title="clip_image004" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="clip_image004" src="https://msdnshared.blob.core.windows.net/media/2017/01/clip_image004_thumb5.png" width="793" height="271"></a></p> <p>&nbsp;</p> <ul> <li>Like SQL You can Kill this job from Resource Manager it self – Click on Job and on top you will find a button for killing same query, like this job is running for last 7 hours, you can Kill it by clicking Kill Application </li></ul> <p><a href="https://msdnshared.blob.core.windows.net/media/2017/01/image686.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/01/image_thumb600.png" width="813" height="169"></a></p> <p>&nbsp;</p> <p>Hope this will come handy.</p> <p>Feel free to add comments, may be in next post I can take a deep dive into each log and action.</p> <p>Happy Learning.</p> <p>(Published on my&nbsp; blogs <a title="https://karanspeaks.com/" href="https://karanspeaks.com/">https://karanspeaks.com/</a> &amp; <a title="https://blogs.msdn.microsoft.com/" href="https://blogs.msdn.microsoft.com/">https://blogs.msdn.microsoft.com/</a>)</p>]]></content:encoded>
    </item>
    <item>
      <title>SSAS Monitoring Tool–SQL 2014 ASTrace</title>
      <link>https://docs.microsoft.com/archive/blogs/karang/ssas-monitoring-tool-sql-2014-astrace</link>
      <pubDate>Thu, 01 Dec 2016 04:27:40 GMT</pubDate>
      <dc:creator><![CDATA[Karan Gulati (SSAS Maestro)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/karang/?p=1005</guid>
      <description><![CDATA[&nbsp; Refer SSAS Monitoring Tool– ASTrace to learn more about ASTrace, this post was pending for a...]]></description>
      <content:encoded><![CDATA[<p><font size="2"></font>&nbsp;</p> <p><font size="2">Refer <a href="SSAS Monitoring Tool&ndash; ASTrace" target="_blank">SSAS Monitoring Tool– ASTrace</a> to learn more about ASTrace, this post was pending for a long time as I got tons of email and comment around SQL 2014 and 2016 ASTrace, whith this blog like to mention that I have shared a source code on git so anyone can contribute to same.</font></p> <p><font size="2"></font>&nbsp;</p> <p><font size="2">Code for ASTrace 2014 is tested with latest build of SQL Server 2014 but for 2016 I had tested with SQL 2016 Preview and didn’t get chance to test with RTM so in coming few days will test and update the code as well if required, but feel free to update if you like as its Git so anyone can contribute.</font></p> <p><font size="2"></font>&nbsp;</p> <p><font size="2">Here is Git Link - <a title="https://github.com/karanspeaks/SQL-Server-Analysis-Services-Samples" href="https://github.com/karanspeaks/SQL-Server-Analysis-Services-Samples">https://github.com/karanspeaks/SQL-Server-Analysis-Services-Samples</a></font></p> <p><font size="2"></font></p>]]></content:encoded>
    </item>
    <item>
      <title>Halo, Minecraft, and More! How Microsoft Studios Processes Gaming Event Data</title>
      <link>https://docs.microsoft.com/archive/blogs/karang/halo-minecraft-and-more-how-microsoft-studios-processes-gaming-event-data</link>
      <pubDate>Wed, 17 Feb 2016 23:36:36 GMT</pubDate>
      <dc:creator><![CDATA[Karan Gulati (SSAS Maestro)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/karang/2016/02/17/halo-minecraft-and-more-how-microsoft-studios-processes-gaming-event-data/</guid>
      <description><![CDATA[My first video on Channel 9, it talks about how we Handle various Events generated from Games……….....]]></description>
      <content:encoded><![CDATA[<p>My first video on Channel 9, it talks about how we Handle various Events generated from Games………..</p>  <p><a title="https://channel9.msdn.com/Blogs/raw-tech/Halo-Minecraft-and-More-How-Microsoft-Studios-Processes-Gaming-Event-Data" href="https://channel9.msdn.com/Blogs/raw-tech/Halo-Minecraft-and-More-How-Microsoft-Studios-Processes-Gaming-Event-Data">https://channel9.msdn.com/Blogs/raw-tech/Halo-Minecraft-and-More-How-Microsoft-Studios-Processes-Gaming-Event-Data</a></p>  <p><iframe style="height: 565px; width: 748px" height="540" src="https://channel9.msdn.com/Blogs/raw-tech/Halo-Minecraft-and-More-How-Microsoft-Studios-Processes-Gaming-Event-Data/player" frameborder="0" width="960" allowfullscreen="allowfullscreen"></iframe></p>]]></content:encoded>
    </item>
    <item>
      <title>Azure Data Factory: Detecting and Re-Running failed ADF Slices</title>
      <link>https://docs.microsoft.com/archive/blogs/karang/azure-data-factory-detecting-and-re-running-failed-adf-slices</link>
      <pubDate>Thu, 12 Nov 2015 23:00:03 GMT</pubDate>
      <dc:creator><![CDATA[Karan Gulati (SSAS Maestro)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/karang/2015/11/12/azure-data-factory-detecting-and-re-running-failed-adf-slices/</guid>
      <description><![CDATA[&#160;  Recently I came across&#160; a scenario where I need to detect failed slices of all Datasets...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p>Recently I came across&#160; a scenario where I need to detect failed slices of all Datasets in Azure Data Factory, in my case I need to detect for last 3 months and the number of slices was around 600+, they failed due to validation error as the source data wasn’t present and after a number of re-try slices were marked as failed. </p>  <p>In such cases its difficult to perform re-run from the&#160; Portal as you need to right click on each slice and run it explicitly. </p>  <p><strong>Solution:</strong> I wrote a following PowerShell Script, this script will detect all failed slices in a given Azure Data Factory and re-run same with your consent.</p>  <p>You can use same script not only for failed slices but for any status, you just need to change the Dataset status in filtering of slices, shown in following script.</p>  <p>I am also planning to write a solution which will run as a service in a worker role and automatically detect failed slices in a given time and re-run same.</p>  <p>Question can be asked, that in ADF you already have re-run logic they why you need to go through the hassles of writing and running script.</p>  <p>Yes we do have but after x number of re-runs a slices is marked as failed and only way is to run is through portal or programmatically. </p>  <p>So, here is my contribution to ADF Community.</p>  <p>Pre-requisite – <a href="https://azure.microsoft.com/en-us/blog/azps-1-0-pre/">Azure Resource Manager PowerShell</a> (<a title="https://azure.microsoft.com/en-us/blog/azps-1-0-pre/" href="https://azure.microsoft.com/en-us/blog/azps-1-0-pre/">https://azure.microsoft.com/en-us/blog/azps-1-0-pre/</a>)</p>  <table cellspacing="0" cellpadding="2" width="856" border="0"><tbody>     <tr>       <td valign="top" width="854">Copy following code in text file and save it as file.ps1          <br />          <p>You can also download the script and save it as PS1 – <a href="https://karangulati.files.wordpress.com/2015/11/re-run-failed-slices-ps11.doc" target="_blank">Click Here</a></p>       </td>     </tr>      <tr>       <td valign="top" width="854">         <p>#Begin Script</p>          <p>Login-AzureRmAccount </p>          <p>$slices= @()            <br />$tableName=@()             <br />$failedSlices= @()             <br />$failedSlicesCount= @()             <br />$tableNames=@()</p>          <p>$Subscription=&quot;Provide Subscription ID&quot;&#160; <br />&#160; <br />&#160; Select-AzureRMSubscription -SubscriptionId&#160; $Subscription&#160;&#160;&#160; <br />$DataFactoryName=&quot;Provide Data Factory Name&quot;             <br />$resourceGroupName =&quot;Porvide Resource Group Name for Data Factory&quot;             <br />&#160; <br />$startDateTime =&quot;2015-05-01&quot; #Start Date for Slices             <br />$endDateTime=&quot;2015-08-01&quot; # End Date for Slices</p>          <p>           <br />#Get Dataset names in Data Factory - you can explicitly give a table name using $tableName variable if you like to run only for an individual tablename             <br />$tableNames = Get-AzureRMDataFactoryDataset -DataFactoryName $DataFactoryName -ResourceGroupName $resourceGroupName | ForEach {$_.DatasetName}</p>          <p>$tableNames #lists tablenames</p>          <p>foreach ($tableName in $tableNames)            <br />{             <br />&#160;&#160;&#160; $slices += Get-AzureRMDataFactorySlice -DataFactoryName $DataFactoryName -DatasetName $tableName -StartDateTime $startDateTime -EndDateTime $endDateTime -ResourceGroupName $resourceGroupName -ErrorAction Stop             <br />}</p>          <p>           <br />$failedSlices = $slices | Where {$_.Status -eq 'Failed'}</p>          <p>$failedSlicesCount = @($failedSlices).Count</p>          <p>if ( $failedSlicesCount -gt 0 )            <br />{</p>          <p>&#160;&#160;&#160; write-host &quot;Total number of slices Failed:$failedSlicesCount&quot;            <br />&#160;&#160;&#160; $Prompt = Read-host &quot;Do you want to Rerun these failed slices? (Y | N)&quot;             <br />&#160;&#160;&#160; if ( $Prompt -eq &quot;Y&quot; -Or $Prompt -eq &quot;y&quot; )             <br />&#160;&#160;&#160; {</p>          <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; foreach ($failed in $failedSlices)            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; write-host &quot;Rerunning slice of Dataset &quot;$($failed.DatasetName)&quot; with StartDateTime &quot;$($failed.Start)&quot; and EndDateTime &quot;$($failed.End)&quot;&quot;             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Set-AzureRMDataFactorySliceStatus -UpdateType UpstreamInPipeline -Status Waiting -DataFactoryName $($failed.DataFactoryName) -DatasetName $($failed.DatasetName) -ResourceGroupName $resourceGroupName -StartDateTime &quot;$($failed.Start)&quot; -EndDateTime &quot;$($failed.End)&quot;             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $failed.DatasetName</p>          <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }            <br />&#160;&#160;&#160; }             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />}             <br />else             <br />{             <br />&#160;&#160;&#160; write-host &quot;There are no Failed slices in the given time period.&quot;             <br />}</p>          <p>#End Script</p>       </td>     </tr>   </tbody></table>]]></content:encoded>
    </item>
    <item>
      <title>Microsoft Azure Essentials: Azure Machine Learning</title>
      <link>https://docs.microsoft.com/archive/blogs/karang/microsoft-azure-essentials-azure-machine-learning</link>
      <pubDate>Thu, 16 Apr 2015 15:41:19 GMT</pubDate>
      <dc:creator><![CDATA[Karan Gulati (SSAS Maestro)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/karang/2015/04/16/microsoft-azure-essentials-azure-machine-learning/</guid>
      <description><![CDATA[&#160;  Microsoft Azure Essential: Azure ML Free book is pretty informative if you wanted to learn...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p>Microsoft Azure Essential: Azure ML Free book is pretty informative if you wanted to learn about ML. </p>  <p>Link as follow:</p>  <p><a href="https://aka.ms/AzureML_pdf"><strong>Download the PDF (5.84 MB)</strong></a><strong></strong></p>  <p>Additionally I recommend to go through free courser from University of Washington available through coursera.</p>  <p>Step by Step course of going in depth of Machine Learning.</p>  <p>Link as follow:</p>  <p><a title="https://www.coursera.org/course/machlearning" href="https://www.coursera.org/course/machlearning">https://www.coursera.org/course/machlearning</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Informative HDInsight Links</title>
      <link>https://docs.microsoft.com/archive/blogs/karang/informative-hdinsight-links</link>
      <pubDate>Tue, 20 Jan 2015 16:48:13 GMT</pubDate>
      <dc:creator><![CDATA[Karan Gulati (SSAS Maestro)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/karang/2015/01/20/informative-hdinsight-links/</guid>
      <description><![CDATA[Tried to collate informative articles related to HDInsight.           In...]]></description>
      <content:encoded><![CDATA[<table cellspacing="0" cellpadding="0" border="0"><tbody>     <tr>       <td width="763">         <p>Tried to collate informative articles related to HDInsight. </p>          <p>In comments section please add URLs of article / video which&#160; you came across and like me to add it to this list.</p>          <p><strong>Links as follow:-</strong></p>          <ul>           <li><a href="https://azure.microsoft.com/en-us/documentation/articles/hdinsight-hadoop-introduction/" target="_blank"><font size="3">Get started with HDInsight</font></a></li>            <li><a href="https://azure.microsoft.com/en-us/documentation/articles/hdinsight-get-started/"><font size="3">Get started using Hadoop with Hive in HDInsight to analyze mobile handset use</font></a></li>            <li><a href="https://azure.microsoft.com/en-us/documentation/articles/hdinsight-get-started-emulator/" target="_blank"><font size="3">Get started with HDinsight Emulator</font></a></li>            <li><a href="https://azure.microsoft.com/en-us/documentation/articles/hdinsight-storm-overview/"><font size="3">HDInsight Storm overview</font></a></li>            <li><a href="https://azure.microsoft.com/en-us/documentation/articles/hdinsight-storm-getting-started/"><font size="3">Getting started using Storm with HDInsight (Hadoop)</font></a></li>         </ul>          <p><strong><font size="3">Here are the Hadoop technologies in HDInsight:</font></strong></p>          <ul>           <li>             <div align="justify"><font size="3"><b><a href="https://azure.microsoft.com/en-us/documentation/articles/hdinsight-hadoop-introduction/#ambari">Ambari</a>:</b> Cluster provisioning, management, and monitoring </font></div>           </li>            <li>             <div align="justify"><font size="3"><b><a href="https://azure.microsoft.com/en-us/documentation/articles/hdinsight-hadoop-introduction/#avro">Avro</a></b> (Microsoft .NET Library for Avro): Data serialization for the Microsoft .NET environment </font></div>           </li>            <li>             <div align="justify"><font size="3"><b><a href="https://azure.microsoft.com/en-us/documentation/articles/hdinsight-hadoop-introduction/#hbase">HBase</a>:</b> Non-relational database for very large tables</font></div>           </li>            <li>             <div align="justify"><font size="3"><b><a href="https://azure.microsoft.com/en-us/documentation/articles/hdinsight-hadoop-introduction/#hdfs">HDFS</a>:</b> Hadoop Distributed File System</font></div>           </li>            <li>             <div align="justify"><font size="3"><b><a href="https://azure.microsoft.com/en-us/documentation/articles/hdinsight-hadoop-introduction/#hive">Hive</a>:</b> SQL-like querying</font></div>           </li>            <li>             <div align="justify"><font size="3"><b><a href="https://azure.microsoft.com/en-us/documentation/articles/hdinsight-hadoop-introduction/#mahout">Mahout</a>:</b> Machine learning</font></div>           </li>            <li>             <div align="justify"><font size="3"><b><a href="https://azure.microsoft.com/en-us/documentation/articles/hdinsight-hadoop-introduction/#mapreduce">MapReduce and YARN</a>:</b> Distributed processing and resource management</font></div>           </li>            <li>             <div align="justify"><font size="3"><b><a href="https://azure.microsoft.com/en-us/documentation/articles/hdinsight-hadoop-introduction/#oozie">Oozie</a>:</b> Workflow management</font></div>           </li>            <li>             <div align="justify"><font size="3"><b><a href="https://azure.microsoft.com/en-us/documentation/articles/hdinsight-hadoop-introduction/#pig">Pig</a>:</b> Simpler scripting for MapReduce transformations</font></div>           </li>            <li>             <div align="justify"><font size="3"><b><a href="https://azure.microsoft.com/en-us/documentation/articles/hdinsight-hadoop-introduction/#sqoop">Sqoop</a>:</b> Data import and export </font></div>           </li>            <li>             <div align="justify"><font size="3"><b><a href="https://azure.microsoft.com/en-us/documentation/articles/hdinsight-hadoop-introduction/#storm">Storm</a>:</b> Real-time processing of fast, large data streams</font></div>           </li>            <li>             <div align="justify"><font size="3"><b><a href="https://azure.microsoft.com/en-us/documentation/articles/hdinsight-hadoop-introduction/#zookeeper">Zookeeper</a>:</b> Coordinates processes in distributed systems</font></div>           </li>         </ul>          <table cellspacing="0" cellpadding="0" border="0"><tbody>             <tr>               <td width="763">                 <p><b><font size="3">Other popular Videos</font></b></p>                  <ul>                   <li><a href="https://channel9.msdn.com/Shows/Data-Exposed/Hadoop-Meets-the-Cloud-Scenarios-for-HDInsight"><font size="3">Channel9 video: Scenarios for HDInsight</font></a></li>                    <li><a href="https://channel9.msdn.com/Shows/Azure-Friday/Getting-Started-with-Azure-HDInsight-with-Matt-Winkler"><font size="3">Channel9 video: Get started with Azure HDInsight with Matt Winkler</font></a></li>                 </ul>                  <p><strong>Books</strong></p>                  <p><strong><u>Introducing Microsoft Azure HDInsight</u></strong>                    <br /><b>In <i>Introducing Microsoft Azure HDInsight</i>, we cover what big data really means, how you can use it to your advantage in your company or organization, and one of the services you can use to do that quickly—specifically, Microsoft’s HDInsight service. We start with an overview of big data and Hadoop, but we don’t emphasize only concepts in this book—we want you to jump in and get your hands dirty working with HDInsight in a practical way.</b></p>                  <p><img src="https://mvapublicstorage.microsoft.com/college/MVA-0A-arrow-icon.png" width="10" height="10" /> <b><a href="https://aka.ms/IntroHDInsight/PDF">Download the PDF</a> (6.37 MB) </b></p>                  <p></p>               </td>             </tr>           </tbody></table>       </td>     </tr>   </tbody></table>]]></content:encoded>
    </item>
    <item>
      <title>Harnessing the Power of both worlds</title>
      <link>https://docs.microsoft.com/archive/blogs/karang/harnessing-the-power-of-both-worlds</link>
      <pubDate>Sun, 16 Nov 2014 19:01:50 GMT</pubDate>
      <dc:creator><![CDATA[Karan Gulati (SSAS Maestro)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/karang/2014/11/16/harnessing-the-power-of-both-worlds/</guid>
      <description><![CDATA[&#160;  Harness the Power of Both Worlds –SQL Engine and Analysis Services  Introduction  The...]]></description>
      <content:encoded><![CDATA[<h3>&#160;</h3>  <h3>Harness the Power of Both Worlds –SQL Engine and Analysis Services</h3>  <h4>Introduction</h4>  <p>The combination of the SQL Engine and Analysis Services is awesome because it lets you harness the power of both worlds: columnstore Indexes in the SQL engine and real-time or relational OLAP (ROLAP) in Analysis Services.</p>  <p>Recently I have done some testing around a much talked about feature of the SQL engine – columnstore indexes. As you can learn in BOL, in SQL Server columnstore indexes store and manage data by using column-based data storage and column-based query processing <b>in-memory</b>. Columnstore indexes work well for data warehousing workloads that primarily perform bulk loads and read-only queries. By using the columnstore index you can achieve up to <strong>10x query performance</strong> gains over traditional row-oriented storage, and up to <strong>7x data compression</strong> over the uncompressed data size.</p>  <p>A columnstore index is a technology for storing, retrieving and managing data by using a columnar data format, called a columnstore. SQL Server supports both clustered and nonclustered columnstore indexes. Both use the same in-memory columnstore technology, but they do have differences in purpose and in features they support.</p>  <h5>Benefits</h5>  <p>Columnstore indexes work well for mostly read-only queries that perform analysis on large data sets. Often, these are queries for data warehousing workloads. Columnstore indexes give high performance gains for queries that use full table scans, and are not well-suited for queries that seek into the data, or that search for a particular value. </p>  <p>Columnstore indexes have these benefits:</p>  <p>· Columns often have similar data, which results in high compression rates.</p>  <p>· High compression rates improve query performance by using a smaller in-memory footprint. In turn, query performance can improve because SQL Server can perform more query and data operations in-memory.</p>  <p>· A new query execution mechanism called batch-mode execution has been added to SQL Server that reduces CPU usage by a large amount. Batch-mode execution is closely integrated with, and optimized around, the columnstore storage format. Batch-mode execution is sometimes known as vector-based or vectorized execution.</p>  <p>· Queries often select only a few columns from a table, which reduces total I/O from the physical media.</p>  <h4>Solution with ROLAP and Columnstore Index</h4>  <p>So how can you leverage this new shining star of SQL Server for business intelligence solutions?</p>  <p>I began by combining clustered columnstore indexes with Analysis Services ROLAP feature, enabling my fact tables for ROLAP, and then tested the performance of aggregations. As expected, I got pretty awesome performance with 500 million records. </p>  <p>So I doubled the number of records to 1 billion! At this scale, basic aggregates such as SUM and COUNT were returned in 2 to 3 seconds. The acid test of course lies in a certain trouble -making measure – you guessed it, Distinct Count. </p>  <p>So I did testing with Distinct Counts on the ROLAP solution and results were pretty positive, with around 1.5 billion records (1555618627), and around 15,638,865 distinct values. On a cold cache I got results within 2 seconds and on a warm cache in 16 milliseconds. </p>  <p>This was pretty awesome so I decided to try the combination of warm-caching with ROLAP in order to meet my SLA for the solution dashboards, which was around 4 seconds. </p>  <h5>Recommendations</h5>  <p>There are some important settings that you need to consider when implementing a BI solution based on in-memory columnstore indexes and Analysis Services ROLAP:</p>  <p>· <b>EnableRolapDistinctCountOnDataSource</b> – This is a very important property when we are using Analysis Services ROLAP. Set this property to 1 when using ROLAP with distinct count calculations. The property enables calculation of distinct count at the source (the relational database) instead of fetching rows in Analysis Services and calculating distinct count using Analysis Services.</p>  <p>· <b>Statistics</b> – In the absence of SQL Statistics Query Optimizer you will not be able to generate the right execution plan of a given query. Therefore it is very important to do timely updates of the statistics for the columnstore table; otherwise DML operations can degrade performance.</p>  <h5>Hardware</h5>  <p>For this experiment I used a Virtual Machine with 16 logical processors and 120 GB Ram.</p>  <h5>References</h5>  <p>Columnstore Indexes: https://msdn.microsoft.com/en-us/library/gg492088.aspx </p>]]></content:encoded>
    </item>
  </channel>
</rss>