Questions tagged [partiql]

78 questions
3
votes
1 answer

DynamoDB parameterized PartiQL query with executeStatement

I have the following query with the aws sdk in nodejs and running in aws lamdba that doesn't work when using the parameters array: executeStatement({ Statement: `select * from "myTable"."myIndex" where "pk" = '?' and "sortKey5" >= 50 ORDER BY…
fred_
  • 1,486
  • 1
  • 19
  • 31
3
votes
1 answer

Using GROUP BY in AWS QLDB / Partiql

I have the following table in my AWS QLDB table: INSERT INTO Testing << { 'MyId': 1, 'MyList': [ 'Item1', 'Item2', 'Item3'] }, { 'MyId': 2, 'MyList': [ 'Item2', 'Item3', 'Item4'] }, { 'MyId': 3, 'MyList': [ 'Item4', 'Item5',…
David
  • 4,744
  • 5
  • 33
  • 64
2
votes
1 answer

how should define a PRIMARY KEY in PartiQL at Amazon QLDB?

I want to define a primary key in QLDB that the query language is PartiQL, how can I define ID as a primary key? CREATE TABLE CarInfo WITH (aws_tags = `{ 'ID': INT, 'Manufacturer': STRING, 'ProductionYear': year, 'Model':STRING, 'VIN':STRING,…
amin
  • 93
  • 8
2
votes
1 answer

DynamoDB | How to update an item, if the item does not exist yet with PartiQL?

I would like to make an update call to dynamoDB which: If the ddb item exists, update the existing string set for its new values (adding not replacing), or if the ddb item does not exist yet, create a new item. But both cases should be covered with…
1
vote
1 answer

How do I correctly unmarshal the results of a PartiQL Query in Go using the AWS sdk?

I have upcoming shows for my band stored with DynamoDB, and I have the following code: type PartiQLRunner struct { DynamoDbClient *dynamodb.DynamoDB TableName string } func BuildRunner() *PartiQLRunner { sess :=…
1
vote
1 answer

PartiQL INSERT Statement to append a Value to a List Attribute

I am trying to append a Value to an existing List Attribute in DynamoDB using PartiQL Syntax. The Primary Key of the Item consists of: pk = userId sk = happeningId table_name = test_table userId = "user09hfh47egd53tgd" happeningId =…
SwiftMiner
  • 47
  • 5
1
vote
1 answer

SELECT DISTINCT in PartiQL (AWS DynamoDB)

I am running the following query in the AWS DynamoDB PartiQL editor: SELECT DISTINCT column1 FROM "my_lucky-table" WHERE Id = "db05-5d1" but I am getting the following error: ValidationException: Unsupported token in expression: DISTINCT Any…
1
vote
1 answer

How to use f-Literal with PartiQL in AWS and boto3 and a Condition on the sort key

This is my current Code table_name = 'TableName' pk = "CID-73665" Condition = "begins_with(sk,'CUS#')" # get item stmt = f"SELECT * FROM {table_name} WHERE pk=? and {Condition}" pmt =[{ "S": pk }, { "S": sk }] resp =…
1
vote
0 answers

PartiQL query with DynamoDB error: "Must have at least one non-optional hash key condition in WHERE clause when using ORDER BY clause."

"Logs" table in DynamoDB has a simple partition key: It also has a global secondary index: My query statement is: SELECT * FROM "Logs"."CustomerIdentifier-Timestamp-index" WHERE "CustomerIdentifier" = 'ABC123' AND "Timestamp" >=…
maxmoore14
  • 701
  • 7
  • 26
1
vote
0 answers

Querying array of nested objects with nested array of objects in Redshift

Let's say I have the following JSON { "id": 1, "sets": [ { "values": [ { "value": 1 }, { "value": 2 } ] }, { "values": [ { "value": 5 }, …
Rakib Ansary
  • 4,078
  • 2
  • 18
  • 29
1
vote
1 answer

Redshift : loading & storing JSON (IoT) data

My source is JSON with nested arrays & structures. (examples at end of post) Large volume of new data streaming real-time (20m/day) I have to decide how to store this data, considering..... -- End users want to use 'traditional' SQL -- Performance…
SimonB
  • 962
  • 1
  • 14
  • 36
1
vote
1 answer

How can I use Arithmetic operators in PartiQL for DynamoDB?

According to what I have read in the docs, DynamoDB supports PartiQL, which in turn supposedly supports arithmetic operators (such as +, -, *, /). https://docs.aws.amazon.com/qldb/latest/developerguide/ql-operators.html When I try to perform a sum…
1
vote
1 answer

DynamoDB PartiQL Query For Specific Map Element From List

I have a DynamoDB with data that looks like this: { "userId": { "S": "someuserID" }, "listOfMaps": { "L": [ { "M": { "neededVal": { "S": "ThisIsNeeded1" }, "id": { …
Francis Bartkowiak
  • 1,374
  • 2
  • 11
  • 28
1
vote
0 answers

Is there a way to implement IfNull/Coalesce in DynamoDB PartiQL?

DynamoDB PartiQL does not support an equivalent IFNULL/COALESCE built-in function yet (even though COALESCE is a reserved keyword and DynamoDB's sibling QLDB seems to support it with its PartiQL implementation, so it appears to be theoretically…
Grant Moore
  • 153
  • 1
  • 10
1
vote
1 answer

PartiQL BatchExecuteStatementCommand in DynamoDB SDK v3

I'm attempting to send a batch of PartiQL statements in the NodeJS AWS SDK v3. The statement works fine for a single ExecuteStatementCommand, but the Batch command doesn't. The statement looks like const statement = ` SELECT * FROM "my-table" WHERE…