Running Data Analyzer queries using Tableau

Once you have connected to Data Analyzer (see Connecting Tableau to the Data Analyzer), you can type your SQL queries at the presto> prompt. The CLI accepts queries that span multiple lines but your query must end with a semicolon ;

For example:

SELECT COUNT(*) FROM geospock.smallpoi.default;

Running geospatial JOIN queries

Before running a geospatial JOIN query using Data Analyzer, make sure you follow the Guidelines for using the Data Analyzer.

The following queries have been optimized for querying data on the Spatial Big Data Platform's SQL engine, Data Analyzer:

SELECT *
FROM geospock.largetable.default AS large
JOIN geospock.smalltable.default AS small
ON ST_DISTANCE(ST_POINT(small.longitude, small.latitude), ST_POINT(large.longitude, large.latitude)) < 0.0005;

and

SELECT *
FROM geospock.largetable.default AS large,
geospock.smalltable.default AS small
WHERE ST_DISTANCE(ST_POINT(small.longitude, small.latitude), ST_POINT(large.longitude, large.latitude)) < 0.0005;

You can save your query results to a table, rather than streaming them back to the client, so that you can perform further queries on the data; see Saving query results to an external table for instructions on how to do this.