From 81a6855b89b2f9130d0c66e07a6a2c875e3cbe4c Mon Sep 17 00:00:00 2001 From: Phil Bracikowski Date: Tue, 27 Jun 2023 09:12:36 -0700 Subject: [PATCH] feat: improve delete predicate keyword escaping requirements Delete predicates are parsed by the influxql parser. Therefore, any influxql keywords that match a tag name need to be escaped with double quotes. The keyword matching is case-insensitive but tag name matching for the delete predicate is case-sensitive. --- .../influxdb/v2.7/reference/syntax/delete-predicate.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/content/influxdb/v2.7/reference/syntax/delete-predicate.md b/content/influxdb/v2.7/reference/syntax/delete-predicate.md index 6094bf8e5..29ce2ad1b 100644 --- a/content/influxdb/v2.7/reference/syntax/delete-predicate.md +++ b/content/influxdb/v2.7/reference/syntax/delete-predicate.md @@ -37,12 +37,15 @@ key1="value1" AND key2="value" If your predicate contains keywords or strings with special characters, wrap each in escaped quotes to ensure the predicate string is parsed correctly. +Because delete predicates follow [InfluxQL](/influxdb/v2.7/reference/syntax/influxql) syntax, [any InfluxQL keyword](/influxdb/v2.7/reference/syntax/influxql/spec/#keywords) +that matches your tag name needs to be escaped. Keywords are case-insensitive. + ```js // Escaped due to the "-" "_measurement=\"example-dash\"" -// Escaped because "name" is a keyword -"_measurement=example and \"name\"=predicate" +// Escaped because "Name" is a keyword +"_measurement=example and \"Name\"=predicate" ``` {{% /note %}} @@ -116,4 +119,4 @@ The delete predicate syntax has the following limitations. - Delete predicates only support equality (`=`), not inequality (`!=`). - Delete predicates can use any column or tag **except** `_time` {{% oss-only %}}, `_field`, {{% /oss-only %}}or `_value`. - \ No newline at end of file +