<?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 Ravi Mistry on Medium]]></title>
        <description><![CDATA[Stories by Ravi Mistry on Medium]]></description>
        <link>https://medium.com/@raavimistry?source=rss-a2c11dc80c68------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*1pwm4yS6uSiFXMmAfjYGjQ.jpeg</url>
            <title>Stories by Ravi Mistry on Medium</title>
            <link>https://medium.com/@raavimistry?source=rss-a2c11dc80c68------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 18:44:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@raavimistry/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[Non-breaking space in BigQuery]]></title>
            <link>https://medium.com/@raavimistry/non-breaking-space-in-bigquery-4e5342ea03ac?source=rss-a2c11dc80c68------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e5342ea03ac</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[data-quality-management]]></category>
            <category><![CDATA[bigquery]]></category>
            <category><![CDATA[google]]></category>
            <dc:creator><![CDATA[Ravi Mistry]]></dc:creator>
            <pubDate>Tue, 21 Feb 2023 14:47:51 GMT</pubDate>
            <atom:updated>2023-02-21T14:47:51.244Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Disclaimer:</strong> <em>Views expressed in the </em>article<em> belong solely to the author, and not necessarily to the author’s employer or organisation.</em></p><p>In large enterprise data warehouses, some errors can creep in even with strict implementation of a data quality framework. Non-breaking space in string data belongs to one of such categories. Such ambiguous data can introduce flaws in critical reporting.</p><blockquote>In word processing, a <strong>non-breaking space</strong>, is a space character that prevents an automatic line break at its position.</blockquote><p><a href="https://en.wikipedia.org/wiki/Non-breaking_space">Non-breaking space - Wikipedia</a></p><p>Let’s take below example where we are looking for product_id from product table for product_name ‘OnePlus 11’. Despite of data present in the table, BigQuery returns 0 rows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tzrdzR0PHh9cXStW-TrwLA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RIxd7H4ZUAndVwJcMX8YGA.png" /></figure><h3>How to handle non-breaking space in BigQuery</h3><p>Use translate function in business use case query that will help in replacing non-breaking space with whitespace in string in your ELT pipeline while moving data from raw to refined/business layer to avoid such issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZWmelTSRS8y1uW1KpcTl3g.png" /></figure><h3>More to come</h3><p>Thank you for reading, and please look forward to future posts. <strong>Please</strong> do <strong>support</strong> me by <strong>following.</strong></p><p>I would love to hear from you about this blog that you’d like discussed, or if you have any comments on the post! Feel free to reach out to me on <a href="http://www.linkedin.com/in/ravi-mistry-0a425437">Linkedin</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e5342ea03ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why you need to stop using gsutil]]></title>
            <link>https://medium.com/@raavimistry/why-you-need-to-stop-using-gsutil-ff8d5acab6c7?source=rss-a2c11dc80c68------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff8d5acab6c7</guid>
            <category><![CDATA[google-cloud-storage]]></category>
            <category><![CDATA[gsutil]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[gcp-data-engineer]]></category>
            <dc:creator><![CDATA[Ravi Mistry]]></dc:creator>
            <pubDate>Wed, 01 Feb 2023 16:29:53 GMT</pubDate>
            <atom:updated>2023-02-01T16:29:53.218Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Disclaimer:</strong> <em>Views expressed in the </em>article<em> belong solely to the author, and not necessarily to the author’s employer or organisation.</em></p><p>Many of us observed performance slowness issue of gsutil during upload of files to Google Cloud Storage despite of following gsutil’s recommandation i.e. “gsutil -m cp” command or using parallel_composite_upload_threshold parameter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*fQ7pfe9GKiyjzcyZpnmPEw.png" /></figure><h3>Reason behind slowness</h3><p>gsutil use crcmod module which automatically performs integrity checks (CRC ) on all uploads and downloads. The crcmod module contains a pure-Python implementation of CRC32C, but using it results in very poor performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/266/1*Xu2YSumzs3p0oiYneAq5bw.jpeg" /><figcaption><strong>gsutil performance</strong></figcaption></figure><h3><strong>Introducing gcloud storage</strong></h3><p>To resolve gsutil performance issue, Google Cloud Platform introduced a new set of Cloud Storage command in Cloud SDK, i.e. <strong>gcloud storage</strong>, which has been designed to be fast by default.</p><p><a href="https://cloud.google.com/sdk/gcloud/reference/storage">https://cloud.google.com/sdk/gcloud/reference/storage</a></p><p>gcloud storage uses faster hashing tools for CRC32C data integrity checking that skip the complicated setup required for gsutil. Also, in gcloud storage, all operations happen in parallel since it treats task management as a <a href="https://en.wikipedia.org/wiki/Graph_theory">graph problem</a>.</p><h3>Transition from gsutil to gcloud storage</h3><p>To ease transition to this new CLI, gsutil provides a shim that translates your gsutil commands to gcloud storage commands.</p><p>To enable it , add use_gcloud_storage=True in the .boto config file under the [GSUtil] section:</p><pre>[GSUtil]<br>use_gcloud_storage=True</pre><h3>How to access .boto config file</h3><p>The boto configuration file contains values that control how gsutil behaves . Use gsutil version -l command that will provide you location of boto file.</p><pre>raavimistry@cloudshell:~ (test-workspace)$ gsutil version -l<br>gsutil version: 5.17<br>checksum: 73ec35fa8706dcc7850a8fc7c6c2caa3 (OK)<br>boto version: 2.49.0<br>python version: 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110]<br>OS: Linux 5.15.65+<br>multiprocessing available: True<br>using cloud sdk: True<br>pass cloud sdk credentials to gsutil: True<br>config path(s): /home/raavimistry/.boto<br>gsutil path: /usr/lib/google-cloud-sdk/bin/gsutil<br>compiled crcmod: False<br>installed via package manager: False<br>editable install: False<br>shim enabled: False</pre><h3>More to come</h3><p>Thank you for reading, and please look forward to future posts.</p><p>I would love to hear from you about this blog that you’d like discussed, or if you have any comments on the post! Feel free to reach out to me on <a href="http://www.linkedin.com/in/ravi-mistry-0a425437">Linkedin</a>.</p><h3><strong>Au revoir!!</strong></h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff8d5acab6c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BigQuery data transformation pipeline using Workflows— Part I]]></title>
            <link>https://medium.com/@raavimistry/bigquery-data-transformation-pipeline-using-workflow-s-part-i-97820f9f98bd?source=rss-a2c11dc80c68------2</link>
            <guid isPermaLink="false">https://medium.com/p/97820f9f98bd</guid>
            <category><![CDATA[bigquery]]></category>
            <category><![CDATA[google-big-query]]></category>
            <category><![CDATA[gcp-workflows]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Ravi Mistry]]></dc:creator>
            <pubDate>Sun, 07 Aug 2022 14:57:21 GMT</pubDate>
            <atom:updated>2022-08-07T15:02:04.060Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Disclaimer:</strong> <em>Views expressed in the </em>article<em> belong solely to the author, and not necessarily to the author’s employer or organization.</em></p><p>In general, when you migrate from on-premises data warehouses to cloud data warehouses, you want to prefer ELT over ETL where possible, which is a cost-effective process to manage analytical data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GO2BcP0tYyozm29puk_r8Q.png" /></figure><p>BigQuery is very scalable and can handle large transformations. ELT is also quite a simpler, because you could write business use case specific SQL queries to transform data by referring raw/staging tables and then publishing to reporting tables.</p><h3>Inception</h3><p>This blog series will be divided into following sections and we will be going to discuss how to use Workflows to link a series of Google Cloud services together to create a flexible, serverless framework, i.e. <strong><em>BigQuery data transformation pipeline</em></strong></p><ul><li>Pipeline architecture/process flow</li><li>Development, deployment and execution</li><li>Operational activities</li></ul><p>The following diagram shows both an overview of the process as well as a visualization of the final workflow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nB5ccKYAgXSPPdL875jRkg.png" /><figcaption>Detailed process flow diagram</figcaption></figure><p>It’s meta driven framework that will read the configuration from BQ process meta table based on runtime arguments provided during the invocation of workflow.</p><p>If configuration is present then invoke GCS API to retrieve the BQ sql file from GCS bucket and submit it for execution via BQ API. BQ process log table used to capture and maintain the process execution detail for support activities.</p><h3>Want to learn basic of Workflows</h3><p>You can refer below blog/cheat sheet guide if you haven’t use Workflows.</p><ul><li><a href="https://cloud.google.com/blog/products/application-development/get-to-know-google-cloud-workflows">Get to know Google Cloud Workflows | Google Cloud Blog</a></li><li><a href="https://cloud.google.com/workflows/docs/reference/syntax/syntax-cheat-sheet">Syntax cheat sheet | Workflows | Google Cloud</a></li></ul><h3>More to come</h3><p>Thank you for reading, and please look forward to future posts. I would love to hear from you about this blog that you’d like discussed, or if you have any comments on the post! Feel free to reach out to me on <a href="http://www.linkedin.com/in/ravi-mistry-0a425437">Linkedin</a>.</p><p><strong>Au revoir!!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97820f9f98bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A new ELT pipeline — Pub/Sub to BigQuery]]></title>
            <link>https://medium.com/@raavimistry/a-new-elt-pipeline-pub-sub-to-bigquery-6c6cfb5daffa?source=rss-a2c11dc80c68------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c6cfb5daffa</guid>
            <category><![CDATA[google-big-query]]></category>
            <category><![CDATA[google-dataflow]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[google-pubsub]]></category>
            <category><![CDATA[live-streaming-data]]></category>
            <dc:creator><![CDATA[Ravi Mistry]]></dc:creator>
            <pubDate>Fri, 29 Jul 2022 11:57:32 GMT</pubDate>
            <atom:updated>2022-07-29T12:01:06.799Z</atom:updated>
            <content:encoded><![CDATA[<h3>A new ELT pipeline — Pub/Sub to BigQuery</h3><p><strong>Disclaimer:</strong> <em>Views expressed in the </em>article<em> belong solely to the author, and not necessarily to the author’s employer or organization.</em></p><p>What if I told you that now you can process the streaming data from Pub/Sub to Google BigQuery without creating data pipeline using dataflow. Isn’t that interesting??</p><p>Google Cloud had recently introduce new type of Pub/Sub subscription i.e. <a href="https://cloud.google.com/pubsub/docs/bigquery"><strong>BigQuery subscription</strong></a><strong> </strong>that writes messages to an existing BigQuery table as they are received. This can be used as an alternative for simple data ingestion pipelines that often use Dataflow to write to BigQuery.</p><blockquote>Note — This pipeline is best suitable for use cases where you want raw data with no transformations to be exported to BigQuery and the latest data can be used immediately for critical business reporting.</blockquote><h3><strong>Steps to design data pipeline</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hzqqL5AQYo2vJR6SpKPapA.png" /><figcaption>Pub/Sub to BigQuery data pipeline</figcaption></figure><ol><li>Create a table in BigQuery and assign write permission to the BigQuery table to Pub/Sub service account.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RcSu67kvlhf1s7UzztMZGQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q1BOsMo1CIc8C6nv-9-bpQ.png" /><figcaption>Granting BigQuery Data Editor role to Pub/Sub Service Account</figcaption></figure><p>2. Define schemas for source message which will act as contract between publisher and subscriber that Pub/Sub will enforce.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Q3IYi98HiI3kUOSLSpyPw.png" /><figcaption>Defining source data schema</figcaption></figure><p>Reference — <a href="https://cloud.google.com/pubsub/docs/schemas?_ga=2.141442418.-1552348173.1659076766">Creating and managing schemas</a></p><p>3. Create a Pub/Sub topic and associate schema which was define in step 2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r_tSZdhQP3gQfFxiyjaMpQ.png" /></figure><p>4. Create BigQuery subscription using Export to BigQuery option within Pub/Sub topic and specify BigQuery table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WXM-882hIMCm9hrRM_-EVA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*RCpGwtuC3bcB7a3MPS_3-g.png" /><figcaption>Other options can be checked as per business requirement</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Iw-NlV6AjPZghLLh2eeRw.png" /><figcaption>BigQuery subscription</figcaption></figure><p>5. Publish message on Pub/Sub topic</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m2EW-7deEFHodSF7FZF2gg.png" /></figure><p>6. Validate the data in BigQuery table</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*ouO3RWxPKguBkXzm3mKOFA.png" /></figure><blockquote>Ingestion from Pub/Sub’s BigQuery subscription into BigQuery costs $50/TiB based on read (subscribe throughput) from the subscription which cheaper than dataflow pipeline.</blockquote><p>Before implementing it for production use , please ensure there is compatibility between the schema of the Pub/Sub topic and the BigQuery table. For more detail, please refer below documentation —</p><pre>https://cloud.google.com/pubsub/docs/bigquery?_ga=2.146292340.-1552348173.1659076766#schema_compatibility</pre><p>I hope you have enjoyed reading this post. If you are looking for more detail, feel free to reach out to me on <a href="http://www.linkedin.com/in/ravi-mistry-0a425437">Linkedin</a>.</p><p><strong>Namaste!!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c6cfb5daffa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rollback cloud function deployment]]></title>
            <link>https://medium.com/@raavimistry/rollback-cloud-function-deployment-ee9c2b3721d0?source=rss-a2c11dc80c68------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee9c2b3721d0</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[rollbacks]]></category>
            <category><![CDATA[cloud-functions]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Ravi Mistry]]></dc:creator>
            <pubDate>Mon, 30 May 2022 15:42:57 GMT</pubDate>
            <atom:updated>2022-05-30T15:51:16.775Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Disclaimer:</strong> <em>Views expressed in the </em>article<em> belong solely to the author, and not necessarily to the author’s employer or organization.</em></p><p>Have you come across a situation where you have accidentally lost the cloud function source code and want to roll back to the previous version or you are using Inline Editor option for deploying the Cloud Function i.e., doesn’t have CI/CD pipeline to deploy the Cloud function — source code from a source<br>repository like GitHub/Bitbucket or Google Cloud Source Repository?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1A2toPGG80d_2PxOeGho9Q.jpeg" /></figure><p>In this blog, we are going to talk about how to retrieve an old version of a Google Cloud function source code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*RPZhRuPLA27r03JSswmdXA.png" /><figcaption>Cloud function version detail</figcaption></figure><p>When you deploy a new version of cloud function, Cloud function internally creates a bucket —<strong> gcf-source- [id]-[region of the function].</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*TXY4kkcPvPCu3gZYzdikBg.png" /><figcaption>gcf-sources-537167466082-us-central1</figcaption></figure><p>This bucket is managed by Google Cloud Functions, which preserves the source code and data uploaded with your function. <strong>However, this bucket can only store the last 2 deployed versions.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Jl-v0mF72DzfJcN51n-0Yw.png" /><figcaption>Within a bucket , cloud function specify folder has been created with will hold source code</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*PWGKadvMzBdT0D50UZyDqA.png" /><figcaption>folder holds 2 version</figcaption></figure><p>In order to rollback an old version of a Cloud function, you can download the code from the required version folder and redeploy the function with it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*BlZS7Kscln0KLvrZXeVCRQ.png" /><figcaption>zip file contains source code for version 2</figcaption></figure><p>I hope you have enjoyed reading this post. If you are looking for more detail, feel free to reach out to me on <a href="http://www.linkedin.com/in/ravi-mistry-0a425437">Linkedin</a>.</p><p><strong>Au revoir!!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee9c2b3721d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Load Fixed-width file into a BigQuery table]]></title>
            <link>https://medium.com/@raavimistry/load-fixed-width-file-into-a-bigquery-table-668a410d377e?source=rss-a2c11dc80c68------2</link>
            <guid isPermaLink="false">https://medium.com/p/668a410d377e</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[google-cloud-functions]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[google-big-query]]></category>
            <dc:creator><![CDATA[Ravi Mistry]]></dc:creator>
            <pubDate>Sat, 14 May 2022 08:54:52 GMT</pubDate>
            <atom:updated>2022-05-14T09:00:43.804Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Disclaimer:</strong> <em>Views expressed in the </em>article<em> belong solely to the author, and not necessarily to the author’s employer or organisation.</em></p><p>At present, Google BigQuery <strong>doesn’t support loading fixed-width files</strong> into a BigQuery table. In this blog we are going to talk about building a data processing pipeline using cloud function to process fixed-width data files instead of using compute resource-intensive Google Cloud Services like dataflow or dataproc.</p><blockquote>You can load source file formats like Avro, CSV, JSON, ORC, or Parquet from Cloud Storage to a BigQuery table.</blockquote><h3>Data Pipeline Design</h3><p>There are many ways to implement this requirement, however in this blog we want to keep it as Serverless as possible and write as little code as possible.</p><p>Pipeline is fairly simple having following steps —</p><ol><li>Cloud Storage emits event — finalize/create when file lands to bucket</li><li>Cloud function triggered based on event and loads file into BigQuery</li></ol><blockquote>In cloud function, we read a file (in memory) by using the pandas <strong>read_fwf()</strong> function — fwf stands for fixed-width lines into DataFrame , parses the file by position into columns, and then load contents of a pandas DataFrame into BigQuery table via <strong><em>load_table_from_dataframe() </em></strong>function.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s-a25QlnUek6nGmPZvCVdA.png" /></figure><p><a href="https://googlecloudcheatsheet.withgoogle.com/architecture"><em>Google Cloud architecture diagramming tool</em></a><em> that helps you to create flow diagrams that meet the requirements for your business use case.</em></p><h3>Data Pipeline Code</h3><p>Sample fixed width file —</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9f7a5629a67a25842b217b2b0ff5112f/href">https://medium.com/media/9f7a5629a67a25842b217b2b0ff5112f/href</a></iframe><p>Cloud function — main.py</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/36381f26fbcf3189353b35567cf93c01/href">https://medium.com/media/36381f26fbcf3189353b35567cf93c01/href</a></iframe><p>Cloud function — requirements.txt</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/822ecee5100317f43cf994cb70692f82/href">https://medium.com/media/822ecee5100317f43cf994cb70692f82/href</a></iframe><p>For production use-case below are the additional steps needs to be consider —</p><ol><li>Dynamically retrieving table schema based on file name to derive column header list</li><li>Add logic to handle various data type formats</li><li>Introduce data provenance for data pipeline i.e. tag unique id to source file and audit column-like record load timestamp.</li><li>Email/Slack channel notification</li></ol><p>I hope you have enjoyed reading this post. If you are looking for more detail, feel free to reach out to me on <a href="http://www.linkedin.com/in/ravi-mistry-0a425437">Linkedin</a>.</p><p><strong>Au revoir!!</strong></p><h3>References</h3><ul><li><a href="https://cloud.google.com/bigquery/docs/samples/bigquery-load-table-dataframe">Load data from DataFrame | BigQuery | Google Cloud</a></li><li><a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_fwf.html">pandas.read_fwf - pandas 1.4.2 documentation</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=668a410d377e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring BigQuery Query Types]]></title>
            <link>https://medium.com/@raavimistry/exploring-bigquery-query-types-de1a2814f2c8?source=rss-a2c11dc80c68------2</link>
            <guid isPermaLink="false">https://medium.com/p/de1a2814f2c8</guid>
            <category><![CDATA[data-engineer]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[query-optimization]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[bigquery]]></category>
            <dc:creator><![CDATA[Ravi Mistry]]></dc:creator>
            <pubDate>Sat, 07 May 2022 10:47:13 GMT</pubDate>
            <atom:updated>2022-05-07T11:15:45.309Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Disclaimer:</strong> <em>Views expressed in the </em>article<em> belong solely to the author, and not necessarily to the author’s employer or organisation.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*UMCEhVYLBc4kPf3qox_CEw.png" /></figure><p>Have you encountered concurrent queries quota errors while executing queries in BigQuery.</p><pre>Exceeded rate limits: too many concurrent queries for this project_and_region</pre><p>As per Google BigQuery documentation, if you are concurrently running <strong>interactive </strong>queries beyond the assigned limit for a project, you might encounter this error. <em>You can run up to 100 concurrent interactive queries.</em></p><p>So, in this article we are going to talk about BigQuery Query Types and best practices to minimize the quota limitation.</p><h3>BigQuery Query Types</h3><p>BigQuery supports two types of queries —</p><ul><li>Interactive queries</li><li>Batch queries</li></ul><p><strong>Interactive queries</strong></p><p>Interactive queries means that the query is executed as soon as possible.By default, BigQuery runs all queries jobs as Interactive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VaTWhuGc5RtFf958-dtYuQ.jpeg" /><figcaption>Job information — Interactive query</figcaption></figure><p><strong>Batch queries</strong></p><p>Under this BigQuery queues query , and starts the query as soon as <a href="https://cloud.google.com/bigquery/docs/reservations-intro">idle resources</a> are available.</p><p>To switch from Interactive to Batch Job priority, Go to Query settings option, under resource management you will find the option to choose <strong>BATCH</strong> as Job priority.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YNhneacRhiBs7fKxOfvQ0A.jpeg" /><figcaption>Switching to Batch Job priority</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B53NMlPXxCObQM_7g1eREg.jpeg" /><figcaption>Job information — Batch query</figcaption></figure><h3><strong>Best practice to minimize concurrent queries quota errors</strong></h3><p><strong>1- Use jobs with batch priority</strong></p><p>Batch queries don’t count towards concurrent rate limit, which can make it easier to start many queries at once. Use batch priority whenever possible.</p><p>Define your QueryJobConfig to use BATCH priority.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bf9f9dddc9d5b16311569f7d98c63ee3/href">https://medium.com/media/bf9f9dddc9d5b16311569f7d98c63ee3/href</a></iframe><p><strong>2- Introduce wait time</strong></p><p>Distribute queries execution in a ways that it will not going to run at same time by introducing random wait time.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/876ad89083a8936a15ed89ac0685d813/href">https://medium.com/media/876ad89083a8936a15ed89ac0685d813/href</a></iframe><p><strong>3- Increase quota limits</strong></p><p>Contact Google BigQuery Support team to increase the quota limits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*kgPSuZMiW4Cg0kLCcdE3qA.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de1a2814f2c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>