ValidationException: Unexpected from source

TL;DR — The table name in your PartiQL FROM clause contains characters the parser won't accept bare — usually a dash. Wrap the name in double quotes (SELECT * FROM "my-table"). Single quotes don't work: in PartiQL they mean a string literal, not an identifier.

What it means

ValidationException: Unexpected from source

The PartiQL parser reads FROM my-table as the identifier my followed by unexpected tokens — the dash isn't valid inside a bare identifier. DynamoDB table names may legally contain -, ., and _, so a perfectly valid table name can still be un-parseable in PartiQL until it's quoted. The same applies to names that collide with PartiQL keywords.

Why it happens

  • The table name contains a dash or dotusers-prod, app.events. Bare identifiers can't carry them.
  • Framework-generated table names — tooling that suffixes an environment or stage onto the table name (e.g. Todo-dev) is the classic way a dash gets in without you choosing it.
  • Querying an index without quotes — the "table"."index" form needs double quotes around both parts.
  • Single quotes instead of doubleFROM 'my-table' fails too: single quotes denote a string literal in PartiQL, not a name.

How to fix it

  1. Double-quote the table name:

    SELECT * FROM "users-prod" WHERE pk = 'USER#42'
  2. Double-quote both parts when querying an index:

    SELECT * FROM "users-prod"."email-index" WHERE email = 'ada@example.com'
  3. Keep single quotes for string values only — names in double quotes, values in single quotes. Mixing them up produces exactly this class of parse error.

  4. Quote defensively in generated statements — if your code interpolates table names into PartiQL, always emit them double-quoted; it's valid even when the name wouldn't strictly need it.

The DynoTable desktop app ships a SQL workbench for DynamoDB that handles identifier quoting for you, and the DynamoDB Expression Builder shows the equivalent native Query/Scan request when you'd rather sidestep PartiQL parsing entirely.

References

Last verified 2026-07-13 against the official AWS documentation linked above.

Work with DynamoDB without the Console

DynoTable is a fast desktop client for DynamoDB — browse tables, run SQL-style queries, and edit items locally.