Questions tagged [partiql]
78 questions
15
votes
4 answers
dynamodb PartiQL SELECT query returns ValidationException: Unexpected from source
I am using Amplify to setup a dynamodb with a corresponding lambda using the amplify blueprint for dynamodb.
Accessing the dynamodb the "classic" way with KeyConditionExpression etc works just fine but today I wanted to try and use PartiQL instead…

user1816142
- 1,199
- 2
- 9
- 16
7
votes
2 answers
DynamoDB how to use index in PartiQL queries?
I have seen the dynamoDB doc for the PartiQL syntax:
SELECT expression [, ...]
FROM table[.index]
[ WHERE condition ] [ [ORDER BY key [DESC|ASC] , ...]
but in practice:
select * from dev .pk-all-index
where "pk" = 'config' AND ("brand" = 'tesla'…

fred_
- 1,486
- 1
- 19
- 31
7
votes
1 answer
Pagination in QLDB
I noticed QLDB does not support LIMIT or SKIP query parameters required to implement basic pagination.
Is this going to be supported in the future or is there some other way to implement pagination in QLDB?

Alko
- 672
- 10
- 21
7
votes
1 answer
Choosing between PartiQL vs U-SQL
I was going through the article here :
https://aws.amazon.com/blogs/opensource/announcing-partiql-one-query-language-for-all-your-data/
It looks like "PartiQL" is similar like U-SQL provided by Microsoft. Here it is :…

AskMe
- 2,495
- 8
- 49
- 102
6
votes
4 answers
Limit statement in PartiQL - Get Last row
How do I use Limit in PartiQL?
What I need is the last 3 rows from the table of Amazon QLDB which uses PartiQL Syntax for querying.
Something like
SELECT * FROM Accounts where AddedBy = 'admin@demo.com' LIMIT 3

Malik Hanzala
- 127
- 1
- 6
5
votes
1 answer
DynamoDB PartiQL pagination using SDK
I'm currently working on pagination in DynamoDB using the JS AWS-SDK's executeStatement using PartiQL, but my returned object does not contain a NextToken (only the Items array), which is used to paginate.
This is what the code looks like (pretty…

Bennybear
- 335
- 2
- 13
5
votes
2 answers
QLDB unique field
I want to create a unique field in QLDB. I tried to use UNIQUE, but get:
unexpected token found, KEYWORD : unique; Unexpected token following CREATE

Alko
- 672
- 10
- 21
4
votes
0 answers
Using PartiQL and AWS SDK correctly?
I have the following lambda function
const partiQl = "UPDATE '?' SET hits = hits + 1 WHERE path = \"'?'\" RETURNING ALL NEW *"
console.log(partiQl)
console.log(event.path)
console.log(process.env.HITS_TABLE_NAME)
const execStatementCommand = new…

ArmenB
- 2,125
- 3
- 23
- 47
4
votes
1 answer
DynamoDB how to use sort key with PartiQL query?
Hello I m new to DynamoDB, I have created a TABLE, with Partition Key "pk" and Sort Key "id"
in then item explorer I can query with the pk and sort key value and it seems to work.
In the PartiQL Editor I do
SELECT * FROM "dev" WHERE "pk" = 'config'…

fred_
- 1,486
- 1
- 19
- 31
4
votes
1 answer
Find the history of Deleted Data in QLDB
I have created Vehicle Table In the Ledger and added some vehicles in QLDB and I deleted the vehicle data.Now I am not able to fetch the metadata id because user table and committed table will have only non-deleted latest version of application…

Sanjeev Kumar
- 135
- 2
- 2
- 13
3
votes
1 answer
Does the IN PartiQL operator query or scan DynamoDB tables?
We need to query a large (2TB+) DynamoDB table to get multiple items based on their partition keys.
We are planning to use PartiQL as it supports the IN operator as such:
SELECT * FROM table_test where pk IN ('1234','1112');
Would this query do…

mariz
- 509
- 1
- 7
- 13
3
votes
1 answer
Is it possible to use JOIN in PartiQL in Dynamo?
From the AWS guide here: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/EMRforDynamoDB.Querying.html
SELECT ecs.state_name, f.feature_name, f.feature_class
FROM s3_east_coast_states ecs
JOIN ddb_features f ON ecs.state_alpha =…

jcollum
- 43,623
- 55
- 191
- 321
3
votes
3 answers
Can I use COUNT in a PartiQL query of a Dynamo table?
Trying all of these in PartiQL Editor. DynamoDB > PartiQL editor on the AWS site.
Query: select count(divisionID) from "org-data-dev";
Result: ValidationException: Unexpected path component at 1:8:5
Query: select count("divisionID") from…

jcollum
- 43,623
- 55
- 191
- 321
3
votes
0 answers
Remove an item from a LIST using PartiQL and DynamoDB
Trying to remove an item from a list in DynamoDB using PartiQL and parameters.
This works with no problem
update table name REMOVE members[1]
SET log=?
WHERE PK=? AND SK=?
but if I use a parameter for the list index - members[?] - then I get the…

stuart
- 425
- 6
- 19
3
votes
1 answer
Check if row contains a nested item in DynamoDB?
I am trying to use PartiQL with DynamoDB to perform SQL queries to check if a device is inactive and contains an error. Here's is the query I am using:
SELECT *
FROM "table"
WHERE "device"."active" = 0 AND "device"."error" IS NOT NULL
However…

Simon Rex
- 143
- 2
- 10