Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove unnecessary ::timestamp casts #5596

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/influxdb/cloud-dedicated/get-started/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ WHERE
{{% influxdb/custom-timestamps %}}
```sql
SELECT
DATE_BIN(INTERVAL '1 hour', time, '2022-01-01T00:00:00Z'::TIMESTAMP) as _time,
DATE_BIN(INTERVAL '1 hour', time, '2022-01-01T00:00:00Z') as _time,
room,
selector_max(temp, time)['value'] AS 'max temp'
FROM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ list_code_example: |
##### Aggregate by time-based intervals
```sql
SELECT
DATE_BIN(INTERVAL '1 hour', time, '2022-01-01T00:00:00Z'::TIMESTAMP) AS time,
DATE_BIN(INTERVAL '1 hour', time, '2022-01-01T00:00:00Z') AS time,
mean(field1),
sum(field2),
tag1
Expand Down Expand Up @@ -206,7 +206,7 @@ groups:

```sql
SELECT
DATE_BIN(INTERVAL '2 hours', time, '1970-01-01T00:00:00Z'::TIMESTAMP) AS time
DATE_BIN(INTERVAL '2 hours', time, '1970-01-01T00:00:00Z') AS time
FROM home
...
```
Expand All @@ -225,7 +225,7 @@ groups:

```sql
SELECT
DATE_BIN(INTERVAL '2 hours', time, '1970-01-01T00:00:00Z'::TIMESTAMP) AS time
DATE_BIN(INTERVAL '2 hours', time, '1970-01-01T00:00:00Z') AS time
...
GROUP BY 1, room
...
Expand All @@ -235,7 +235,7 @@ groups:

```sql
SELECT
DATE_BIN(INTERVAL '2 hours', time, '1970-01-01T00:00:00Z'::TIMESTAMP) AS _time
DATE_BIN(INTERVAL '2 hours', time, '1970-01-01T00:00:00Z') AS _time
FROM home
...
GROUP BY _time, room
Expand All @@ -247,7 +247,7 @@ The following example retrieves unique combinations of time intervals and rooms

