Validate an NQL statement
Parse and validate an NQL statement without running it. The statement is parsed with the SQL dialect of
the given data plane and checked against the datasets, access rules and views the token’s company can
see. A valid statement returns its AST (see the Ast schema). An invalid one returns an RFC 7807
problem whose title and detail say what is wrong, with the status code /nql/run and
/v1/nql/execute return for the same problem.
Requires a token with read access to subscriptions. POST /nql/parse does the same check for any
token, or for no token at all.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
A NQL query.
A dataplane represent where you would run the query. Your query get compiled to the SQL dialect that your data engine understands. If you leave it blank, your query will target Narrative's dataplane on AWS using Apache Spark. We currently support Snowflake and we plan to support other dataplanes in the future. See https://next.narrative.io/products/narrative-anywhere for more details.
Response
The statement is valid. The body is its AST, or an empty object for a MERGE statement, which has
no AST representation.
The parsed statement as an AST. A MERGE statement has no AST representation and returns an empty
object instead, as does a statement whose AST could not be serialized.
"select"The text of the query fragment this node was parsed from.
Named windows declared in a WINDOW clause.
The common table expressions of a WITH clause. Each is a select node whose as is the CTE name.
The alias given with AS. Only present on aliased nodes: select-list expressions, FROM items and
common table expressions. When it is present the node's nql is the full <expression> AS <alias> text.
The FROM item, or null for a select with no FROM clause.
Was this page helpful?

