SQL parsing (GraphQL)

Related queries and mutations in Monitors. Each has its own section.

Queries

parseQuery (query)

parseQuery is a query in the Monte Carlo GraphQL API, in Monitors. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Arguments

ArgumentTypeDescription
queryString!SQL query to parse
resourceIdUUIDId of resource/warehouse to use for table resolution
databaseStringName of database to use for table resolution
schemaStringName of schema to use for table resolution

Returns

SqlParserResult

Example

query ParseQuery($query: String!) {
  parseQuery(query: $query) {
    errors
  }
}

Types used only by parseQuery

SqlParserResult

Object type.

FieldTypeDescription
sources[SqlParsedTable]Parsed query sources
destinationSqlParsedTableParsed query destination
errors[String]SQL parser errors

Related types

SqlParsedTable, UUID

parseQueryForLogTypes (query)

parseQueryForLogTypes is a query in the Monte Carlo GraphQL API, in Monitors. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

For each candidate log_type, returns the sources and destination Monte Carlo's SQL parser would extract from the query. Useful for push-ingestion customers comparing extraction across log_types before committing to one for POST /ingest/v1/querylogs — pick the one whose lineage matches your real data flow. The alias 'generic' maps to the transactional-db dialect for warehouses that do not have a dedicated parser. Parser behavior mirrors production push ingestion: Rust SQL parser first, Java Presto parser fallback on Rust error or timeout. So the lineage shown here is a faithful preview of what downstream OpenSearch will index for the same payload — not a dialect-strictness check. If every log_type returns the same lineage for a query, that's genuine 'any of these will work' news; if they diverge, you pick the one whose extraction matches your intent. Scope note: this is a pre-decision discovery tool. It does not perform MCON resolution — use parseQuery with a chosen resourceId for that, once a log_type has been picked.

Arguments

ArgumentTypeDescription
queryString!SQL query to parse
logTypes[String!]!Candidate log_types (push resource_type values) to try, 1..15 entries.

Returns

[LogTypeParseResult!]!

Example

query ParseQueryForLogTypes($query: String!, $logTypes: [String!]!) {
  parseQueryForLogTypes(query: $query, logTypes: $logTypes) {
    logType
    errors
    success
  }
}

Types used only by parseQueryForLogTypes

LogTypeParseResult

Object type.

FieldTypeDescription
logTypeString!The candidate log_type this result corresponds to, echoed from the input (e.g. 'snowflake', 'bigquery', 'generic').
sources[SqlParsedTable!]Parsed query sources for this log_type. mcon is always null here — this API does not perform table resolution. Call parseQuery with a chosen resourceId once the right dialect has been identified to get MCONs.
destinationSqlParsedTableParsed query destination for this log_type. mcon is always null here — see the note on sources.
errors[String!]SQL parser errors for this log_type
successBoolean!True when the parser returned no errors and at least one source or a destination was parsed for this log_type.

Related types

SqlParsedTable

Source: The GraphQL API reference

This page is generated from the GraphQL schema on each release. Changes made in ReadMe are overwritten.