Executing a delete query on an Amazon Timestream DB.
When executing this query:
delete from "data-api-timestream-test"."test_table"
I get the error:
The query syntax is invalid at line 1:1
Can I delete records from Amazon Timestream?
Executing a delete query on an Amazon Timestream DB.
When executing this query:
delete from "data-api-timestream-test"."test_table"
I get the error:
The query syntax is invalid at line 1:1
Can I delete records from Amazon Timestream?
Unfortunately, AWS Timestream does not support deletes right now.
The only supported operations are inserts and upserts.
As mentioned in the comments, you can not delete the records from timestream database, but you can delete a table via AWS TimeStream SDK. I am attaching a code sample in golang, but you can also do it with Python, Java and bunch of other languages.
deleteTableInput := ×treamwrite.DeleteTableInput{
DatabaseName: aws.String(*databaseName),
TableName: aws.String(*tableName),
}
_, err = writeSvc.DeleteTable(deleteTableInput)
if err != nil {
fmt.Println("Error:")
fmt.Println(err)
} else {
fmt.Println("Table deleted", *tableName)
}
Ref: https://docs.aws.amazon.com/timestream/latest/developerguide/code-samples.delete-table.html