SQL Reference > Troubleshooting


This page covers common error patterns and missteps in Rockset queries, and how to fix them.

Empty Results

Double-Quoted String Literals

In Rockset, double quotes are reserved for collection names and field names. String literals must be wrapped in single quotes.

Sample Invalid Query:

SELECT field FROM "collection" WHERE field = "value"

Correct Query:

SELECT field FROM "collection" WHERE field = 'value'

Mismatched Query and Data Types

Rockset is strongly typed, and will evaluate to false if you attempt to compare values of different types. If you are unsure of what types exist in a collection or field, you can easily check in that collection’s console page or with a call to DESCRIBE "collection".

Sample Invalid Query:

-- field is comprised of string values such '10'
SELECT field FROM collection WHERE field = 10

Correct Query:

-- will select values such as '10' as well as 10
SELECT field FROM collection where cast(field as int) = 10
-- or
-- will select only '10'
SELECT field FROM collection WHERE field = '10'

Query Parse Errors

Unescaped Collection and Field Names

Certain characters, such as '-', must be escaped in collection and field names. Wrap collection and field names in double quotes.

Sample Invalid Query:

SELECT * FROM collection-name

Correct Query:

SELECT * FROM "collection-name"

Accessing Nested Fields without Full Path

In any nested field path, Rockset assumes the first token is the collection name. Attempting to access nested fields without a fully qualified path will result in an error.

Sample Invalid Query:

SELECT field."nested-field" FROM collection

Correct Query:

SELECT c.field."nested-field" FROM collection c
-- or
SELECT collection.field."nested-field" FROM collection