{"id":134,"date":"2021-02-22T14:33:19","date_gmt":"2021-02-22T19:33:19","guid":{"rendered":"https:\/\/www.aerv.us\/?p=134"},"modified":"2021-04-15T16:13:32","modified_gmt":"2021-04-15T21:13:32","slug":"pdqb","status":"publish","type":"post","link":"https:\/\/www.aerv.us\/index.php\/202102\/pdqb\/","title":{"rendered":"Python Dynamic Query Builder"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In this write-up we&#8217;ll describe our proprietary Python Dynamic Query Builder (<strong>PDQB<\/strong>), and provide a use-case example as well.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First let\u2019s define what is meant by \u201cDynamic Query Builder\u201d. Imagine a simple SQL query such as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>SELECT column1 FROM table1 WHERE column2 IS NOT NULL<\/strong><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now imagine that you want to run the same SQL query but for hundreds of <strong>tables<\/strong> in your Database. Even further, imagine that you want to change the <strong>column<\/strong> names and <strong>where<\/strong> conditions depending on each table name. Normally this would be done manually \u2013 but with our <strong>PDQB<\/strong>, this process gets automated, with each query string being constructed by Python, and the results are dumped as csv file(s). Of course, this is a simple example. In reality the constructed queries can be highly complex, and our code is <strong>not limited to SQL Databases<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">What can you do with <strong>PDQB<\/strong>? A lot actually, since now one can conduct all sorts of Database Mining, data discovery, and most importantly cross-table relationship building. This is highly important for Enterprise Big Data Warehouses that initially did not implement naming standardization (bad pre-planning) for tables and columns, and have no documentation for table relationships. In such cases, this tool can assist with relationship discovery and provide a list of most likely possible pathways.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now it\u2019s time for a use-case example: Building a Data Dictionary for self-service analytics of an Enterprise Data Warehouse that has zero table or column name annotation, almost zero relationship documentation, and many columns\/fields that have Null or insignificant data. Here is the outline of the steps that would solve this problem or at least greatly reduce the problem complexity.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1. Using PDQB<\/strong>, create an inventory of table names, column names, field type, etc from the Information Schema (or the NoSQL equivalent) records.<br><strong>2. Review PDQB<\/strong> suggested metrics such as; Number of Records, Max\/Min (for Numeric type), Count of Null, to determine which metrics are of highest significance for your particular case.<br><strong>3. Using PDQB<\/strong>, employ selected metrics to build the meta-data catalog. Detect and drop insignificant or useless tables and columns and exclude from any further consideration.<br><strong>4. Employ<\/strong> a combination of comparative methods such as fuzzy\/NLP for Text fields or statistical for Numeric fields to suggest table\/column relationships across the Data Warehouse.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, to augment the technology process described above, we are working on table\/column relationship discovery from a different approach. This novel angle however, still employs our highly innovative and foundational <strong>PDQB<\/strong> tool.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this write-up we&#8217;ll describe our proprietary Python Dynamic Query Builder (PDQB), and provide a use-case example as well. First let\u2019s define what is meant by \u201cDynamic Query Builder\u201d. Imagine [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":143,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[2,4],"tags":[13,12,11,10],"class_list":["post-134","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-digital-transformation","category-strategydata","tag-data-dictionnary","tag-data-mining","tag-dynamic-query-builder","tag-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Python Dynamic Query Builder - AER Ventures<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.aerv.us\/index.php\/202102\/pdqb\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Dynamic Query Builder - AER Ventures\" \/>\n<meta property=\"og:description\" content=\"In this write-up we&#8217;ll describe our proprietary Python Dynamic Query Builder (PDQB), and provide a use-case example as well. First let\u2019s define what is meant by \u201cDynamic Query Builder\u201d. Imagine [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.aerv.us\/index.php\/202102\/pdqb\/\" \/>\n<meta property=\"og:site_name\" content=\"AER Ventures\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-22T19:33:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-15T21:13:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.aerv.us\/wp-content\/uploads\/2021\/02\/post2.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"105\" \/>\n\t<meta property=\"og:image:height\" content=\"105\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Raif S. Berent\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Raif S. Berent\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.aerv.us\\\/index.php\\\/202102\\\/pdqb\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.aerv.us\\\/index.php\\\/202102\\\/pdqb\\\/\"},\"author\":{\"name\":\"Raif S. Berent\",\"@id\":\"https:\\\/\\\/www.aerv.us\\\/#\\\/schema\\\/person\\\/6d92629a11c296ec29886372d6e575c9\"},\"headline\":\"Python Dynamic Query Builder\",\"datePublished\":\"2021-02-22T19:33:19+00:00\",\"dateModified\":\"2021-04-15T21:13:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.aerv.us\\\/index.php\\\/202102\\\/pdqb\\\/\"},\"wordCount\":408,\"publisher\":{\"@id\":\"https:\\\/\\\/www.aerv.us\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.aerv.us\\\/index.php\\\/202102\\\/pdqb\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.aerv.us\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/post2.jpeg\",\"keywords\":[\"Data Dictionnary\",\"Data Mining\",\"Dynamic Query builder\",\"Python\"],\"articleSection\":[\"Digital Transformation\",\"Strategy&amp;Data\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.aerv.us\\\/index.php\\\/202102\\\/pdqb\\\/\",\"url\":\"https:\\\/\\\/www.aerv.us\\\/index.php\\\/202102\\\/pdqb\\\/\",\"name\":\"Python Dynamic Query Builder - AER Ventures\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.aerv.us\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.aerv.us\\\/index.php\\\/202102\\\/pdqb\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.aerv.us\\\/index.php\\\/202102\\\/pdqb\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.aerv.us\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/post2.jpeg\",\"datePublished\":\"2021-02-22T19:33:19+00:00\",\"dateModified\":\"2021-04-15T21:13:32+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.aerv.us\\\/index.php\\\/202102\\\/pdqb\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.aerv.us\\\/index.php\\\/202102\\\/pdqb\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.aerv.us\\\/index.php\\\/202102\\\/pdqb\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.aerv.us\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/post2.jpeg\",\"contentUrl\":\"https:\\\/\\\/www.aerv.us\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/post2.jpeg\",\"width\":105,\"height\":105,\"caption\":\"Python Dynamic Query Builder\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.aerv.us\\\/index.php\\\/202102\\\/pdqb\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.aerv.us\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python Dynamic Query Builder\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.aerv.us\\\/#website\",\"url\":\"https:\\\/\\\/www.aerv.us\\\/\",\"name\":\"AER Ventures\",\"description\":\"Digital Transformation and Data Strategy for Enterprise Resilience\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.aerv.us\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.aerv.us\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.aerv.us\\\/#organization\",\"name\":\"AER Ventures\",\"url\":\"https:\\\/\\\/www.aerv.us\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.aerv.us\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.aerv.us\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/favicon.jpg\",\"contentUrl\":\"https:\\\/\\\/www.aerv.us\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/favicon.jpg\",\"width\":32,\"height\":32,\"caption\":\"AER Ventures\"},\"image\":{\"@id\":\"https:\\\/\\\/www.aerv.us\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/company\\\/aer-ventures\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.aerv.us\\\/#\\\/schema\\\/person\\\/6d92629a11c296ec29886372d6e575c9\",\"name\":\"Raif S. Berent\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d45edd02cf6b60c616404120897c212a00485499b822e73704d496ca255bc85e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d45edd02cf6b60c616404120897c212a00485499b822e73704d496ca255bc85e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d45edd02cf6b60c616404120897c212a00485499b822e73704d496ca255bc85e?s=96&d=mm&r=g\",\"caption\":\"Raif S. Berent\"},\"sameAs\":[\"https:\\\/\\\/www.aerv.us\"],\"url\":\"https:\\\/\\\/www.aerv.us\\\/index.php\\\/author\\\/rsb\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python Dynamic Query Builder - AER Ventures","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.aerv.us\/index.php\/202102\/pdqb\/","og_locale":"en_US","og_type":"article","og_title":"Python Dynamic Query Builder - AER Ventures","og_description":"In this write-up we&#8217;ll describe our proprietary Python Dynamic Query Builder (PDQB), and provide a use-case example as well. First let\u2019s define what is meant by \u201cDynamic Query Builder\u201d. Imagine [&hellip;]","og_url":"https:\/\/www.aerv.us\/index.php\/202102\/pdqb\/","og_site_name":"AER Ventures","article_published_time":"2021-02-22T19:33:19+00:00","article_modified_time":"2021-04-15T21:13:32+00:00","og_image":[{"width":105,"height":105,"url":"https:\/\/www.aerv.us\/wp-content\/uploads\/2021\/02\/post2.jpeg","type":"image\/jpeg"}],"author":"Raif S. Berent","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Raif S. Berent","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.aerv.us\/index.php\/202102\/pdqb\/#article","isPartOf":{"@id":"https:\/\/www.aerv.us\/index.php\/202102\/pdqb\/"},"author":{"name":"Raif S. Berent","@id":"https:\/\/www.aerv.us\/#\/schema\/person\/6d92629a11c296ec29886372d6e575c9"},"headline":"Python Dynamic Query Builder","datePublished":"2021-02-22T19:33:19+00:00","dateModified":"2021-04-15T21:13:32+00:00","mainEntityOfPage":{"@id":"https:\/\/www.aerv.us\/index.php\/202102\/pdqb\/"},"wordCount":408,"publisher":{"@id":"https:\/\/www.aerv.us\/#organization"},"image":{"@id":"https:\/\/www.aerv.us\/index.php\/202102\/pdqb\/#primaryimage"},"thumbnailUrl":"https:\/\/www.aerv.us\/wp-content\/uploads\/2021\/02\/post2.jpeg","keywords":["Data Dictionnary","Data Mining","Dynamic Query builder","Python"],"articleSection":["Digital Transformation","Strategy&amp;Data"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.aerv.us\/index.php\/202102\/pdqb\/","url":"https:\/\/www.aerv.us\/index.php\/202102\/pdqb\/","name":"Python Dynamic Query Builder - AER Ventures","isPartOf":{"@id":"https:\/\/www.aerv.us\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.aerv.us\/index.php\/202102\/pdqb\/#primaryimage"},"image":{"@id":"https:\/\/www.aerv.us\/index.php\/202102\/pdqb\/#primaryimage"},"thumbnailUrl":"https:\/\/www.aerv.us\/wp-content\/uploads\/2021\/02\/post2.jpeg","datePublished":"2021-02-22T19:33:19+00:00","dateModified":"2021-04-15T21:13:32+00:00","breadcrumb":{"@id":"https:\/\/www.aerv.us\/index.php\/202102\/pdqb\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.aerv.us\/index.php\/202102\/pdqb\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.aerv.us\/index.php\/202102\/pdqb\/#primaryimage","url":"https:\/\/www.aerv.us\/wp-content\/uploads\/2021\/02\/post2.jpeg","contentUrl":"https:\/\/www.aerv.us\/wp-content\/uploads\/2021\/02\/post2.jpeg","width":105,"height":105,"caption":"Python Dynamic Query Builder"},{"@type":"BreadcrumbList","@id":"https:\/\/www.aerv.us\/index.php\/202102\/pdqb\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.aerv.us\/"},{"@type":"ListItem","position":2,"name":"Python Dynamic Query Builder"}]},{"@type":"WebSite","@id":"https:\/\/www.aerv.us\/#website","url":"https:\/\/www.aerv.us\/","name":"AER Ventures","description":"Digital Transformation and Data Strategy for Enterprise Resilience","publisher":{"@id":"https:\/\/www.aerv.us\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.aerv.us\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.aerv.us\/#organization","name":"AER Ventures","url":"https:\/\/www.aerv.us\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.aerv.us\/#\/schema\/logo\/image\/","url":"https:\/\/www.aerv.us\/wp-content\/uploads\/2020\/12\/favicon.jpg","contentUrl":"https:\/\/www.aerv.us\/wp-content\/uploads\/2020\/12\/favicon.jpg","width":32,"height":32,"caption":"AER Ventures"},"image":{"@id":"https:\/\/www.aerv.us\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.linkedin.com\/company\/aer-ventures\/"]},{"@type":"Person","@id":"https:\/\/www.aerv.us\/#\/schema\/person\/6d92629a11c296ec29886372d6e575c9","name":"Raif S. Berent","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/d45edd02cf6b60c616404120897c212a00485499b822e73704d496ca255bc85e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d45edd02cf6b60c616404120897c212a00485499b822e73704d496ca255bc85e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d45edd02cf6b60c616404120897c212a00485499b822e73704d496ca255bc85e?s=96&d=mm&r=g","caption":"Raif S. Berent"},"sameAs":["https:\/\/www.aerv.us"],"url":"https:\/\/www.aerv.us\/index.php\/author\/rsb\/"}]}},"_links":{"self":[{"href":"https:\/\/www.aerv.us\/index.php\/wp-json\/wp\/v2\/posts\/134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aerv.us\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aerv.us\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aerv.us\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aerv.us\/index.php\/wp-json\/wp\/v2\/comments?post=134"}],"version-history":[{"count":0,"href":"https:\/\/www.aerv.us\/index.php\/wp-json\/wp\/v2\/posts\/134\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.aerv.us\/index.php\/wp-json\/wp\/v2\/media\/143"}],"wp:attachment":[{"href":"https:\/\/www.aerv.us\/index.php\/wp-json\/wp\/v2\/media?parent=134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aerv.us\/index.php\/wp-json\/wp\/v2\/categories?post=134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aerv.us\/index.php\/wp-json\/wp\/v2\/tags?post=134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}