HEAVY.AI Docs
v8.1.0
v8.1.0
  • Welcome to HEAVY.AI Documentation
  • Overview
    • Overview
    • Release Notes
  • Installation and Configuration
    • System Requirements
      • Hardware Reference
      • Software Requirements
      • Licensing
    • Installation
      • Free Version
      • Installing on Docker
        • HEAVY.AI Installation using Docker on Ubuntu
      • Installing on Ubuntu
        • HEAVY.AI Installation on Ubuntu
        • Install NVIDIA Drivers and Vulkan on Ubuntu
      • Installing on Rocky Linux / RHEL
        • HEAVY.AI Installation on RHEL
        • Install NVIDIA Drivers and Vulkan on Rocky Linux and RHEL
      • Getting Started on AWS
      • Getting Started on GCP
      • Getting Started on Azure
      • Getting Started on Kubernetes (BETA)
      • Upgrading
        • Upgrading HEAVY.AI
        • Upgrading from Omnisci to HEAVY.AI 6.0
        • CUDA Compatibility Drivers
      • Uninstalling
      • Ports
    • Services and Utilities
      • Using Services
      • Using Utilities
    • Executor Resource Manager
    • Configuration Parameters
      • Overview
      • Configuration Parameters for HeavyDB
      • Configuration Parameters for HEAVY.AI Web Server
      • Configuration Parameters for HeavyIQ
    • Security
      • Roles and Privileges
        • Column-Level Security
      • Connecting Using SAML
      • Implementing a Secure Binary Interface
      • Encrypted Credentials in Custom Applications
      • LDAP Integration
    • Distributed Configuration
  • Loading and Exporting Data
    • Supported Data Sources
      • Kafka
      • Using HeavyImmerse Data Manager
      • Importing Geospatial Data
    • Command Line
      • Loading Data with SQL
      • Exporting Data
  • SQL
    • Data Definition (DDL)
      • Datatypes
      • Users and Databases
      • Tables
      • System Tables
      • Views
      • Policies
      • Comment
    • Data Manipulation (DML)
      • SQL Capabilities
        • ALTER SESSION SET
        • ALTER SYSTEM CLEAR
        • DELETE
        • EXPLAIN
        • INSERT
        • KILL QUERY
        • LIKELY/UNLIKELY
        • SELECT
        • SHOW
        • UPDATE
        • Arrays
        • Logical Operators and Conditional and Subquery Expressions
        • Table Expression and Join Support
        • Type Casts
      • Geospatial Capabilities
        • Uber H3 Hexagonal Modeling
      • Functions and Operators
      • System Table Functions
        • generate_random_strings
        • generate_series
        • tf_compute_dwell_times
        • tf_feature_self_similarity
        • tf_feature_similarity
        • tf_geo_rasterize
        • tf_geo_rasterize_slope
        • tf_graph_shortest_path
        • tf_graph_shortest_paths_distances
        • tf_load_point_cloud
        • tf_mandelbrot*
        • tf_point_cloud_metadata
        • tf_raster_contour_lines; tf_raster_contour_polygons
        • tf_raster_graph_shortest_slope_weighted_path
        • tf_rf_prop_max_signal (Directional Antennas)
        • ts_rf_prop_max_signal (Isotropic Antennas)
        • tf_rf_prop
      • Window Functions
      • Reserved Words
      • SQL Extensions
      • HeavyIQ LLM_TRANSFORM
  • HeavyImmerse
    • Introduction to HeavyImmerse
    • Admin Portal
    • Control Panel
    • Working with Dashboards
      • Dashboard List
      • Creating a Dashboard
      • Configuring a Dashboard
      • Duplicating and Sharing Dashboards
    • Measures and Dimensions
    • Using Parameters
    • Using Filters
    • Using Cross-link
    • Chart Animation
    • Multilayer Charts
    • SQL Editor
    • Customization
    • Joins (Beta)
    • Chart Types
      • Overview
      • Bubble
      • Choropleth
      • Combo
      • Contour
      • Cross-Section
      • Gauge
      • Geo Heatmap
      • Heatmap
      • Linemap
      • Number
      • Pie
      • Pointmap
      • Scatter Plot
      • Skew-T
      • Table
      • Text Widget
      • Wind Barb
    • Deprecated Charts
      • Bar
      • Combo - Original
      • Histogram
      • Line
      • Stacked Bar
    • HeavyIQ SQL Notebook
  • HEAVYIQ Conversational Analytics
    • HeavyIQ Overview
      • HeavyIQ Guidance
  • HeavyRF
    • Introduction to HeavyRF
    • Getting Started
    • HeavyRF Table Functions
  • HeavyConnect
    • HeavyConnect Release Overview
    • Getting Started
    • Best Practices
    • Examples
    • Command Reference
    • Parquet Data Wrapper Reference
    • ODBC Data Wrapper Reference
    • Raster Data Wrapper Reference
  • HeavyML (BETA)
    • HeavyML Overview
    • Clustering Algorithms
    • Regression Algorithms
      • Linear Regression
      • Random Forest Regression
      • Decision Tree Regression
      • Gradient Boosting Tree Regression
    • Principal Components Analysis
  • Python / Data Science
    • Data Science Foundation
    • JupyterLab Installation and Configuration
    • Using HEAVY.AI with JupyterLab
    • Python User-Defined Functions (UDFs) with the Remote Backend Compiler (RBC)
      • Installation
      • Registering and Using a Function
      • User-Defined Table Functions
      • RBC UDF/UDTF Example Notebooks
      • General UDF/UDTF Tutorial Notebooks
      • RBC API Reference
    • Ibis
    • Interactive Data Exploration with Altair
    • Additional Examples
      • Forecasting with HEAVY.AI and Prophet
  • APIs and Interfaces
    • Overview
    • heavysql
    • Thrift
    • JDBC
    • ODBC
    • Vega
      • Vega Tutorials
        • Vega at a Glance
        • Getting Started with Vega
        • Getting More from Your Data
        • Creating More Advanced Charts
        • Using Polys Marks Type
        • Vega Accumulator
        • Using Transform Aggregation
        • Improving Rendering with SQL Extensions
      • Vega Reference Overview
        • data Property
        • projections Property
        • scales Property
        • marks Property
      • Migration
        • Migrating Vega Code to Dynamic Poly Rendering
      • Try Vega
    • RJDBC
    • SQuirreL SQL
    • heavyai-connector
  • Tutorials and Demos
    • Loading Data
    • Using Heavy Immerse
    • Hello World
    • Creating a Kafka Streaming Application
    • Getting Started with Open Source
    • Try Vega
  • Troubleshooting and Special Topics
    • FAQs
    • Troubleshooting
    • Vulkan Renderer
    • Optimizing
    • Known Issues and Limitations
    • Logs and Monitoring
    • Archived Release Notes
      • Release 6.x
      • Release 5.x
      • Release 4.x
      • Release 3.x