```sql
SELECT
DATE_BIN(INTERVAL '2 hours', time, '1970-01-01T00:00:00Z'::TIMESTAMP) AS time,
DATE_BIN(INTERVAL '2 hours', time, '1970-01-01T00:00:00Z') AS time,
room,
selector_max(temp, time)['value'] AS 'max temp',
selector_min(temp, time)['value'] AS 'min temp',
Expand Down Expand Up @@ -288,7 +288,7 @@ If you want to reference a calculated time column by name, use an alias differen

```sql
SELECT
DATE_BIN(INTERVAL '2 hours', time, '1970-01-01T00:00:00Z'::TIMESTAMP)
DATE_BIN(INTERVAL '2 hours', time, '1970-01-01T00:00:00Z')
AS _time,
room,
selector_max(temp, time)['value'] AS 'max temp',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ list_code_example: |
sql="""
SELECT DATE_BIN(INTERVAL '2 hours',
time,
'1970-01-01T00:00:00Z'::TIMESTAMP) AS time,
'1970-01-01T00:00:00Z') AS time,
room,
selector_max(temp, time)['value'] AS 'max temp',
selector_min(temp, time)['value'] AS 'min temp',
Expand Down
2 changes: 1 addition & 1 deletion content/influxdb/cloud-dedicated/reference/sql/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ WHERE time >= timestamp '2019-09-10T00:00:00Z' AND time <= timestamp '2019-09-19
#### Examples

```sql
SELECT DATE_BIN(INTERVAL '1 hour', time, '2019-09-18T00:00:00Z'::timestamp) AS "_time",
SELECT DATE_BIN(INTERVAL '1 hour', time, '2019-09-18T00:00:00Z') AS "_time",
SUM(water_level)
FROM "h2o_feet"
GROUP BY "_time"
Expand Down
2 changes: 1 addition & 1 deletion content/influxdb/cloud-dedicated/reference/sql/where.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ and a `level description` field value that equals `below 3 feet`.
SELECT *
FROM h2o_feet
WHERE "location" = 'santa_monica'
AND "time" >= '2019-08-19T12:00:00Z'::timestamp AND "time" <= '2019-08-19T13:00:00Z'::timestamp
AND "time" >= '2019-08-19T12:00:00Z' AND "time" <= '2019-08-19T13:00:00Z'
```

{{< expand-wrapper >}}
Expand Down
2 changes: 1 addition & 1 deletion content/influxdb/cloud-serverless/get-started/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ WHERE
{{% influxdb/custom-timestamps %}}
```sql
SELECT
DATE_BIN(INTERVAL '1 hour', time, '2022-01-01T00:00:00Z'::TIMESTAMP) as _time,
DATE_BIN(INTERVAL '1 hour', time, '2022-01-01T00:00:00Z') as _time,
room,
selector_max(temp, time)['value'] AS 'max temp'
FROM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ list_code_example: |
##### Aggregate by time-based intervals
```sql
SELECT
DATE_BIN(INTERVAL '1 hour', time, '2022-01-01T00:00:00Z'::TIMESTAMP) AS time,
DATE_BIN(INTERVAL '1 hour', time, '2022-01-01T00:00:00Z') AS time,
mean(field1),
sum(field2),
tag1
Expand Down Expand Up @@ -206,7 +206,7 @@ groups:

```sql
SELECT
DATE_BIN(INTERVAL '2 hours', time, '1970-01-01T00:00:00Z'::TIMESTAMP) AS time
DATE_BIN(INTERVAL '2 hours', time, '1970-01-01T00:00:00Z') AS time
FROM home
...
```
Expand All @@ -224,7 +224,7 @@ groups:

```sql
SELECT
DATE_BIN(INTERVAL '2 hours', time, '1970-01-01T00:00:00Z'::TIMESTAMP) AS time
DATE_BIN(INTERVAL '2 hours', time, '1970-01-01T00:00:00Z') AS time
...
GROUP BY 1, room
...
Expand All @@ -234,7 +234,7 @@ groups:

```sql
SELECT
DATE_BIN(INTERVAL '2 hours', time, '1970-01-01T00:00:00Z'::TIMESTAMP) AS _time
DATE_BIN(INTERVAL '2 hours', time, '1970-01-01T00:00:00Z') AS _time
FROM home
...
GROUP BY _time, room
Expand All @@ -246,7 +246,7 @@ The following example retrieves unique combinations of time intervals and rooms

```sql
SELECT
DATE_BIN(INTERVAL '2 hours', time, '1970-01-01T00:00:00Z'::TIMESTAMP) AS time,
DATE_BIN(INTERVAL '2 hours', time, '1970-01-01T00:00:00Z') AS time,
room,
selector_max(temp, time)['value'] AS 'max temp',
selector_min(temp, time)['value'] AS 'min temp',
Expand Down Expand Up @@ -287,7 +287,7 @@ If you want to reference a calculated time column by name, use an alias differen

```sql
SELECT
DATE_BIN(INTERVAL '2 hours', time, '1970-01-01T00:00:00Z'::TIMESTAMP)
DATE_BIN(INTERVAL '2 hours', time, '1970-01-01T00:00:00Z')
AS _time,
room,
selector_max(temp, time)['value'] AS 'max temp',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ list_code_example: |
sql="""
SELECT DATE_BIN(INTERVAL '2 hours',
time,
'1970-01-01T00:00:00Z'::TIMESTAMP) AS time,
'1970-01-01T00:00:00Z') AS time,
room,
selector_max(temp, time)['value'] AS 'max temp',
selector_min(temp, time)['value'] AS 'min temp',
Expand Down Expand Up @@ -80,7 +80,7 @@ import tabulate
sql="""
SELECT DATE_BIN(INTERVAL '2 hours',
time,
'1970-01-01T00:00:00Z'::TIMESTAMP) AS time,
'1970-01-01T00:00:00Z') AS time,
room,
selector_max(temp, time)['value'] AS 'max temp',
selector_min(temp, time)['value'] AS 'min temp',
Expand Down
2 changes: 1 addition & 1 deletion content/influxdb/cloud-serverless/reference/sql/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ WHERE time >= timestamp '2019-09-10T00:00:00Z' AND time <= timestamp '2019-09-19
#### Examples

```sql
SELECT DATE_BIN(INTERVAL '1 hour', time, '2019-09-18T00:00:00Z'::timestamp) AS "_time",
SELECT DATE_BIN(INTERVAL '1 hour', time, '2019-09-18T00:00:00Z') AS "_time",
SUM(water_level)
FROM "h2o_feet"
GROUP BY "_time"
Expand Down
2 changes: 1 addition & 1 deletion content/influxdb/cloud-serverless/reference/sql/where.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ and a `level description` field value that equals `below 3 feet`.
SELECT *
FROM h2o_feet
WHERE "location" = 'santa_monica'
AND "time" >= '2019-08-19T12:00:00Z'::timestamp AND "time" <= '2019-08-19T13:00:00Z'::timestamp
AND "time" >= '2019-08-19T12:00:00Z' AND "time" <= '2019-08-19T13:00:00Z'
```

{{< expand-wrapper >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ list_code_example: |
sql="""
SELECT DATE_BIN(INTERVAL '2 hours',
time,
'1970-01-01T00:00:00Z'::TIMESTAMP) AS time,
'1970-01-01T00:00:00Z') AS time,
room,
selector_max(temp, time)['value'] AS 'max temp',
selector_min(temp, time)['value'] AS 'min temp',
Expand Down
2 changes: 1 addition & 1 deletion content/influxdb/clustered/reference/sql/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ WHERE time >= timestamp '2019-09-10T00:00:00Z' AND time <= timestamp '2019-09-19
#### Examples

```sql
SELECT DATE_BIN(INTERVAL '1 hour', time, '2019-09-18T00:00:00Z'::timestamp) AS "_time",
SELECT DATE_BIN(INTERVAL '1 hour', time, '2019-09-18T00:00:00Z') AS "_time",
SUM(water_level)
FROM "h2o_feet"
GROUP BY "_time"
Expand Down
2 changes: 1 addition & 1 deletion content/influxdb/clustered/reference/sql/where.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ and a `level description` field value that equals `below 3 feet`.
SELECT *
FROM h2o_feet
WHERE "location" = 'santa_monica'
AND "time" >= '2019-08-19T12:00:00Z'::timestamp AND "time" <= '2019-08-19T13:00:00Z'::timestamp
AND "time" >= '2019-08-19T12:00:00Z' AND "time" <= '2019-08-19T13:00:00Z'
```

{{< expand-wrapper >}}
Expand Down