<?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 Gauravkumar on Medium]]></title>
        <description><![CDATA[Stories by Gauravkumar on Medium]]></description>
        <link>https://medium.com/@gauravkumarjha1195?source=rss-90a5741d5413------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6fCm8nRNid0G8dFoJZQk6A.png</url>
            <title>Stories by Gauravkumar on Medium</title>
            <link>https://medium.com/@gauravkumarjha1195?source=rss-90a5741d5413------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 03:16:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gauravkumarjha1195/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[How I Rendered Country Flag Images in AWS QuickSight Using Snowflake]]></title>
            <link>https://gauravkumarjha1195.medium.com/how-i-rendered-country-flag-images-in-aws-quicksight-using-snowflake-2e4bba28a9ca?source=rss-90a5741d5413------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e4bba28a9ca</guid>
            <dc:creator><![CDATA[Gauravkumar]]></dc:creator>
            <pubDate>Tue, 12 May 2026 14:49:07 GMT</pubDate>
            <atom:updated>2026-05-12T14:49:07.421Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Problem Nobody Talks About</h3><p>You have images sitting in a Snowflake internal stage. You want to display them in AWS QuickSight. Simple enough — right?</p><p>Not quite.</p><p>After hours of debugging, I discovered that this deceptively simple use case hits a wall that most documentation ignores: <strong>Snowflake internal stages use PrivateLink URLs that are completely inaccessible from QuickSight.</strong></p><p>Here’s exactly how I solved it — without touching S3, without making anything public, and using only Snowflake.</p><h3>The Setup</h3><p>My team stores country flag PNG images directly in a Snowflake internal stage. The goal was to display these flags as images in a table in an AWS QuickSight dashboard, next to each country name.</p><h3>Attempt 1: Use FILE_URL Directly in QuickSight</h3><p>My first instinct — just use the FILE_URL column in QuickSight and set it to display as an image.</p><p><strong>Result:</strong> Broken images. Every single one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*LA0NDLMPcJGohOLNUmK_6Q.png" /><figcaption>Broken Flag image</figcaption></figure><p><strong>Why:</strong> The FILE_URL column uses Snowflake&#39;s <strong>PrivateLink hostname</strong>. This is a private network endpoint. QuickSight, running on AWS infrastructure externally, has zero access to it.</p><h3>Attempt 2: GET_PRESIGNED_URL()</h3><p>Snowflake has a built-in function GET_PRESIGNED_URL() that generates temporary public URLs for files in a stage.</p><pre>SELECT GET_PRESIGNED_URL(<br>    @your_db.your_schema.country_flags,<br>    &#39;Austria.png&#39;,<br>    3600<br>) AS PUBLIC_FLAG_URL;</pre><p><strong>Result:</strong> SQL compilation error.</p><pre>GET_PRESIGNED_URL expiry in seconds for AWS role is invalid. <br>Must be between 0 and 3,600.</pre><p><strong>Why:</strong> When your Snowflake stage uses an <strong>AWS IAM Role</strong> integration (the secure, enterprise-standard method), the maximum URL expiry is capped at <strong>3,600 seconds (1 hour)</strong>. The 7-day limit you read about online applies only to key-based credentials, which most enterprise setups don’t use.</p><h3>The Real Problem: PrivateLink in Presigned URLs</h3><p>Even after fixing the expiry to 3600 seconds, the generated presigned URLs still contained the PrivateLink hostname. QuickSight still couldn’t reach them.</p><p>The fix? A simple REPLACE():</p><pre>REPLACE(<br>    GET_PRESIGNED_URL(@your_db.your_schema.country_flags, RELATIVE_PATH, 3600),<br>    &#39;your_account_id.eu-west-1.privatelink.snowflakecomputing.com&#39;,<br>    &#39;your_account_id.snowflakecomputing.com&#39;<br>) AS PUBLIC_FLAG_URL</pre><p>This swaps the private endpoint for the public Snowflake hostname — and since the stage was actually backed by an S3 bucket, the resulting presigned URL pointed directly to S3, bypassing Snowflake’s network entirely.</p><h3>The Solution: Presigned URL Table + Snowflake Task</h3><p>Since presigned URLs expire after 1 hour, I needed a way to keep them fresh automatically. The answer: a <strong>Snowflake Task</strong> that regenerates URLs every 50 minutes into a dedicated table.</p><h3>Step 1 — Create the URL Table</h3><pre>CREATE OR REPLACE TABLE your_db.your_schema.flags_urls (<br>    COUNTRY_NAME      VARCHAR,<br>    RELATIVE_PATH     VARCHAR,<br>    PUBLIC_FLAG_URL   VARCHAR,<br>    URL_GENERATED_AT  TIMESTAMP_LTZ<br>);</pre><h3>Step 2 — Create the Refresh Task</h3><pre>CREATE OR REPLACE TASK your_db.your_schema.refresh_flag_urls<br>    WAREHOUSE = your_xsmall_warehouse<br>    SCHEDULE  = &#39;USING CRON */50 * * * * UTC&#39;<br>AS<br>    INSERT OVERWRITE INTO your_db.your_schema.flags_urls<br>    SELECT<br>        REPLACE(RELATIVE_PATH, &#39;.png&#39;, &#39;&#39;) AS COUNTRY_NAME,<br>        RELATIVE_PATH,<br>        REPLACE(<br>            GET_PRESIGNED_URL(<br>                @your_db.your_schema.country_flags,<br>                RELATIVE_PATH,<br>                3600<br>            ),<br>            &#39;your_account_id.eu-west-1.privatelink.snowflakecomputing.com&#39;,<br>            &#39;your_account_id.snowflakecomputing.com&#39;<br>        ) AS PUBLIC_FLAG_URL,<br>        CURRENT_TIMESTAMP() AS URL_GENERATED_AT<br>    FROM DIRECTORY(@your_db.your_schema.country_flags);</pre><h3>Step 3 — Activate and Populate</h3><pre>-- Activate the task<br>ALTER TASK your_db.your_schema.refresh_flag_urls RESUME;</pre><pre>-- Populate immediately (don&#39;t wait 50 minutes)<br>EXECUTE TASK your_db.your_schema.refresh_flag_urls;</pre><pre>-- Verify<br>SELECT * FROM your_db.your_schema.flags_urls;</pre><h3>Connecting to QuickSight</h3><ol><li>Connect QuickSight to your Snowflake dataset using the flags_urls table</li><li>In the dataset editor, find PUBLIC_FLAG_URL and set the field type to <strong>URL</strong></li><li>In your Table visual, add PUBLIC_FLAG_URL → click the field → <strong>Display as Image</strong></li><li>Set image dimensions (32×32px works well for flags)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/1*nrYgbMU4SAhl6wHafaUzlw.png" /><figcaption>Country and Flag</figcaption></figure><h3>Key Lessons Learned</h3><p><strong>1. PrivateLink URLs are invisible to external services.</strong> If your Snowflake account uses PrivateLink, every URL it generates — including presigned ones — will use the private hostname. Always replace it with the public endpoint.</p><p><strong>2. AWS IAM Role stages cap presigned URLs at 1 hour.</strong> The 7-day limit you’ll read about in Snowflake docs only applies to key-based credentials. Enterprise setups using IAM roles are capped at 3,600 seconds.</p><p><strong>3. Use the X-Small warehouse for maintenance tasks.</strong> A Large warehouse running every 50 minutes costs ~$345/month. The same task on an X-Small warehouse costs ~$2/month. Always size your warehouse to the workload.</p><p><strong>4. EXECUTE TASK is your best friend.</strong> Tasks don’t run immediately on creation. Always call EXECUTE TASK to populate your table right away instead of waiting for the first scheduled run.</p><p><strong>5. Test URLs in the browser before blaming QuickSight.</strong> Copy a generated URL and paste it into your browser. If the image loads there, it will load in QuickSight. This saved me hours of debugging in the wrong layer.</p><h3>Architecture Summary</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*phGhwL-2Qsckvt3PSoAVng.png" /><figcaption>Architecture</figcaption></figure><h3>Final Thoughts</h3><p>This solution is a <strong>pragmatic workaround</strong>, not a perfect architecture. If you need truly permanent URLs (years, not hours), the right answer is to copy your images to S3 and serve them via CloudFront. But if you’re in an environment where that’s not possible, or you want to stay entirely within Snowflake, this task-based approach works reliably with minimal cost.</p><p>The key insight: Snowflake is a data warehouse, not a file server. But with a bit of creativity, you can make it behave like one — at least well enough for a BI dashboard.</p><p><em>Have a better approach? I’d love to hear it in the comments.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e4bba28a9ca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adding a country flag in AWS Quicksight]]></title>
            <link>https://gauravkumarjha1195.medium.com/adding-a-country-flag-in-aws-quicksight-c2a3ea6b3e2a?source=rss-90a5741d5413------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2a3ea6b3e2a</guid>
            <category><![CDATA[aws-quicksight]]></category>
            <category><![CDATA[businessintelligencetool]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Gauravkumar]]></dc:creator>
            <pubDate>Wed, 04 Mar 2026 09:04:56 GMT</pubDate>
            <atom:updated>2026-03-04T09:04:56.832Z</atom:updated>
            <content:encoded><![CDATA[<p>When building dashboards, small visual elements can significantly improve the user experience. One such enhancement is displaying <strong>country flags alongside location data</strong>, which makes dashboards more intuitive and visually appealing.</p><p>Recently, a customer requested that country flags be displayed in a QuickSight dashboard. Since I have been working on <strong>AWS QuickSight development for the past year</strong>, I decided to explore how to implement it.</p><p>After experimenting with different approaches, I successfully added country flags to the dashboard. Below is the step-by-step process I followed.</p><p>Step 1: Prepare a Country Code Field. To display flags, we first need a <strong>country code</strong> (for example: DE, FR, IN, US). If your dataset already contains a country column, you can directly map it to the corresponding country code.</p><p>In my case, the dataset contained a <strong>manufacturing plant location</strong>, so I created a <strong>calculated field</strong> to map each plant location to its respective country code.</p><p>Example calculated field:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/415/1*FCyfBTSDIlJC8xKak6_WLg.png" /></figure><p>This calculated field generates the <strong>Country_Code</strong> required for fetching the flag image.</p><p>Step 2: Next, create another calculated field <strong>to construct the URL for the flag image</strong>.QuickSight can display images if the field contains a URL. We can use a public flag CDN</p><p>URLs : <a href="https://flagcdn.com/24x18/">https://flagcdn.com/24x18/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*nFMDxZW-FfpZ39FwrY77HQ.png" /><figcaption>Calculated field for Country_Flag</figcaption></figure><p>Step 3: Add any visualization to the sheet. I used a table</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*OwLb-U5KQBRRjpqJiyh2wA.png" /></figure><p>Step 4: Add the country flag and the plant to the table</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*A57Ov3pMDP-3xY1USB9YKw.png" /></figure><p>Step 5: Format the table so that Country Flag can convert it into an image</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iuIkfUrl4GOD3QzfTQh6PQ.png" /><figcaption>Select the Edit Field style</figcaption></figure><p>Step 6: Go to the edit field styling, select the country flag, see the URL options, select show URLs as image, then go to image sizing and use any of the options you want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oivPQbMzXkZCQstJz-Ztkg.png" /></figure><p>Step 7: Finally, rename the column from <strong>&quot;Country_Flag&quot;</strong> to <strong>&quot;Country&quot;</strong> to keep the dashboard clean and user-friendly. Now the table will display a <strong>country flag alongside the location information</strong>, making the dashboard easier to interpret.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hJoOsrywFt5oo8iVBkqMeQ.png" /></figure><h3>Final Result</h3><p><strong>Using a simple calculated field and a public image URL</strong>, we can easily integrate country flags into AWS QuickSight dashboards without any external plugins or complex integrations. This small enhancement significantly improves <strong>visual clarity and user engagement</strong>, especially in dashboards that involve <strong>global operations, manufacturing plants, or regional analysis</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2a3ea6b3e2a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Polars : Fast sports car ]]></title>
            <link>https://gauravkumarjha1195.medium.com/polars-fast-sports-car-0895df7e1b06?source=rss-90a5741d5413------2</link>
            <guid isPermaLink="false">https://medium.com/p/0895df7e1b06</guid>
            <dc:creator><![CDATA[Gauravkumar]]></dc:creator>
            <pubDate>Sun, 21 Sep 2025 13:33:52 GMT</pubDate>
            <atom:updated>2025-09-21T13:33:54.577Z</atom:updated>
            <content:encoded><![CDATA[<h3>Polars : Fast sports car 🚀</h3><h3>Polars Learning Guide</h3><h3>What is Polars?</h3><p>Polars is a blazingly fast DataFrame library for Python and Rust. It’s designed to be:</p><ul><li><strong>Fast</strong>: Built in Rust with optimized algorithms</li><li><strong>Memory efficient</strong>: Uses Apache Arrow columnar format</li><li><strong>Expressive</strong>: Clean API for data manipulation</li><li><strong>Parallel</strong>: Automatic parallelization of operations</li></ul><h3>Installation</h3><pre>pip install polars</pre><p>For additional functionality:</p><pre>pip install polars[all]  # Includes all optional dependencies</pre><h3>Basic Concepts</h3><h3>DataFrames vs Series</h3><ul><li><strong>DataFrame</strong>: 2D data structure (like a table)</li><li><strong>Series</strong>: 1D data structure (like a column)</li></ul><h3>Lazy vs Eager Evaluation</h3><ul><li><strong>Eager</strong>: Operations execute immediately</li><li><strong>Lazy</strong>: Operations are planned and optimized before execution</li></ul><h3>Getting Started</h3><h3>1. Importing and Creating DataFrames</h3><pre>import polars as pl<br>import numpy as np</pre><pre># From dictionary<br>df = pl.DataFrame({<br>    &quot;name&quot;: [&quot;Alice&quot;, &quot;Bob&quot;, &quot;Charlie&quot;, &quot;Diana&quot;],<br>    &quot;age&quot;: [25, 30, 35, 28],<br>    &quot;city&quot;: [&quot;New York&quot;, &quot;London&quot;, &quot;Tokyo&quot;, &quot;Paris&quot;],<br>    &quot;salary&quot;: [70000, 80000, 90000, 75000]<br>})</pre><pre># From lists<br>df2 = pl.DataFrame([<br>    [&quot;Alice&quot;, 25, &quot;New York&quot;],<br>    [&quot;Bob&quot;, 30, &quot;London&quot;],<br>    [&quot;Charlie&quot;, 35, &quot;Tokyo&quot;]<br>], schema=[&quot;name&quot;, &quot;age&quot;, &quot;city&quot;])</pre><pre># From CSV<br>df_csv = pl.read_csv(&quot;data.csv&quot;)</pre><pre># From Pandas DataFrame<br>import pandas as pd<br>pandas_df = pd.DataFrame({&quot;a&quot;: [1, 2, 3], &quot;b&quot;: [4, 5, 6]})<br>polars_df = pl.from_pandas(pandas_df)</pre><h3>2. Basic DataFrame Operations</h3><pre># Display basic info<br>print(df.shape)          # (rows, columns)<br>print(df.columns)        # Column names<br>print(df.dtypes)         # Data types<br>print(df.head())         # First 5 rows<br>print(df.tail())         # Last 5 rows<br>print(df.describe())     # Summary statistics</pre><pre># Select columns<br>df.select(&quot;name&quot;, &quot;age&quot;)<br>df.select(pl.col(&quot;name&quot;), pl.col(&quot;age&quot;))</pre><pre># Filter rows<br>df.filter(pl.col(&quot;age&quot;) &gt; 30)<br>df.filter((pl.col(&quot;age&quot;) &gt; 25) &amp; (pl.col(&quot;salary&quot;) &gt; 75000))</pre><pre># Sort data<br>df.sort(&quot;age&quot;)<br>df.sort(&quot;age&quot;, descending=True)<br>df.sort([&quot;city&quot;, &quot;age&quot;])</pre><h3>3. Column Operations</h3><pre># Add new columns<br>df.with_columns([<br>    (pl.col(&quot;salary&quot;) * 1.1).alias(&quot;new_salary&quot;),<br>    pl.col(&quot;name&quot;).str.upper().alias(&quot;name_upper&quot;),<br>    pl.lit(&quot;Employee&quot;).alias(&quot;role&quot;)<br>])</pre><pre># Modify existing columns<br>df.with_columns([<br>    pl.col(&quot;age&quot;).cast(pl.Float64),<br>    pl.col(&quot;name&quot;).str.lower()<br>])</pre><pre># Drop columns<br>df.drop(&quot;city&quot;)<br>df.drop([&quot;city&quot;, &quot;salary&quot;])</pre><h3>4. Aggregations</h3><pre># Basic aggregations<br>df.select([<br>    pl.col(&quot;age&quot;).mean().alias(&quot;avg_age&quot;),<br>    pl.col(&quot;salary&quot;).sum().alias(&quot;total_salary&quot;),<br>    pl.col(&quot;name&quot;).count().alias(&quot;count&quot;)<br>])</pre><pre># Group by operations<br>df.group_by(&quot;city&quot;).agg([<br>    pl.col(&quot;age&quot;).mean().alias(&quot;avg_age&quot;),<br>    pl.col(&quot;salary&quot;).sum().alias(&quot;total_salary&quot;),<br>    pl.col(&quot;name&quot;).count().alias(&quot;count&quot;)<br>])</pre><h3>Expressions: The Heart of Polars</h3><p>Expressions are the core of Polars’ power. They’re lazy operations that can be combined and optimized.</p><h3>5. Common Expressions</h3><pre># Column selection<br>pl.col(&quot;name&quot;)           # Select column<br>pl.col(&quot;*&quot;)              # Select all columns<br>pl.col(&quot;^.*_id$&quot;)        # Regex column selection</pre><pre># Literals<br>pl.lit(42)               # Literal value<br>pl.lit(&quot;hello&quot;)          # Literal string</pre><pre># Arithmetic<br>pl.col(&quot;salary&quot;) * 1.1<br>pl.col(&quot;age&quot;) + 5</pre><pre># Comparisons<br>pl.col(&quot;age&quot;) &gt; 30<br>pl.col(&quot;name&quot;).is_in([&quot;Alice&quot;, &quot;Bob&quot;])</pre><pre># String operations<br>pl.col(&quot;name&quot;).str.upper()<br>pl.col(&quot;name&quot;).str.contains(&quot;Al&quot;)<br>pl.col(&quot;name&quot;).str.len()</pre><pre># Date operations (if you have date columns)<br>pl.col(&quot;date&quot;).dt.year()<br>pl.col(&quot;date&quot;).dt.month()</pre><h3>6. Advanced Expressions</h3><pre># Conditional logic<br>pl.when(pl.col(&quot;age&quot;) &gt; 30)<br>  .then(pl.lit(&quot;Senior&quot;))<br>  .otherwise(pl.lit(&quot;Junior&quot;))</pre><pre># Window functions<br>pl.col(&quot;salary&quot;).sum().over(&quot;city&quot;)  # Sum salary by city<br>pl.col(&quot;age&quot;).rank().over(&quot;city&quot;)    # Rank age within city</pre><pre># List operations (if you have list columns)<br>pl.col(&quot;scores&quot;).list.mean()<br>pl.col(&quot;tags&quot;).list.len()</pre><h3>Lazy Evaluation</h3><p>One of Polars’ key features is lazy evaluation, which allows for query optimization.</p><h3>7. Lazy Operations</h3><pre># Start lazy evaluation<br>lazy_df = pl.DataFrame({<br>    &quot;a&quot;: range(1000),<br>    &quot;b&quot;: range(1000, 2000),<br>    &quot;c&quot;: range(2000, 3000)<br>}).lazy()</pre><pre># Chain operations (not executed yet)<br>result = (lazy_df<br>    .filter(pl.col(&quot;a&quot;) &gt; 500)<br>    .select([<br>        pl.col(&quot;a&quot;),<br>        (pl.col(&quot;b&quot;) * 2).alias(&quot;b_doubled&quot;),<br>        pl.col(&quot;c&quot;).sum().alias(&quot;c_sum&quot;)<br>    ])<br>    .group_by(&quot;a&quot;)<br>    .agg(pl.col(&quot;b_doubled&quot;).mean())<br>)</pre><pre># Execute the plan<br>final_result = result.collect()</pre><pre># See the execution plan<br>print(result.explain())</pre><h3>Working with Different Data Types</h3><h3>8. String Operations</h3><pre>df_text = pl.DataFrame({<br>    &quot;text&quot;: [&quot;Hello World&quot;, &quot;PYTHON programming&quot;, &quot;Data Science&quot;]<br>})</pre><pre>df_text.with_columns([<br>    pl.col(&quot;text&quot;).str.lower().alias(&quot;lowercase&quot;),<br>    pl.col(&quot;text&quot;).str.len().alias(&quot;length&quot;),<br>    pl.col(&quot;text&quot;).str.contains(&quot;(?i)python&quot;).alias(&quot;has_python&quot;),<br>    pl.col(&quot;text&quot;).str.split(&quot; &quot;).alias(&quot;words&quot;)<br>])</pre><h3>9. Date and Time</h3><pre>import datetime</pre><pre>df_dates = pl.DataFrame({<br>    &quot;date&quot;: [<br>        datetime.date(2023, 1, 1),<br>        datetime.date(2023, 6, 15),<br>        datetime.date(2023, 12, 31)<br>    ],<br>    &quot;datetime&quot;: [<br>        datetime.datetime(2023, 1, 1, 12, 0, 0),<br>        datetime.datetime(2023, 6, 15, 15, 30, 0),<br>        datetime.datetime(2023, 12, 31, 23, 59, 59)<br>    ]<br>})</pre><pre>df_dates.with_columns([<br>    pl.col(&quot;date&quot;).dt.year().alias(&quot;year&quot;),<br>    pl.col(&quot;date&quot;).dt.month().alias(&quot;month&quot;),<br>    pl.col(&quot;datetime&quot;).dt.hour().alias(&quot;hour&quot;)<br>])</pre><h3>Performance Tips</h3><h3>10. Best Practices</h3><pre># Use lazy evaluation for complex queries<br>result = (<br>    pl.scan_csv(&quot;large_file.csv&quot;)  # Lazy CSV reading<br>    .filter(pl.col(&quot;column&quot;) &gt; threshold)<br>    .group_by(&quot;category&quot;)<br>    .agg(pl.col(&quot;value&quot;).sum())<br>    .collect()  # Execute only when needed<br>)</pre><pre># Prefer select() over accessing columns individually<br># Good<br>df.select([pl.col(&quot;a&quot;), pl.col(&quot;b&quot;)])<br># Less efficient<br>df[&quot;a&quot;], df[&quot;b&quot;]</pre><pre># Use vectorized operations instead of loops<br># Good<br>df.with_columns((pl.col(&quot;a&quot;) * 2).alias(&quot;a_doubled&quot;))<br># Avoid<br>df.with_columns(pl.col(&quot;a&quot;).map_elements(lambda x: x * 2))</pre><h3>Common Patterns</h3><h3>11. Data Cleaning</h3><pre># Handle missing values<br>df.drop_nulls()                    # Drop rows with any null<br>df.drop_nulls(subset=[&quot;column&quot;])   # Drop rows with null in specific column<br>df.fill_null(0)                    # Fill nulls with 0<br>df.fill_null(strategy=&quot;forward&quot;)   # Forward fill</pre><pre># Remove duplicates<br>df.unique()<br>df.unique(subset=[&quot;column1&quot;, &quot;column2&quot;])</pre><h3>12. Joining DataFrames</h3><pre>df1 = pl.DataFrame({<br>    &quot;id&quot;: [1, 2, 3],<br>    &quot;name&quot;: [&quot;Alice&quot;, &quot;Bob&quot;, &quot;Charlie&quot;]<br>})</pre><pre>df2 = pl.DataFrame({<br>    &quot;id&quot;: [1, 2, 4],<br>    &quot;salary&quot;: [70000, 80000, 90000]<br>})</pre><pre># Inner join<br>df1.join(df2, on=&quot;id&quot;, how=&quot;inner&quot;)</pre><pre># Left join<br>df1.join(df2, on=&quot;id&quot;, how=&quot;left&quot;)</pre><pre># Join on different column names<br>df1.join(df2, left_on=&quot;id&quot;, right_on=&quot;employee_id&quot;)</pre><h3>Comparison with Pandas</h3><p>Operation Pandas Polars Create DataFrame pd.DataFrame() pl.DataFrame() Select columns df[[&#39;col1&#39;, &#39;col2&#39;]] df.select([&#39;col1&#39;, &#39;col2&#39;]) Filter rows df[df[&#39;col&#39;] &gt; 5] df.filter(pl.col(&#39;col&#39;) &gt; 5) Add column df[&#39;new&#39;] = df[&#39;old&#39;] * 2 df.with_columns((pl.col(&#39;old&#39;) * 2).alias(&#39;new&#39;)) Group by df.groupby(&#39;col&#39;).sum() df.group_by(&#39;col&#39;).sum() Sort df.sort_values(&#39;col&#39;) df.sort(&#39;col&#39;)</p><h3>Next Steps</h3><ol><li><strong>Practice with real data</strong>: Try loading your own datasets</li><li><strong>Explore the documentation</strong>: <a href="https://pola-rs.github.io/polars/">Polars User Guide</a></li><li><strong>Learn about lazy evaluation</strong>: Master the lazy API for better performance</li><li><strong>Advanced topics</strong>: Study window functions, custom expressions, and plugins</li><li><strong>Integration</strong>: Learn how Polars works with other tools in your data stack</li></ol><h3>Resources</h3><ul><li><a href="https://pola-rs.github.io/polars/">Official Documentation</a></li><li><a href="https://pola-rs.github.io/polars/py-polars/html/reference/">API Reference</a></li><li><a href="https://github.com/pola-rs/polars">GitHub Repository</a></li><li><a href="https://discord.gg/4UfP5cfBE7">Discord Community</a></li></ul><p>Happy learning with Polars! 🐻‍❄️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0895df7e1b06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Consulting]]></title>
            <link>https://gauravkumarjha1195.medium.com/consulting-00c22c07dace?source=rss-90a5741d5413------2</link>
            <guid isPermaLink="false">https://medium.com/p/00c22c07dace</guid>
            <category><![CDATA[business-strategy]]></category>
            <category><![CDATA[design-thinking]]></category>
            <category><![CDATA[consulting]]></category>
            <dc:creator><![CDATA[Gauravkumar]]></dc:creator>
            <pubDate>Wed, 06 Aug 2025 09:14:28 GMT</pubDate>
            <atom:updated>2025-08-06T09:14:28.753Z</atom:updated>
            <content:encoded><![CDATA[<p>I attended the Fast Forward Program by McKinsey and would like to share my takeaways from the experience. While perspectives may differ from person to person, these are the key insights and learnings I gained during the program.</p><p><strong>Table of Contents</strong></p><ol><li>Key Concepts</li><li>Building Adaptability and Resilience</li><li>Setting Learning Intentions</li><li>Mindsets and the APR Framework</li><li>Healthy Learning Behaviors</li><li>Structuring Problem Solving</li><li>Psychological Safety in Teams</li><li>Communication Excellence (EPIC Framework)</li><li>Digital Transformation</li><li>New Ways of Working (Design Thinking &amp; Agile)</li><li>Well-being and Emotional Flexibility</li></ol><h3>1. Key Concepts</h3><p>This course introduced foundational ideas across personal development, communication, problem-solving, and team dynamics.</p><ul><li><strong>Adaptability:</strong> The ability to adjust or change based on the situation.</li><li><strong>Resilience:</strong> The ability to stand firm in difficult times and face the situation.</li><li><strong>Psychological:</strong> Relating to the mind and emotions.</li><li><strong>Problem Solving:</strong> The process of finding answers to complicated personal and professional issues.</li><li><strong>Hypothesis:</strong> Your first best guess for the solution to a problem, an idea based on limited evidence that serves as a starting point.</li><li><strong>Stakeholders:</strong> A person with an interest or concern in the topic.</li><li><strong>Iterative:</strong> Always improving, often about products or processes.</li><li><strong>Solution Set:</strong> All possible solutions to a problem.</li><li><strong>Bias:</strong> A tendency to feel or think a certain way that can distort behavior and decisions.</li><li><strong>Operational Concepts:</strong> Market research, production capacity, turnaround, and scope are critical for business execution.</li><li><strong>Supply Chain:</strong> The processes and activities used to create and deliver goods or services.</li><li><strong>Operational Complexity:</strong> Many interconnected operations across business areas.</li></ul><h3>2. Building Adaptability and Resilience</h3><p>Three major drivers:</p><ul><li><strong>Activate Learning:</strong> Change, uncertainty, and pressure can make learning hard. Set intentions and create learning habits.</li><li><strong>Strengthen Personal Resilience:</strong> Awareness of mindset and well-being increases the ability to thrive under stress.</li><li><strong>Reinforce Purpose:</strong> Intrinsic motivation and clarity of purpose help you stay grounded and channel energy productively.</li></ul><h3>3. Setting Learning Intentions</h3><ul><li><strong>Performance Goals vs. Learning Intentions:</strong></li><li>Performance goals = when the skill is already developed.</li><li>Learning intentions = when developing a new skill.</li></ul><p><strong>Examples of Learning Intentions:</strong></p><ul><li>Discover virtual communication approaches</li><li>Understand the cost-benefit of large purchases</li><li>Learn about unrelated departmental processes</li></ul><p><strong>Tips:</strong></p><ul><li>Focus on the journey, not just the outcome.</li><li>Tie learning to personal meaning for greater engagement.</li></ul><h3>4. Mindsets and the APR Framework</h3><p>APR is a mindset-shifting practice for resilience:</p><ul><li><strong>Awareness:</strong> Identify mindsets, especially in challenging moments.</li><li><strong>Pause:</strong> Center yourself. Breathe. Ground your thoughts.</li><li><strong>Reframe:</strong> What could be possible with a different mindset?</li></ul><p>This tool helps rewire your response patterns in real time.</p><h3>5. Healthy Learning Behaviors</h3><p>Learning behaviors fall into three categories:</p><p><strong>Preparation:</strong></p><ul><li>Set intentions and break them into steps.</li><li>Prioritize time and space for learning.</li><li>Anticipate skill, will, and opportunity roadblocks.</li></ul><p><strong>Execution:</strong></p><ul><li>Practice deliberately, at your edge.</li><li>Teach others — it helps retention.</li><li>Stay mindful and avoid autopilot learning.</li></ul><p><strong>Reflection:</strong></p><ul><li>Seek and give feedback.</li><li>Reflect on actions and beliefs.</li><li>Fight self-serving bias through honest self-questioning.</li></ul><h3>6. Structuring Problem Solving</h3><p>Problem solving involves:</p><ul><li><strong>SMART Framework:</strong> Specific, Measurable, Actionable, Relevant, Time-bound.</li><li><strong>MECE Principle:</strong> Mutually Exclusive, Collectively Exhaustive for breaking down issues.</li><li><strong>80/20 Rule (Pareto Principle):</strong> Focus energy on the most impactful issues.</li><li><strong>Logic Trees / Issue Trees:</strong> Break problems into smaller components.</li><li><strong>Work Plan Worksheet:</strong></li><li><strong>Issue</strong> → Unresolved question</li><li><strong>Hypothesis</strong> → Likely solution</li><li><strong>End Product</strong> → Output or deliverable</li><li><strong>Analyses</strong> → Work needed to test the hypothesis</li><li><strong>Sources</strong> → Internal and external data or experts</li><li><strong>Timing &amp; Responsibility</strong> → Who owns it and by when</li><li><strong>Synthesis:</strong> Not just a summary — it’s a perspective on the analysis. Share the “so what.”</li></ul><h3>7. Psychological Safety in Teams</h3><p><strong>Google Research: Five Dynamics of High-Performing Teams:</strong></p><ol><li>Psychological Safety (most important)</li><li>Dependability</li><li>Structure and Clarity</li><li>Meaning</li><li>Impact</li></ol><p><strong>REACH Model:</strong></p><ul><li><strong>Reframe Mistakes:</strong> Mistakes are data for learning.</li><li><strong>Encourage All Voices:</strong> Invite everyone to share. Avoid “yes, but…”</li><li><strong>Appreciate Contributions:</strong> Acknowledge efforts consistently.</li><li><strong>Coach Each Other:</strong> Encourage peer feedback, set behavioral standards, and model support.</li></ul><h3>8. Communication Excellence (EPIC Framework)</h3><p><strong>EPIC = Empathy, Purpose, Insight, Conversation</strong></p><ul><li><strong>Empathy:</strong> Understand others’ feelings and needs.</li><li><strong>Purpose:</strong> Define a clear objective that benefits both parties.</li><li><strong>Insight:</strong> Data → Information → Insight. Present actionable conclusions.</li><li><strong>Conversation:</strong> Two-way, structured, purposeful discussion.</li></ul><p><strong>Tools:</strong></p><ul><li><strong>Pyramid Principle:</strong></li><li><strong>Governing Thought</strong> → One-sentence answer</li><li><strong>Key Line Statements</strong> → Why and how</li><li><strong>Supporting Data</strong> → Evidence.</li><li><strong>Storylining vs Storytelling:</strong> Keep your message focused on your audience’s needs.</li></ul><p><strong>Three Elements of Style:</strong></p><ul><li>Physical Presence</li><li>Vocal Emphasis</li><li>Emotional Connection</li></ul><p><strong>Meeting Flow (Open, Narrow, Close):</strong></p><ul><li>Start broad → Analyze → Close with clear next steps</li></ul><h3>9. Digital Transformation</h3><p>Digital = <strong>Data + Technology + New Ways of Working</strong></p><p><strong>Data:</strong></p><ul><li>Raw facts (quantitative or qualitative)</li><li>Information = organized data</li><li>Insight = valuable, not obvious conclusion from data</li></ul><p><strong>Technology:</strong></p><ul><li><strong>Cloud:</strong> On-demand data and computing access</li><li><strong>AI:</strong> Intelligence-like behavior from machines (e.g., ChatGPT, DALL-E)</li><li><strong>CTO (Chief Transformation Officer):</strong> Leads change across an organization</li></ul><h3>10. New Ways of Working (Design Thinking &amp; Agile)</h3><ul><li><strong>Design Thinking:</strong></li><li>Empathize → Define → Ideate → Prototype → Test</li><li>Focus on user needs via interviews, surveys, and observations</li></ul><p><strong>Agile:</strong></p><ul><li>Iterative cycles or “sprints”</li><li>Teams are cross-functional and empowered</li><li>Test ideas fast, fail fast, adapt fast</li></ul><p><strong>Four Principles of Agile:</strong></p><ol><li>Focus on end users</li><li>Be team-oriented</li><li>Drive continuous value</li><li>Experiment and learn quickly</li></ol><h3>11. Well-being and Emotional Flexibility</h3><ul><li><strong>Stress Curve:</strong> Inverted U-shape. Aim for optimal stress (not too high, not too low)</li><li><strong>Recovery = Performance Fuel:</strong> Physical, mental, social, and spiritual recovery is crucial</li></ul><p><strong>Emotional Flexibility:</strong></p><ul><li>Recognize emotions</li><li>Choose to act or let go</li><li>Practice acceptance and curiosity (defusion technique)</li></ul><p><strong>AVEC Framework for Relationships:</strong></p><ul><li><strong>Attention:</strong> Presence in conversations</li><li><strong>Vulnerability:</strong> Honest and open sharing</li><li><strong>Empathy:</strong> Deep understanding of others</li><li><strong>Compassion:</strong> Care through helpful action</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=00c22c07dace" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“Import a .txt File into AWS QuickSight.]]></title>
            <link>https://gauravkumarjha1195.medium.com/import-a-txt-file-into-aws-quicksight-1ace24cd40a8?source=rss-90a5741d5413------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ace24cd40a8</guid>
            <dc:creator><![CDATA[Gauravkumar]]></dc:creator>
            <pubDate>Mon, 19 May 2025 16:14:05 GMT</pubDate>
            <atom:updated>2025-08-31T11:22:58.487Z</atom:updated>
            <content:encoded><![CDATA[<h3>Import a .txt File into AWS QuickSight.</h3><p>While working on a project, my customer asked me if we could import a .txt file directly to AWS Quicksight. My Answer is “NOOOOO”</p><p>You can’t directly import a .txt file through the AWS QuickSight “Create dataset” GUI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LiTjosOXOZRM1uLxhnLt2A.png" /></figure><p>So, how can this problem be fixed next? Here’s a cleaner way to describe the workflow</p><ol><li><strong>Convert your </strong><strong>.txt file to </strong><strong>.csv.</strong></li><li><strong>Create an Amazon S3 bucket.</strong></li><li><strong>Upload the newly created </strong><strong>.csv file to that bucket.</strong></li><li><strong>Create a manifest file (in JSON format) that points to your CSV.</strong></li><li><strong>Copy the S3 object URL</strong> for your manifest (or CSV), then choose “S3” as the data source in QuickSight and paste that link into the field.</li></ol><p>You might wonder why we don’t just import the CSV directly into QuickSight, even though the GUI allows you to upload CSVs. The problem is that QuickSight can’t correctly parse and split your header row: it treats the entire header line as one column name, which isn’t what we need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*4utjFTzfK7WFGFKaHjKETw.png" /></figure><p>The next question that came to mind is what this manifest file is. You can go to this link to understand: <a href="https://docs.aws.amazon.com/redshift/latest/dg/loading-data-files-using-manifest.html">https://docs.aws.amazon.com/redshift/latest/dg/loading-data-files-using-manifest.html</a>.</p><p>In plain terms, a manifest file is a JSON document that specifies the data’s location and details, like its format, delimiters, and other settings. Below is an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*29uL3_KS6TRsk-ul9BKlUg.png" /></figure><p>Upload this file to your S3 bucket as a JSON, following the layout shown in the illustration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JKMdGuWxlyfh0Vp8NYdnzQ.png" /></figure><p>Upload this file to your S3 bucket as a JSON, following the layout shown in the illustration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JcAItIr7T0NkdwynYc1btw.png" /></figure><p>Now open the AWS Quicksight. If you don’t have an account, create one. After logging in, go to the dataset, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/199/1*881MlknAsMifJI7_uZL26g.png" /></figure><p>Click on Create dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lofzbGh4Qc1Q7zmTUF7oug.png" /></figure><p>After that, we can click on S3, as shown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1By5zHhOufKvE4-ieHR-Pg.png" /></figure><p>Once you click that, a window like the one below will appear. Simply enter a name for your data source and paste in the S3 bucket path where your manifest file is uploaded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/1*98H8ljsSgJuqRehJyET7vQ.png" /></figure><p>Once you do that and click on Connect, your CSV data will be imported into AWS Quicksight. You can now edit, process, and transform it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ATzOXntfRY8SuLDNRliFcg.png" /></figure><p>Following these steps lets you effortlessly load a .txt file into AWS QuickSight. You can automate this as well: script the conversion from .txt to .csvThen import the resulting CSV into QuickSight.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ace24cd40a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Managing Athena Limitations: Effectively Handling Durations Exceeding 24 Hours Across Environments]]></title>
            <link>https://gauravkumarjha1195.medium.com/managing-athena-limitations-effectively-handling-durations-exceeding-24-hours-across-environments-fc6b3b83f341?source=rss-90a5741d5413------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc6b3b83f341</guid>
            <category><![CDATA[timestamp]]></category>
            <category><![CDATA[excel]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[athena]]></category>
            <category><![CDATA[bigquery]]></category>
            <dc:creator><![CDATA[Gauravkumar]]></dc:creator>
            <pubDate>Fri, 17 Jan 2025 16:00:26 GMT</pubDate>
            <atom:updated>2025-01-17T16:00:26.116Z</atom:updated>
            <content:encoded><![CDATA[<p>When working with time-based data, especially durations, it&#39;s common to encounter scenarios exceeding 24 hours. In systems like Amazon Athena, built on Presto, the TIME and TIMESTAMP types do not allow durations exceeding 24 hours. In Athena, if the hours go beyond 24, the time is converted into a DAY format (e.g., 25:01:01 would be converted to 1 day 01:01:01). This is problematic if you need to retain the exact duration in HH:MM: SS format without including days.<br> While Athena has limitations in directly storing durations over 24 hours in TIME or TIMESTAMP types, you can achieve your goal of working with durations exceeding 24 hours in various other environments that offer more flexibility with time and date operations. This article will explore how to handle this challenge using Python (pandas), BigQuery, Spark, and Excel.</p><h4><strong>Python (pandas) Using timedelta</strong></h4><p>Especially with the panda&#39;s library, Python offers great flexibility when dealing with time-based data. The time delta object in Python can handle durations well, including those exceeding 24 hours, without any limitations. You can use the time delta function to handle time differences and convert them into HH:MM: SS format. This solution is ideal when working with Python and pandas for data processing and analysis.<br> <br>Example Code:<br> <br> &quot;`python<br> import pandas as PD<br> <br> # Sample data: duration in seconds<br> data = {<br> &#39;id&#39;: [1, 2, 3],<br> &#39;Name&#39;: [&#39;A,&#39; &#39;B,&#39; &#39;C&#39;],<br> &#39;duration_in_seconds&#39;: [90061, 45296, 36000] # Durations in seconds<br> }<br> <br> df = pd.DataFrame(data)<br> <br> # Convert seconds to time delta<br> df[‘duration’] = pd.to_timedelta(df[‘duration_in_seconds’], unit=’s’)<br> <br> # Function to convert timedelta to HH:MM:SS format<br> def timedelta_to_hms(td):<br> return str(td).split()[2] # Extract time part in HH:MM: SS<br> <br> # Apply function to create the formatted time<br> df[‘formatted_duration_time_hh_mm_ss’] = df[‘duration’].apply(timedelta_to_hms)<br> <br> print(df)<br> ```<br> <br> ### Output:<br> ```<br> bokey Name duration_in_seconds formatted_duration_time_hh_mm_ss<br> 0 1 A 90061 25:01:01<br> 1 2 B 45296 12:34:56<br> 2 3 C 36000 10:00:00<br> ```<br> <br> This solution keeps the hours beyond 24 without converting them into days, allowing you to retain the exact duration in the format `HH:MM: SS.`</p><h4>BigQuery</h4><p>BigQuery offers powerful date and time functions that can format durations in HH:MM: SS even if the duration exceeds 24 hours. You can use FORMAT_TIMESTAMP and manual calculations to handle durations beyond 24 hours.</p><p><strong>Example Query:</strong><br> <br> &quot;`SQL<br> SELECT <br> id,<br> name,<br> FORMAT_TIMESTAMP(‘%H:%M:%S’, TIMESTAMP_SECONDS(duration_in_seconds)) AS formatted_duration_time_hh_mm_ss<br> FROM <br> your_table;<br> ```<br> <br> However, BigQuery&#39;s `FORMAT_TIMESTAMP` will reset the hours after 24. To handle durations exceeding 24 hours, you can manually calculate the hours, minutes, and seconds as follows:<br> <br> &quot;`SQL<br> SELECT<br> id,<br> name,<br> CONCAT(<br> LPAD(CAST(FLOOR(duration_in_seconds / 3600) AS STRING), 2, &#39;0&#39;), &#39;:&#39;,<br> LPAD(CAST(FLOOR((duration_in_seconds % 3600) / 60) AS STRING), 2, &#39;0&#39;), &#39;:&#39;,<br> LPAD(CAST(duration_in_seconds % 60 AS STRING), 2, ‘0’)<br> ) AS formatted_duration_time_hh_mm_ss<br> FROM <br> your_table;<br> ```<br> <br> <strong>### Output:</strong><br> — `25:01:01` for a duration of `90061` seconds.<br> <br> This approach allows you to maintain durations exceeding 24 hours without converting them into days.</p><h4>Spark (PySpark)</h4><p>Apache Spark, via PySpark, is a powerful distributed processing engine that efficiently handles large datasets and time-based calculations. In Spark, you can easily calculate and format durations using the pyspark.sql.functions module.</p><p><strong>Example Code:<br> </strong><br> &quot;`python<br> from pyspark.sql import functions as F<br> from pyspark.sql import SparkSession<br> <br> # Initialize Spark session<br> spark = SparkSession.builder.appName(“DurationHandling”).getOrCreate()<br> <br> # Sample data<br> data = [(1, 90061), (2, 45296), (3, 36000)]<br> df = spark.createDataFrame(data, [‘id’, ‘duration_in_seconds’])<br> <br> # Convert seconds to HH:MM: SS format<br> df = df.withColumn(‘duration_time_hh_mm_ss’, <br> F.concat(<br> F.lpad((df[‘duration_in_seconds’] // 3600).cast(‘string’), 2, ‘0’),<br> F.lit(‘:’),<br> F.lpad(((df[‘duration_in_seconds’] % 3600) // 60).cast(‘string’), 2, ‘0’),<br> F.lit(‘:’),<br> F.lpad((df[‘duration_in_seconds’] % 60).cast(‘string’), 2, ‘0’)<br> ))<br> <br> df.show()<br> ```<br> <br> <strong>### Output:</strong><br> ```<br> + — — -+ — — — — — — — — — -+ — — — — — — — — — — — — — — +<br> |id|duration_in_seconds|formatted_duration_time_hh_mm_ss|<br> + — — -+ — — — — — — — — — -+ — — — — — — — — — — — — — — +<br> | 1| 90061| 25:01:01|<br> | 2| 45296| 12:34:56|<br> | 3| 36000| 10:00:00|<br> + — — -+ — — — — — — — — — -+ — — — — — — — — — — — — — — +<br> ```<br> <br> This solution in PySpark also preserves durations exceeding 24 hours in the `HH:MM: SS` format.</p><h4><strong>Excel</strong></h4><p>If you&#39;re working with data in Excel, you can easily calculate durations and display them in `HH:MM: SS` format, even when the hours exceed 24. Excel provides an intuitive way to handle durations exceeding 24 hours using custom number formats.</p><p>1. **Enter Total Seconds**: Suppose you have the total seconds in cell `A1`. For instance, `90061` seconds.<br> 2. **Use Formula to Convert**:<br> In cell `B1`, use the formula to convert seconds into `HH:MM: SS` format:<br> <br> &quot;`excel<br> =TEXT(A1/86400, “[h]:mm:ss”)<br> ```<br> <br> This formula divides the total seconds by `86400` (the number of seconds a day) and formats it as `HH:MM: SS,` preserving hours greater than 24.<br> <br> <strong>### Output:<br> </strong>— For `90061` seconds: `25:01:01`<br> — For `45296` seconds: `12:34:56`</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc6b3b83f341" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How did I prepare for my AWS Certification?]]></title>
            <link>https://gauravkumarjha1195.medium.com/how-did-i-prepare-for-my-aws-certification-95da80def9eb?source=rss-90a5741d5413------2</link>
            <guid isPermaLink="false">https://medium.com/p/95da80def9eb</guid>
            <category><![CDATA[aws-certification]]></category>
            <dc:creator><![CDATA[Gauravkumar]]></dc:creator>
            <pubDate>Sat, 13 Jul 2024 23:18:26 GMT</pubDate>
            <atom:updated>2024-07-13T23:18:26.269Z</atom:updated>
            <content:encoded><![CDATA[<p>The AWS Certified Cloud Practitioner certification is a foundational-level credential that validates an individual’s overall understanding of the AWS Cloud. As reported by AWS, this certification is designed for candidates with up to 6 months of AWS Cloud experience and is ideal for those new to cloud computing or transitioning from non-IT backgrounds. The exam tests knowledge across four key domains: Cloud Concepts, Security and Compliance, Technology, and Billing and Pricing, providing a comprehensive overview of AWS services and best practices.</p><h3>Exam Overview</h3><p>The AWS Certified Cloud Practitioner exam (CLF-C01) is a 90-minute test with 65 multiple-choice or multiple-response questions. Candidates must achieve a passing score of 700 out of 1000 points (70%) to earn the certification. The exam covers four main domains: Cloud Concepts (26%), Security and Compliance (25%), Technology (33%), and Billing and Pricing (16%). Available in multiple languages, including English, Japanese, and Simplified Chinese, the exam costs $100 USD and can be taken at Pearson VUE testing centers or online via proctored exams.</p><h3>Recommended Study Resources</h3><p>To prepare for the AWS Certified Cloud Practitioner exam, candidates can leverage a variety of resources:</p><ul><li>AWS Cloud Practitioner Essentials course (free on AWS SkillBuilder)</li><li>Udemy courses: “Ultimate AWS Certified Cloud Practitioner — 2023” and “6 Practice Exams | AWS Certified Cloud Practitioner CLF-C01”</li><li>AWS SkillBuilder resources: Cloud Essentials Learning Plan, AWS Cloud Quest: Cloud Practitioner game, and official practice question set</li><li>Whizlabs AWS Certified Cloud Practitioner course</li><li>Hands-on experience with the AWS Management Console</li></ul><h3>Certification Badge Verification</h3><p>Upon completing the exam, candidates receive a digital AWS Certified Cloud Practitioner badge. This credential can be shared on professional networking and social media platforms to showcase the achievement. The certification’s authenticity can be verified using a unique URL provided by AWS through Credly’s platform. For this specific certification, the verification link is <a href="https://www.credly.com/badges/b70fc6a8-4c5b-47d1-b1f4-704dfb729035/public_url">https://www.credly.com/badges/b70fc6a8-4c5b-47d1-b1f4-704dfb729035/public_url</a>, allowing employers and interested parties to confirm the validity of the credential</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95da80def9eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Difference between Athena table and Athena Views.]]></title>
            <link>https://gauravkumarjha1195.medium.com/difference-between-athena-table-and-athena-views-ff0d17234670?source=rss-90a5741d5413------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff0d17234670</guid>
            <dc:creator><![CDATA[Gauravkumar]]></dc:creator>
            <pubDate>Fri, 29 Sep 2023 10:27:52 GMT</pubDate>
            <atom:updated>2023-09-29T10:32:53.167Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction:</h3><p>Amazon Athena is a robust query service that enables users to analyze data directly in Amazon Simple Storage Service (Amazon S3) using SQL. It eliminates the necessity to manage any infrastructure, allowing a focus on analyzing data with the assurance of paying only for the queries executed. This article will explore the functionalities of Athena Tables and Athena Views, emphasizing the utility and efficiency of Athena Views in automating and managing project workflows.</p><h3>Understanding AWS Athena:</h3><p>Amazon AWS Athena is a service that empowers users to interact with their data stored in Amazon S3 using SQL, a prominent database communication language. The salient feature of Athena is that it requires no infrastructure management, such as servers, allowing users to run queries and only incur costs for the queries they execute.</p><h3>Concept of Athena Views:</h3><p>An Athena View is a virtual table and does not store any data. It is formulated by combining data from one or more existing tables, creating a new, on-the-spot table for specific data needs. Views simplify intricate queries by consolidating data from various tables and can act as a precise filter, displaying selective columns or rows to specific users.</p><h3>Differentiating Athena Tables and Athena Views:</h3><p>In the realm of Amazon Athena, tables are fundamental entities that hold the raw data and are updated regularly. In contrast, a view is like a predefined query template, a virtual table created for specific, momentary needs without holding any data.</p><h3>Application in Project Workflow:</h3><p>In my project scenario, the Athena table is updated automatically on a regular basis. The raw data arriving in the Athena table transforms, cleaning, joining, and unnesting through a series of SQL queries, subsequently generating a new table.</p><p>The challenge arose in automating the execution of these queries whenever new data was integrated into the original table. While AWS provides numerous services like Lambda, ETL, and Glue to automate queries, they require substantial effort and resources to set up.</p><h3>Optimizing Workflow with Athena Views:</h3><p>After extensive research, Athena Views emerged as the optimal solution for automating tasks without additional setups or alterations. It only necessitated the creation of a view and the execution of the query within the view, as exemplified below:</p><p>CREATE VIEW topic AS <br>SELECT a, a+b, c, d <br>FROM topics;</p><p>Implementing this approach streamlined my workflow significantly, yielding 100% accurate results as per expectations. The continuous monitoring for a week revealed that the integration of new raw data into the table was seamlessly reflected in the views post the execution of the customized query created by me.</p><h3>Conclusion:</h3><p>Athena Views have proven to be an invaluable asset in optimizing costs and enhancing speed and efficiency in handling data. The feature of not necessitating any automation reduces the effort and resources involved, making it a favorable choice for managing and automating project workflows.</p><p>This practical application of Athena Views demonstrates its potential in simplifying complex workflows, offering a resource-efficient method to handle and analyze data, and ensuring the integrity and accuracy of the results.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff0d17234670" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Team work in Ramayana]]></title>
            <link>https://gauravkumarjha1195.medium.com/team-work-in-ramayana-a5dc14c390be?source=rss-90a5741d5413------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5dc14c390be</guid>
            <dc:creator><![CDATA[Gauravkumar]]></dc:creator>
            <pubDate>Sun, 07 May 2023 21:59:16 GMT</pubDate>
            <atom:updated>2023-05-07T21:59:16.264Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*A5ShZI2K-d0ofjJWm3Mk3Q@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*iSocPivNtatSlIGlr4cGGQ@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*H9paa1LQtNNbED6-u8ObRQ@2x.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5dc14c390be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scanning s3 with bucketAV]]></title>
            <link>https://gauravkumarjha1195.medium.com/scanning-s3-with-bucketav-bac333954ced?source=rss-90a5741d5413------2</link>
            <guid isPermaLink="false">https://medium.com/p/bac333954ced</guid>
            <dc:creator><![CDATA[Gauravkumar]]></dc:creator>
            <pubDate>Wed, 28 Sep 2022 09:54:31 GMT</pubDate>
            <atom:updated>2022-09-28T09:54:31.353Z</atom:updated>
            <content:encoded><![CDATA[<p>One day one customer came to us asking that they need data in the s3 bucket and that bucket should be scanned with AV.</p><p>Initially, I tried to install ClamAV but since the request is urgent so I can&#39;t wait for the IT team to provide the right access, so meanwhile I came to know about bucketAV.</p><p>BucketAV is free for the first 15 days and costs 0.16 dollars per hour if you use this service. here is the link to the bucketAV <a href="https://aws.amazon.com/marketplace/pp/prodview-sykoblbsdgw2o">https://aws.amazon.com/marketplace/pp/prodview-sykoblbsdgw2o</a> the setup is also very easy so you can follow the setup guide given in the link <a href="https://bucketav.com/help/setup-guide/">https://bucketav.com/help/setup-guide/</a>.</p><p>After installing it I found that it can only scan that bucket whose size is 5 GB. We have data of around 25 GB. Now problem is to make a small block of 5 GB and then scan it. I used certain steps to do this since I am using an EMR cluster for my workplace so I used some steps to optimize the cost as well.</p><p>STEP 1: Start some uniform group clusters so that you can optimize your AWS cost. since we need to perform some operations so we don&#39;t need a large cluster.</p><p>STEP 2: Start copying the file from our bucket to EC instances using the following command aws</p><p>s3 cp s3 bucket link -d path of the folder on the instance you want to copy.</p><p>STEP 3: Now unzip the folder using unzip “file.zip”</p><p>STEP 4: After unzipping we need to split the large 25 GB file into 3.5GB(Fix the block size as per your convenience ). we use the following command to do this</p><p>split “/home/folder name/Record_A.csv” — additional-suffix=.csv -b 3584m</p><p>here 3584m is representing 3.5 GB into a byte. and the split file named xaa,xab,xac, etc.., automatically by the machine itself as a split result.</p><p>STEP 5: We need to compress the split file and do zipping of each block, why do I do this step? because this is a request made by the customer, so for doing so I used</p><p>zip -j “/folder name(where I want to zip)/xaa.zip” “/folder name(where I stored the split result/xaa.csv”</p><p>STEP 6: I have to upload this small zip file to the s3 bucket.</p><p>AWS cp “from the local instance(EMR) where our zip file is stored”- d “s3 bucket where we want to store”.</p><p>STEP 7: Data stored in the s3 bucket will start tagging AV CLEAN which means the bucket is scanned and that bucket did not consist of any Viruses. I am attaching a screenshot for the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WLeNKfXS068JemuhaGMVyg.png" /></figure><p>STEP 8: After tagging each file to clean, a log file is generated where the information of tagging is given for each file.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bac333954ced" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>