Powered by GitBook
On this page
  • Rendering
  • SQL SELECT
Export as PDF
  1. SQL
  2. Data Manipulation (DML)

SQL Extensions

HEAVY.AI implements a number of custom extension functions to SQL.

Rendering

The following table describes SQL extensions available for the HEAVY.AI implementation of Vega.

SQL SELECT

Function

Arguments and Return

convert_meters_to_merc_pixel_width(meters, lon, lat, min_lon, max_lon, img_width, min_width)

Converts a distance in meters in a longitudinal direction from a latitude/longitude coordinate to a pixel size using mercator projection:

  • meters: Distance in meters in a longitudinal direction to convert to pixel units.

  • lon: Longitude coordinate of the center point to size from.

  • lat: Latitude coordinate of the center point to size from.

  • min_lon: Minimum longitude coordinate of the mercator-projected view.

  • max_lon: Maximum longitude coordinate of the mercator-projected view.

  • img_width: The width in pixels of the view.

  • min_width: Clamps the returned pixel size to be at least this width.

Returns: Floating-point value in pixel units. Can be used for the width of a symbol or a point in Vega.

convert_meters_to_merc_pixel_height(meters, lon, lat, min_lat, max_lat, img_height, min_height)

Converts a distance in meters in a latitudinal direction from a latitude/longitude coordinate to a pixel size, using mercator projection:

  • meters: Distance in meters in a longitudinal direction to convert to pixel units.

  • lon: Longitude coordinate of the center point to size from.

  • lat: Latitude coordinate of the center point to size from.

  • min_lat: Minimum latitude coordinate of the mercator-projected view.

  • max_lat: Maximum latitude coordinate of the mercator-projected view.

  • img_height: The height in pixels of the view.

  • min_height: Clamps the returned pixel size to be at least this height.

Returns: Floating-point value in pixel units. Can be used for the height of a symbol or a point in Vega.

convert_meters_to_pixel_width(meters, pt, min_lon, max_lon, img_width, min_width)

