Questions tagged [partiql]

78 questions
0
votes
1 answer

DynamoDB: can't use multiple AND operators combined with ORDER BY on sort key

I believe I've found a bug in DynamoDB using PartiQL. Given this table: name = "my-table" hash_key = "device_id" range_key = "message_id" attributes = [ { name = "device_id", type = "S" }, { name = "message_id", type = "S" }, …
ffleandro
  • 4,039
  • 4
  • 33
  • 48
0
votes
1 answer

PartiQL Query to return items in a list of objects that contains certain string

I want to retrieve only the short_name that contains the string "BR", I've tried using PartiQL docs but some features are not allowed in DynamoDB. The reason is that right now we are using DynamoDB for Geocache wrong and now I need to filter for a…
Lucas Fernandes
  • 522
  • 5
  • 11
0
votes
1 answer

PartiQL DELETE statement using AWS SDK v3 not working

I have an AWS Lambda function behind API Gateway v2 that should delete an item from DynamoDB. When creating the endpoint, I based it off the AWS example code Delete an item from a table. The parameter substitution works for other statements, such as…
SillySam
  • 98
  • 7
0
votes
0 answers

I want to run partiql in CLI I used to run it without error using partiql -of -q "SQL Query text" now does not work

I am running PartiQL 0.9.2, the CLI options for --of and -q that I used to use no longer work. Can you please tell me what are the alternative CLI options that I need to use? I have a script.sh file where I take the Partiql output and then | the…
prashpsg
  • 1
  • 1
0
votes
1 answer

Convert date in DynamoDB from unix format using PartiQL

I am trying to select data from DynamoDB using the PartiQL new AWS feature. I have noticed that the date variable is stored in Unix format in Dynamodb. However, I want to convert it into human readable format such as GMT. I have used the next…
baddy
  • 369
  • 1
  • 3
  • 23
0
votes
1 answer

Dynamodb efficient query on list

I m porting a CosmosDB data model to DynamoDB. The objects look like that: { pk: "mypk", id: "myid", keywords: [ "lac", "sun", "nature" ] } In CosmosDB I can make a query to the items of the list and hit an index, resulting in a fast and efficient…
fred_
  • 1,486
  • 1
  • 19
  • 31
0
votes
1 answer

PartiQL/SQL: JSON-SUPER array query to extract values to table on Redshift

I have a somewhat complicated SUPER array that I brought in to Redshift using a REST API. The 'API_table' currently looks like this:table example One of the sample columns "values" reads as…
camaya
  • 3
  • 3
0
votes
0 answers

is it possible to convert a string to number in DynamoDb PartiQL

I am using the below query where minDaysToDeparture and maxDaysToDeparture are string but I have to put in the where block with comparison operators. I have tried the below queries (not working): SELECT * FROM Rules WHERE ( AND ( …
Sikandar Sahab
  • 638
  • 3
  • 10
  • 27
0
votes
0 answers

Count Case When SQL Statements in DynamoDB

I have recently moved a flask app to serverless and its all running fine apart from some of the more complicated sql statements. I want to count when the Player name appears but only if the Team A result is less than the Team B result. Take the…
0
votes
2 answers

How to fetch and update DynamoDB table items by PartiQL in aws?

I have created a new column to an existing dynamo db table in aws. Now I want a one-time script to populate values to the newly created column for all existing records. I have tried with the cursor as shown below from the PartiQL editor in…
Ajai
  • 11
  • 1
  • 3
0
votes
1 answer

Deleting Items using PartiQL DynamoDB editor with IN clause

I am trying to delete DynamoDB items using the PartiQL editor using the IN clause. A sample query below is erroring with message "ValidationException: IN operator must have a left hand argument of type Variable Reference and right hand argument of…
0
votes
0 answers

How to use f-Literal with PartiQL in AWS and boto3 on a Secondary Index

I want to query from a secondary index with PartiQL. Querys from the basetable work fine. But when trying it on a Secondary Index i get an empty list I tried the following: table_name_2 = "datatable.GSI1" pk = 'U-0001' stmt = f"SELECT * FROM…
0
votes
1 answer

There is any way to save an object as a string in DynamoDB with PartiQL?

Let's say I have the following object that contains a key (body) with a string object value: { id:'xxyyzz', body:'{\'key1\':\'value1\',\'key2\':\'value2\'}' } There is any way to save it in DynamoDB with NodeJS PartiQL? Because when I try to…
0
votes
1 answer

New to PartiQL - what is wrong with this SELECT statement?

Using DynamoDB with PartiQL, I am trying to select records using a global index: SELECT * FROM "My-Table.My-Index" WHERE Foo = 'bar' AND Timestamp >= 638014354649346173 AND Timestamp <= 638014355249346173 ORDER BY Timestamp I am getting an…
maxmoore14
  • 701
  • 7
  • 26
0
votes
1 answer

How to escape a single quote in a PartiQL insert statement

Using DynamoDB, I want to insert a record that contains a string with a single quote ('). Not sure how to escape this so it passes validation. INSERT INTO "MyTable" VALUE { 'MyAttr': 'some message containing a \' quote' } NOTE: escaping as I have…
maxmoore14
  • 701
  • 7
  • 26