aws / language-servers

AWS related Language Servers
Apache License 2.0
17 stars 15 forks source link

fix: partiql - don't report diagnostics for quoted identifiers #305

Closed akoreman closed 1 month ago

akoreman commented 1 month ago

Problem

Queries like

SELECT * 
FROM "TableName"."IndexName" 

should not result in diagnostics. (see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ql-reference.select.html)

Currently these result in diagnostics with the error InvalidInput("\") which is coming from the extra \ we add in normalizeQuery. The query is directly send to the wasm module here so the extra escaping of the " doesn't seem to be necessary.

Same bug was present in the partiql-playground package using the same WASM module and was fixed in the same way in https://github.com/partiql/partiql-rust-playground/pull/16.

Solution

Removed the replacement of \" by \\" in the preparing of the document before sending it to the wasm module.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.