Converts a distance in meters in a longitudinal direction from a latitude/longitude POINT to a pixel size. Supports only mercator-projected points.

  • meters: Distance in meters in a latitudinal direction to convert to pixel units.

  • pt: The center POINT to size from. The point must be defined in the EPSG:4326 spatial reference system.

  • min_lon: Minimum longitude coordinate of the mercator-projected view.

  • max_lon: Maximum longitude coordinate of the mercator-projected view.

  • img_width: The width in pixels of the view.

  • min_width: Clamps the returned pixel size to be at least this width.

Returns: Floating-point value in pixel units. Can be used for the width of a symbol or a point in Vega.

convert_meters_to_pixel_height(meters, pt, min_lat, max_lat, img_height, min_height)

Converts a distance in meters in a latitudinal direction from an EPSG:4326 POINT to a pixel size. Currently only supports mercator-projected points:

  • meters: Distance in meters in a longitudinal direction to convert to pixel units.

  • pt: The center POINT to size from. The point must be defined in the EPSG:4326 spatial reference system.

  • min_lat: Minimum latitude coordinate of the mercator-projected view.

  • max_lat: Maximum latitude coordinate of the mercator-projected view.

  • img_height: The height in pixels of the view.

  • min_height: Clamps the returned pixel size to be at least this height.

Returns: Floating-point value in pixel units. Can be used for the height of a symbol or a point in Vega.

is_point_in_merc_view(lon, lat, min_lon, max_lon, min_lat, max_lat)

Returns true if a latitude/longitude coordinate is within a mercator-projected view defined by min_lon/max_lon, min_lat/max_lat.

  • lon: Longitude coordinate of the point.

  • lat: Latitude coordinate of the point.

  • min_lon: Minimum longitude coordinate of the mercator-projected view.

  • max_lon: Maximum longitude coordinate of the mercator-projected view.

  • min_lat: Minimum latitude coordinate of the mercator-projected view.

  • max_lat: Maximum latitude coordinate of the mercator-projected view.

Returns:True if the point is within the view defined by the min_lon/max_lon, min_lat/max_lat; otherwise, false.

is_point_size_in_merc_view(lon, lat, meters, min_lon, max_lon, min_lat, max_lat)

Returns true if a latitude/longitude coordinate, offset by a distance in meters, is within a mercator-projected view defined by min_lon/max_lon, min_lat/max_lat.

  • lon: Longitude coordinate of the point.

  • lat: Latitude coordinate of the point.

  • meters: Distance in meters to offset the point by, in any direction.

  • min_lon: Minimum longitude coordinate of the mercator-projected view.

  • max_lon: Maximum longitude coordinate of the mercator-projected view.

  • min_lat: Minimum latitude coordinate of the mercator-projected view.

  • max_lat: Maximum latitude coordinate of the mercator-projected view.

Returns: True if the point is within the view defined by the min_lon/max_lon, min_lat/max_lat; otherwise, false.

is_point_in_view(pt, min_lon, max_lon, min_lat, max_lat)

Returns true if a latitude/longitude POINT defined in EPSG:4326 is within a mercator-projected view defined by min_lon/max_lon, min_lat/max_lat.

  • pt: The POINT to check. Must be defined in EPSG:4326 spatial reference system.

  • min_lon: Minimum longitude coordinate of the mercator-projected view.

  • max_lon: Maximum longitude coordinate of the mercator-projected view.

  • min_lat: Minimum latitude coordinate of the mercator-projected view.

  • max_lat: Maximum latitude coordinate of the mercator-projected view.

Returns: True if the point is within the view defined by min_lon/max_lon, min_lat/max_lat; otherwise, false.

is_point_size_in_view(pt, meters, min_lon, max_lon, min_lat, max_lat)

Returns true if a latitude/longitude POINT defined in EPSG:4326 is within a mercator-projected view defined by min_lon/max_lon, min_lat/max_lat.

  • pt: The POINT to check. Must be defined in EPSG:4326 spatial reference system.

  • meters: Distance in meters to offset the point by, in any direction.

  • min_lon: Minimum longitude coordinate of the mercator-projected view.

  • max_lon: Maximum longitude coordinate of the mercator-projected view.

  • min_lat: Minimum latitude coordinate of the mercator-projected view.

  • max_lat: Maximum latitude coordinate of the mercator-projected view.

Returns: True if a latitude/longitude POINT defined in EPSG:4326, offset by a distance in meters, is within the view defined by min_lon/max_lon, min_lat/max_lat; otherwise, false.

PreviousReserved WordsNextHeavyIQ LLM_TRANSFORM