AWS iot-sitewise documentation change
Summary
Updated SQL logical operators documentation with corrected table structure, added operator signatures, examples, and expanded LIKE pattern explanations
Security assessment
Changes focus on improving documentation clarity and adding usage examples for SQL operators. No security vulnerabilities or security feature enhancements are mentioned. The LIKE escape clause example demonstrates proper syntax but doesn't introduce new security controls.
Diff
diff --git a/iot-sitewise/latest/userguide/sql-supported-logical.md b/iot-sitewise/latest/userguide/sql-supported-logical.md index 7f3f0201c..714677d94 100644 --- a//iot-sitewise/latest/userguide/sql-supported-logical.md +++ b//iot-sitewise/latest/userguide/sql-supported-logical.md @@ -9 +9 @@ AWS IoT SiteWise supports the following logical operators. -Logical operators **Operator** | **Description** | **Example** +**Operator** | **Signature** | **Description** @@ -11 +11,6 @@ Logical operators **Operator** | **Description** | **Example** -`AND` | `TRUE` if both values are true | a `AND` b +`AND` | a `AND` b | `TRUE` if both values are true +`OR` | a `OR` b | `TRUE` if one value is true +`NOT` | `NOT` expression | `TRUE` if an expression is false, and `FALSE` if an expression is true +`IN` | x `IN` expression | `TRUE` if value in expression +`BETWEEN` | `BETWEEN` a `AND` b | `TRUE` if value between upper and lower limit, and includes both limits +`LIKE` | `LIKE` pattern | `TRUE` if value is in pattern `LIKE` supports wildcards. See below for examples: @@ -13 +18,35 @@ Logical operators **Operator** | **Description** | **Example** -If either a or b is `FALSE`, the previous expression evaluates to false. For an `AND` operator to evaluate to true, both a and b must be true. + * `%` substitutes one or more characters in a string. + * `_` substitutes one character in a string. + * `ESCAPE` is used with a character to designate an escape character in the LIKE pattern. + + + +Examples of all functions: + +**Function** | **Example** +---|--- +AND | + + + SELECT a.asset_name + FROM asset AS a, latest_value_time_series AS t + WHERE t.int_value > 30 AND t.event_timestamp > TIMESTAMP '2025-05-15 00:00:01' + + +OR | + + + SELECT a.asset_name + FROM asset AS a + WHERE a.asset_name like 'abc' OR a.asset_name like 'pqr' + + +NOT | + + + SELECT ma.asset_id AS a_id + FROM asset AS ma + WHERE (ma.asset_id NOT LIKE 'some%patterna%' escape 'a') AND ma.asset_id='abc' + + +IN | @@ -17,2 +56,36 @@ If either a or b is `FALSE`, the previous expression evaluates to false. For an - FROM asset as a, latest_value_time_series as t - WHERE t.int_value > 30 AND t.event_timestamp > 1234567890 + FROM asset AS a + WHERE a.asset_name IN ('abc', 'pqr') + + +BETWEEN | + + + SELECT asset_id, int_value, event_timestamp AS i_v + FROM raw_time_series + WHERE event_timestamp BETWEEN TIMESTAMP '2025-04-15 00:00:01' and TIMESTAMP '2025-05-15 00:00:01' + + +LIKE | + + * `%` pattern: + + SELECT POWER(rw.int_value, 5) AS raised_value + FROM raw_time_series AS rw + WHERE rw.asset_id LIKE 'some%pattern%' AND rw.int_value > 30 + + + * `_` pattern: + + SELECT asset_id, property_id + FROM asset_property + WHERE string_attribute_value LIKE 'Floor_' + + + * `ESCAPE` pattern: + + SELECT asset_id + FROM asset + WHERE asset_name LIKE 'MyAsset/_%' ESCAPE '/' + + + @@ -27 +100 @@ To use the Amazon Web Services Documentation, Javascript must be enabled. Please -Retrieve data with a SELECT statement +Supported clauses