Skip to content

Commit

Permalink
Deployed a9ef461 with MkDocs version: 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
baklarz committed May 9, 2024
1 parent a82eba6 commit ea90c72
Show file tree
Hide file tree
Showing 31 changed files with 444 additions and 21,523 deletions.
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

75 changes: 0 additions & 75 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -265,79 +265,4 @@
<lastmod>2024-05-09</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2024-05-09</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2024-05-09</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2024-05-09</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2024-05-09</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2024-05-09</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2024-05-09</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2024-05-09</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2024-05-09</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2024-05-09</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2024-05-09</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2024-05-09</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2024-05-09</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2024-05-09</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2024-05-09</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2024-05-09</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>
Binary file modified sitemap.xml.gz
Binary file not shown.
92 changes: 56 additions & 36 deletions wxd-advanced/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1417,19 +1417,25 @@ <h1 id="advanced-functions">Advanced Functions</h1>
</ul>
<p>For a complete list see - <a href="https://prestodb.io/docs/current/functions.html">https://prestodb.io/docs/current/functions.html</a>. We will look at using a few simple examples as part of this lab.</p>
<p>Switch to the bin directory.</p>
<p><div class="highlight"><pre><span></span><code>cd /root/ibm-lh-dev/bin
<div class="admonition abstract">
<div class="highlight"><pre><span></span><code>cd /root/ibm-lh-dev/bin
</code></pre></div>
Connect to the Workshop Schema.
</div>
<p>Connect to the Workshop Schema.</p>
<div class="admonition abstract">
<div class="highlight"><pre><span></span><code>./presto-cli --catalog iceberg_data --schema workshop
</code></pre></div></p>
</code></pre></div>
</div>
<h3 id="concatenation-of-one-or-more-stringvarchar-values">Concatenation of one or more string/varchar values</h3>
<p>Note: We are using a combination of the <code>concat</code> string function and the <code>cast</code> conversion function as part of this query.
<p>Note: We are using a combination of the <code>concat</code> string function and the <code>cast</code> conversion function as part of this query.</p>
<div class="admonition abstract">
<div class="highlight"><pre><span></span><code>select
concat(cast(custkey as varchar),&#39;--&#39;,name)
from
customer
limit 2;
</code></pre></div></p>
</code></pre></div>
</div>
<pre style="font-size: small; color: darkgreen; overflow: auto">
_col0
-------------------------
Expand All @@ -1439,14 +1445,16 @@ <h3 id="concatenation-of-one-or-more-stringvarchar-values">Concatenation of one
</pre>
<h3 id="date-functions">Date functions</h3>
<p>Date functions can be used as part of the projected columns or in the predicate/where clause.
Select orders from the last 2 days.
Select orders from the last 2 days.</p>
<div class="admonition abstract">
<div class="highlight"><pre><span></span><code>select
orderdate
from
orders
where
orderdate &gt; date &#39;1998-08-02&#39; - interval &#39;2&#39; day;
</code></pre></div></p>
</code></pre></div>
</div>
<pre style="font-size: small; color: darkgreen; overflow: auto">
orderdate
------------
Expand All @@ -1464,14 +1472,16 @@ <h3 id="date-functions">Date functions</h3>
1998-08-02
(12 rows)
</pre>
<p>Number of orders by year.
<p>Number of orders by year.</p>
<div class="admonition abstract">
<div class="highlight"><pre><span></span><code>select
distinct year(orderdate), count(orderkey)
from
orders
group by
year(orderdate);
</code></pre></div></p>
</code></pre></div>
</div>
<pre style="font-size: small; color: darkgreen; overflow: auto">
_col0 | _col1
-------+-------
Expand All @@ -1492,11 +1502,13 @@ <h3 id="geospatial-functions">Geospatial functions</h3>
<li>Polygons</li>
</ul>
<h4 id="points">Points</h4>
<p>You could use <a href="https://www.latlong.net">https://www.latlong.net</a> to get the longitude/latitude given any address.
<p>You could use <a href="https://www.latlong.net">https://www.latlong.net</a> to get the longitude/latitude given any address.</p>
<div class="admonition abstract">
<div class="highlight"><pre><span></span><code>select
ST_Point(-121.748360,37.195840) as SVL,
ST_Point(-122.378952, 37.621311) as SFO;
</code></pre></div></p>
</code></pre></div>
</div>
<pre style="font-size: small; color: darkgreen; overflow: auto">
SVL | SFO
-----------------------------+-------------------------------
Expand All @@ -1505,38 +1517,42 @@ <h4 id="points">Points</h4>
</pre>

<h4 id="lines">Lines</h4>
<p>You could use <a href="https://www.latlong.net">https://www.latlong.net</a> to get the longitude/latitude for 2 points and then create a straight line from it. Below is just a small stretch of the road leading to IBM SVL campus.
<p>You could use <a href="https://www.latlong.net">https://www.latlong.net</a> to get the longitude/latitude for 2 points and then create a straight line from it. Below is just a small stretch of the road leading to IBM SVL campus.</p>
<div class="admonition abstract">
<div class="highlight"><pre><span></span><code>select
ST_LineFromText(&#39;LINESTRING (-121.74294303079807 37.19665657093434, -121.73659072815602 37.20102399761407)&#39;);
</code></pre></div></p>
</code></pre></div>
</div>
<pre style="font-size: small; color: darkgreen; overflow: auto">
_col0
-------------------------------------------------------------------------------------------
LINESTRING (-121.74294303079807 37.19665657093434, -121.73659072815602 37.20102399761407)
(1 row)
</pre>
<h4 id="polygons">Polygons</h4>
<p>You could use <a href="https://geojson.io/#map=16.39/37.196336/-121.746303">https://geojson.io/#map=16.39/37.196336/-121.746303</a> to click around and generate the coordinates for a polygon of any shape. The following is a polygon of the IBM Silicon Valley campus.
<p>You could use <a href="https://geojson.io/#map=16.39/37.196336/-121.746303">https://geojson.io/#map=16.39/37.196336/-121.746303</a> to click around and generate the coordinates for a polygon of any shape. The following is a polygon of the IBM Silicon Valley campus.</p>
<div class="admonition abstract">
<div class="highlight"><pre><span></span><code>select ST_Polygon(&#39;POLYGON (
(-121.74418635253568 37.196001834113844,
-121.74499684288966 37.19668005184322,
-121.74584008032835 37.19707784979194,
-121.74629035274705 37.197645197338105,
-121.74672425162339 37.198186455965086,
-121.74705172247337 37.19828427337538,
-121.74760023614738 37.19827775221884,
-121.74848440744239 37.19836252721197,
-121.74932764488139 37.19789300297414,
-121.75039192514376 37.19746260319114,
-121.75130884352407 37.19721479614175,
-121.75195559845278 37.1963670290329,
-121.75198015876644 37.19555185937345,
-121.7508585711051 37.19458016564036,
-121.74940132582242 37.19447582194559,
-121.74841891327239 37.1942866986312,
-121.7474446874937 37.193556286900346,
-121.74418635253568 37.196001834113844))&#39;);
</code></pre></div></p>
-121.74499684288966 37.19668005184322,
-121.74584008032835 37.19707784979194,
-121.74629035274705 37.197645197338105,
-121.74672425162339 37.198186455965086,
-121.74705172247337 37.19828427337538,
-121.74760023614738 37.19827775221884,
-121.74848440744239 37.19836252721197,
-121.74932764488139 37.19789300297414,
-121.75039192514376 37.19746260319114,
-121.75130884352407 37.19721479614175,
-121.75195559845278 37.1963670290329,
-121.75198015876644 37.19555185937345,
-121.7508585711051 37.19458016564036,
-121.74940132582242 37.19447582194559,
-121.74841891327239 37.1942866986312,
-121.7474446874937 37.193556286900346,
-121.74418635253568 37.196001834113844))&#39;);
</code></pre></div>
</div>
<pre style="font-size: small; color: darkgreen; overflow: auto">
Truncated output
------------------------------------------------------------------------------------------------------------------------------------------------------>
Expand All @@ -1551,21 +1567,25 @@ <h4 id="polygons">Polygons</h4>

Distance between SFO airport and IBM SVL</li>
</ul>
<p>We can now use geospatial functions in a nested way to find the distance between 2 points.
<p>We can now use geospatial functions in a nested way to find the distance between 2 points.</p>
<div class="admonition abstract">
<div class="highlight"><pre><span></span><code>select
ST_Distance(to_spherical_geography(ST_Point(-122.378952, 37.621311)),
to_spherical_geography(ST_Point(-121.748360,37.195840)))*0.000621371 as distance_in_miles;
</code></pre></div></p>
</code></pre></div>
</div>
<pre style="font-size: small; color: darkgreen; overflow: auto">
distance_in_miles
--------------------
45.408431373195654
(1 row)
</pre>

<p>Exit Presto.
<p>Exit Presto.</p>
<div class="admonition abstract">
<div class="highlight"><pre><span></span><code>quit;
</code></pre></div></p>
</code></pre></div>
</div>


</article>
Expand Down
Loading

0 comments on commit ea90c72

Please sign in to comment.