Skip to main content
NQL validates data types during query parsing and execution. When a query includes unsupported types or incompatible type operations, the platform returns a 422 error with details about the type issue.

GEOMETRY type not supported in SELECT

The GEOMETRY type cannot be used directly in SELECT statements. This error occurs when your query attempts to return a geometry column or the result of a geometry function.

Error response

Cause

Geometry functions like STCIRCLE() return GEOMETRY types that cannot be serialized in query results. While you can use geometry functions in JOIN conditions and WHERE clauses, you cannot SELECT them directly.

Solution

Remove the GEOMETRY column from your SELECT statement. Keep geometry operations only in JOIN or WHERE clauses. Before (causes error):
After (fixed):
If you need to use geometry for filtering, keep it in the JOIN or WHERE clause:

String concatenation type mismatch

The || operator concatenates strings but requires compatible types on both sides. This error occurs when you try to concatenate incompatible types.

Error response

Cause

The || operator requires both operands to be strings (or equivalent string types). Common causes include:
  • Concatenating a complex record type with a string
  • Mixing incompatible character types
  • Using structured fields that haven’t been extracted to simple strings

Solution

Extract string values from complex types before concatenation, or cast values to compatible string types. Before (causes error):
After (fixed): If the fields are structured types with nested values, extract the string value first:
When concatenating timestamps or other non-string types, use CAST(field AS VARCHAR) to convert them to strings first.

General tips for type errors

  1. Check the detail field — It identifies the specific types that are incompatible
  2. Review structured fields — Many fields in Narrative are record types with .value subfields
  3. Use explicit casts — When in doubt, cast values to the expected type with CAST(field AS type)
  4. Check the instance/nql/parse errors occur during query validation; /nql/run errors occur during execution

NQL Data Types

Reference for supported data types

NQL Functions

Reference for built-in functions including geometry operations

NQL Troubleshooting

Overview of common NQL errors

Rosetta Stone Attributes

Understanding structured attribute types