You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "PDGGK (via GitHub)" <gi...@apache.org> on 2026/07/20 17:57:21 UTC
[PR] Add table-model query support to the Grafana data source plugin [iotdb-extras]
PDGGK opened a new pull request, #114:
URL: https://github.com/apache/iotdb-extras/pull/114
## What
Adds table-model query support to the IoTDB Grafana data source plugin — the first slice of #18258.
The plugin previously only spoke the tree model: both QueryEditor modes build `root.*` paths and the backend calls `/grafana/v1/query/expression`, which has no table-model equivalent, so table-model users could not visualize their data.
## How
- **New QueryEditor mode "SQL: Table Model"** — a database field, a SQL editor and a result format option, alongside the existing "SQL: Full Customized" and "SQL: Drop-down List" modes.
- **Reuses IoTDB's existing table REST API** (`POST /rest/table/v1/query`) instead of adding a new server endpoint — the Go backend sends `{database, sql}` and parses the row-major `QueryDataSet`.
- **Typed, nullable fields driven by `data_types`** — TIMESTAMP → time, INT32/INT64 → int64, FLOAT/DOUBLE → float64, BOOLEAN → bool, TEXT/others → string — so column types are exact instead of guessed the way the tree-model path is.
- **Multi-device results render as separate series**: in the default `Time series` format, rows are sorted by the first TIMESTAMP column and a long-shaped result (time + tag columns + value columns) is pivoted with the SDK's `data.LongToWide`, turning tag columns into field labels — `SELECT time, device_id, temperature FROM t` draws one line per device instead of one interleaved series. The `Table` format returns rows untouched (preserves a user's `ORDER BY`). If the pivot cannot apply (e.g. null timestamps), the plain frame is returned.
- **`$__timeFilter(col)` / `$__timeFrom` / `$__timeTo` macros** expand to the panel's range; the function forms `$__timeFrom()` / `$__timeTo()` familiar from Grafana's SQL data sources are accepted too, and `$__timeFilter` allows one level of nested parentheses.
- **Timestamp precision support**: the table REST endpoint returns TIMESTAMP values (and compares integer time literals) in the server's configured `timestamp_precision`, unlike the tree-model `/grafana/v1` endpoints which normalize to ms server-side. A new data source `time precision` option (ms default / us / ns) scales both the macro expansion and the TIMESTAMP field rendering, so the mode works on non-ms servers. (Auto-discovery was considered and rejected: `SHOW VARIABLES` requires the SYSTEM privilege in the table model.)
- **`UseNumber` decoding** so INT64 values above 2^53 keep full precision.
- **README**: documents the new mode, the macros, the format option, the precision option and the server-side row limit (`rest_query_default_row_size_limit`).
## Testing
- Backend: `go build`, `go vet`, and `go test ./pkg/plugin` (13 unit tests) pass — covering row-major frame building, per-type conversion, null handling, macro expansion (including the function forms and nested parentheses), INT64 precision, us/ns timestamp rendering, the long-to-wide pivot for multi-device results (including the unsorted-input and null-timestamp fallback paths), Table-format row-order preservation, and error responses. The orientation and precision tests are written to fail against an incorrect implementation.
- Frontend: type-checked with `tsc --noEmit` against the `@grafana` types.
- The request/response contract was verified against the `/rest/table/v1` OpenAPI spec, `QueryDataSetHandler`, `RestApiServiceImpl` and `IoTDBRestServiceIT` (row-major orientation, per-type JSON serialization incl. DATE/BLOB/STRING, error shape, row-limit behavior, and the precision behavior above). It has not yet been smoke-tested against a live server.
## Follow-ups (same issue)
Database → table → column browser, a visual query builder, a default row limit to bound large `SELECT`s, path-picker performance, and the Grafana plugin SDK / Go backend modernization (the current `@grafana/toolkit` toolchain is deprecated).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add table-model query support to the Grafana data source plugin [iotdb-extras]
Posted by "CritasWang (via GitHub)" <gi...@apache.org>.
CritasWang commented on PR #114:
URL: https://github.com/apache/iotdb-extras/pull/114#issuecomment-5055083611
Both points look good to me.
The `verifyQuery` fix is correct: requiring the database means every table-model query always runs `USE <database>` on its checked-out session, so there is no path by which a session's leftover state from a previous query can influence a result — regardless of pool scheduling or how many panels share the datasource. The comment in the code explains the reasoning clearly.
The smoke-test caveat (backend path only, not through a rendered Grafana panel) is acceptable given the agreed toolchain situation. The scenarios you covered — multi-database pool sharing, all-types round-trip including INT64 above 2^53, ISO-8601 macro expansion on a live server, error surfacing — are exactly what matters for this PR. The in-Grafana screenshot can follow with the toolchain-migration PR as discussed.
LGTM from my side. Waiting for CI on the latest commit to go green, then this is ready to merge.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add table-model query support to the Grafana data source plugin [iotdb-extras]
Posted by "PDGGK (via GitHub)" <gi...@apache.org>.
PDGGK commented on PR #114:
URL: https://github.com/apache/iotdb-extras/pull/114#issuecomment-5030415673
Thanks @CritasWang @HTHou — done: the table-model backend now goes through [apache/iotdb-client-go](https://github.com/apache/iotdb-client-go) v2.0.8 (`TableSession`) instead of the REST API (bb4ffad).
Notes on what the switch changed:
- The native client connects to the **RPC port** rather than the REST port, so the datasource gained an optional `rpc address` setting; when left empty the plugin uses the URL's host with the default port 6667. Sessions come from a lazily created per-datasource `TableSessionPool`, so datasources that only use the tree model never open an RPC connection. Tree-model queries and the health check still use the REST service — moving those over is probably best folded into the SDK/toolchain modernization.
- Values now arrive as typed Go values, which removed the whole JSON `UseNumber`/`interface{}` coercion layer, and the client converts TIMESTAMP values with the server-reported timestamp precision. That also let me simplify the time macros: `$__timeFilter` / `$__timeFrom` / `$__timeTo` now expand to ISO 8601 UTC literals (e.g. `2020-09-13T12:26:40.000+00:00`), which parse correctly under any server `timestamp_precision`, instead of epoch-ms integers.
- The per-query database is applied with `USE` on the pooled session; DATE/BLOB render the same as before (`yyyy-MM-dd` / `0x…` hex). And as you said, the REST row cap no longer applies — the README now recommends a `LIMIT` clause for wide scans.
- The stale "column-major" comments Copilot flagged went away with the rewrite.
On the toolchain: I'll take the `@grafana/toolkit` → `@grafana/create-plugin` migration as the immediate follow-up PR, as suggested — that keeps this one reviewable on its own. It's also the natural place for the remaining frontend bot notes (Jest coverage for the new mode, and the pre-existing QueryEditor props-mutation / state-update patterns CodeQL flags), since the editor code gets reworked there anyway.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add table-model query support to the Grafana data source plugin [iotdb-extras]
Posted by "PDGGK (via GitHub)" <gi...@apache.org>.
PDGGK commented on PR #114:
URL: https://github.com/apache/iotdb-extras/pull/114#issuecomment-5042738662
Both points addressed:
**1. USE state leak — fixed by making the database required.** `verifyQuery` now rejects an empty database in table-model mode ("Input error, DATABASE is required"), the editor marks the field required, and the README documents it. Since every query now always runs `USE <database>` on its checked-out session before executing, leftover session state can never influence a result regardless of pool scheduling. Fully-qualified `db.table` references still work and take precedence over the session database.
**2. Live smoke test** — ran the new mode end-to-end against a real IoTDB 2.0.8 (`apache/iotdb:2.0.8-standalone`, RPC 6667), driving `queryTableModel` — the exact entry point Grafana calls — with real panel-range parameters over the native RPC path (connect, session-open auth as root, per-query `USE`, timeout, fetch):
- `SELECT time, device, temperature FROM env WHERE $__timeFilter(time)` (database `smoke1`, 2 devices) → pivoted into 2 labeled series (`device=d1`, `device=d2`), 2 points each
- the same query in `Table` format → 3 plain columns, 4 rows, server row order preserved
- `WHERE time >= $__timeFrom() AND time <= $__timeTo()` → the ISO-8601 literal expansion parsed and filtered correctly on the live server
- all-types round trip: TIMESTAMP / TEXT / FLOAT / INT32 / INT64 (`9007199254740993`, above 2^53, exact) / BOOLEAN / DATE (`2025-07-14`) / BLOB (`0xcafebabe`)
- **the point-1 scenario: 3 alternating rounds of `smoke1` (4 rows) / `smoke2` (1 row, device `d9`) panels sharing one session pool — each panel saw exactly its own database every round**
- a bad query → the server error surfaces as the panel error
One honest caveat: this drove the backend query path directly rather than a rendered Grafana panel — the current `@grafana/toolkit` toolchain can't produce a dev build on modern Node, which is the follow-up PR we agreed on. I'll post an in-Grafana screenshot of the same dashboards as part of that toolchain-migration PR, where the frontend becomes buildable again. The smoke harness is a small build-tagged Go test; happy to include it in this PR if you'd find it useful for CI or reproduction.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add table-model query support to the Grafana data source plugin [iotdb-extras]
Posted by "CritasWang (via GitHub)" <gi...@apache.org>.
CritasWang merged PR #114:
URL: https://github.com/apache/iotdb-extras/pull/114
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add table-model query support to the Grafana data source plugin [iotdb-extras]
Posted by "CritasWang (via GitHub)" <gi...@apache.org>.
CritasWang commented on PR #114:
URL: https://github.com/apache/iotdb-extras/pull/114#issuecomment-5041691147
Thanks for the quick turnaround on the native-client switch — the new backend reads well, and deferring the toolchain migration (plus the remaining frontend bot notes) to the follow-up PR is exactly what we agreed. Two things before this can be merged:
**1. `USE` state leaks across pooled sessions**
`queryTableModel` executes `USE <database>` on a pooled session and then returns it to the pool. In iotdb-client-go v2.0.8, `PooledTableSession.Close()` only restores the database when the pool itself has one configured ([tablesessionpool.go](https://github.com/apache/iotdb-client-go/blob/v2.0.8/client/tablesessionpool.go)):
```go
if s.session.config.Database != s.sessionPool.config.Database && s.sessionPool.config.Database != "" {
err := s.session.ExecuteNonQueryStatement("use " + s.sessionPool.config.Database)
```
The pool created in `getTablePool` sets only Host/Port/UserName/Password, so `config.Database` is empty and this reset branch never runs. Consequence: query A runs `USE db1` and returns the session; query B with an empty database field may then pick up that "dirty" session and silently query `db1` — nondeterministically, depending on pool scheduling. Any dashboard mixing panels with different (or empty) database values on the same datasource will hit this.
Either fix works for me:
- make the database field required for the table-model mode (frontend validation + reject empty in `verifyQuery`) — simplest and most predictable; or
- reset the session's database state on every checkout before running the query.
**2. Please smoke-test against a live server before merge**
The PR description notes the new path "has not yet been smoke-tested against a live server", and the 13 unit tests all sit behind the mocked result-set interface — the actual RPC path (connect, auth, `USE`, timeouts, timestamp precision) hasn't been exercised end-to-end. Please run the new mode against a real IoTDB 2.x instance with a Grafana panel and post the result here (a screenshot or a short list of the queries you ran is fine). A multi-panel / multi-database scenario would also directly verify the fix for point 1.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add table-model query support to the Grafana data source plugin [iotdb-extras]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #114:
URL: https://github.com/apache/iotdb-extras/pull/114#discussion_r3618972947
##########
connectors/grafana-plugin/pkg/plugin/table_query.go:
##########
@@ -0,0 +1,396 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package plugin
+
+import (
+ "bytes"
+ "context"
+ "encoding/json"
+ "errors"
+ "io"
+ "net/http"
+ "regexp"
+ "sort"
+ "strconv"
+ "strings"
+ "time"
+
+ "github.com/grafana/grafana-plugin-sdk-go/backend"
+ "github.com/grafana/grafana-plugin-sdk-go/backend/log"
+ "github.com/grafana/grafana-plugin-sdk-go/data"
+)
+
+// TableModelSqlType is the QueryEditor mode that sends standard table-model SQL
+// straight to IoTDB's table REST interface, as opposed to the tree-model modes
+// ("SQL: Full Customized" / "SQL: Drop-down List") that build root.* paths.
+const TableModelSqlType = "SQL: Table Model"
+
+// Result formats for the table-model mode. Time series (the default) sorts
+// rows ascending by the first TIMESTAMP column and pivots a long-shaped result
+// (time + tag columns + value columns) into one labeled series per tag
+// combination; Table returns the rows exactly as the server sent them.
+const (
+ tableFormatTimeSeries = "Time series"
+ tableFormatTable = "Table"
+)
+
+// tableQueryPath is IoTDB's table-model query endpoint (see the /rest/table/v1
+// RestApi). It accepts a standard SQL statement plus an optional database
+// context and returns a column-major QueryDataSet.
Review Comment:
The comment says the table REST endpoint returns a "column-major QueryDataSet", but this file (and the tests) treat the response as row-major (values[row][col]). The comment should be corrected to avoid misleading future maintainers.
##########
connectors/grafana-plugin/src/QueryEditor.tsx:
##########
@@ -247,14 +279,30 @@ export class QueryEditor extends PureComponent<Props, State> {
control: '',
});
onChange({ ...query, sqlType: value, isDropDownList: true });
+ } else {
+ this.props.query.sqlType = selectType[2];
+ this.props.query.expression = [''];
+ this.props.query.prefixPath = [''];
+ this.props.query.condition = '';
+ this.props.query.control = '';
+ this.props.query.isDropDownList = false;
+ this.setState({
+ isDropDownList: false,
+ sqlType: selectType[2],
+ expression: [''],
+ prefixPath: [''],
+ condition: '',
+ control: '',
+ });
+ onChange({ ...query, sqlType: value, isDropDownList: false });
}
Review Comment:
This branch mutates `this.props.query` directly (sqlType/expression/prefixPath/condition/control/isDropDownList). Mutating props can lead to stale renders and makes state/query synchronization harder; prefer constructing the next query object and passing it to `onChange` without writing into `this.props.query`.
##########
connectors/grafana-plugin/pkg/plugin/table_query.go:
##########
@@ -0,0 +1,396 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package plugin
+
+import (
+ "bytes"
+ "context"
+ "encoding/json"
+ "errors"
+ "io"
+ "net/http"
+ "regexp"
+ "sort"
+ "strconv"
+ "strings"
+ "time"
+
+ "github.com/grafana/grafana-plugin-sdk-go/backend"
+ "github.com/grafana/grafana-plugin-sdk-go/backend/log"
+ "github.com/grafana/grafana-plugin-sdk-go/data"
+)
+
+// TableModelSqlType is the QueryEditor mode that sends standard table-model SQL
+// straight to IoTDB's table REST interface, as opposed to the tree-model modes
+// ("SQL: Full Customized" / "SQL: Drop-down List") that build root.* paths.
+const TableModelSqlType = "SQL: Table Model"
+
+// Result formats for the table-model mode. Time series (the default) sorts
+// rows ascending by the first TIMESTAMP column and pivots a long-shaped result
+// (time + tag columns + value columns) into one labeled series per tag
+// combination; Table returns the rows exactly as the server sent them.
+const (
+ tableFormatTimeSeries = "Time series"
+ tableFormatTable = "Table"
+)
+
+// tableQueryPath is IoTDB's table-model query endpoint (see the /rest/table/v1
+// RestApi). It accepts a standard SQL statement plus an optional database
+// context and returns a column-major QueryDataSet.
+const tableQueryPath = "/rest/table/v1/query"
+
+// tableQueryReq is the request body for tableQueryPath. Field names match the
+// generated table/v1 SQL model (database / sql / row_limit).
+type tableQueryReq struct {
+ Database string `json:"database,omitempty"`
+ Sql string `json:"sql"`
+ RowLimit *int `json:"row_limit,omitempty"`
+}
+
+// tableQueryDataSet mirrors the table/v1 QueryDataSet response. Its values are
+// ROW-major (values[row][col]) because the table endpoint transposes before
+// serializing, unlike the tree-model endpoints. snake_case JSON. On failure
+// IoTDB returns an ExecutionStatus instead, whose code/message are captured
+// here so a non-zero code surfaces as an error.
+type tableQueryDataSet struct {
+ ColumnNames []string `json:"column_names"`
+ DataTypes []string `json:"data_types"`
+ Values [][]interface{} `json:"values"`
+ Code int32 `json:"code"`
+ Message string `json:"message"`
+}
+
+// timeFilterRe matches Grafana's $__timeFilter(column) macro; the column is
+// optional and defaults to "time". One level of nested parentheses is allowed
+// so expressions like $__timeFilter(cast(x)) survive intact.
+var timeFilterRe = regexp.MustCompile(`\$__timeFilter\(\s*((?:[^()]|\([^()]*\))*?)\s*\)`)
+
+// timeFromRe / timeToRe match $__timeFrom / $__timeTo, with or without the
+// trailing () that Grafana's SQL data sources use ($__timeFrom()).
+var (
+ timeFromRe = regexp.MustCompile(`\$__timeFrom\b(?:\s*\(\s*\))?`)
+ timeToRe = regexp.MustCompile(`\$__timeTo\b(?:\s*\(\s*\))?`)
+)
+
+// timestampUnits maps the datasource's timestampPrecision option (which must
+// match the server's timestamp_precision property) to conversion factors:
+// unitsPerMs scales the panel's epoch-ms range into server units for the time
+// macros, nsPerUnit scales raw TIMESTAMP values into nanoseconds for Grafana.
+func timestampUnits(precision string) (unitsPerMs int64, nsPerUnit int64) {
+ switch strings.TrimSpace(strings.ToLower(precision)) {
+ case "us":
+ return 1000, int64(time.Microsecond)
+ case "ns":
+ return 1000000, 1
+ default: // ms is IoTDB's default timestamp_precision
+ return 1, int64(time.Millisecond)
+ }
+}
+
+// expandTableMacros rewrites the Grafana time macros a dashboard author can put
+// in table-model SQL into concrete bounds for the panel's range:
+//
+// $__timeFilter(col) -> (col >= <from> AND col <= <to>)
+// $__timeFrom[()] -> <from>
+// $__timeTo[()] -> <to>
+//
+// Bounds are epoch values in the server's timestamp precision (milliseconds
+// unless the datasource says otherwise), matching how IoTDB compares integer
+// literals against TIMESTAMP columns.
+func expandTableMacros(sql string, start int64, end int64) string {
+ from := strconv.FormatInt(start, 10)
+ to := strconv.FormatInt(end, 10)
+ sql = timeFilterRe.ReplaceAllStringFunc(sql, func(m string) string {
+ col := strings.TrimSpace(timeFilterRe.FindStringSubmatch(m)[1])
+ if col == "" {
+ col = "time"
+ }
+ return "(" + col + " >= " + from + " AND " + col + " <= " + to + ")"
+ })
+ sql = timeFromRe.ReplaceAllString(sql, from)
+ sql = timeToRe.ReplaceAllString(sql, to)
+ return sql
+}
+
+// queryTableModel runs a table-model SQL query against IoTDB's table REST
+// endpoint and turns the column-major QueryDataSet into a Grafana data frame.
+func (d *IoTDBDataSource) queryTableModel(ctx context.Context, qp *queryParam, authorization string) backend.DataResponse {
Review Comment:
This comment refers to a "column-major QueryDataSet", but the table-model response is handled as row-major (values[row][col]) throughout this file. Align the wording with the actual orientation to prevent confusion.
##########
connectors/grafana-plugin/src/datasource.ts:
##########
@@ -126,6 +126,13 @@ export class DataSource extends DataSourceWithBackend<IoTDBQuery, IoTDBOptions>
if (query.fillClauses) {
query.fillClauses = getTemplateSrv().replace(query.fillClauses, scopedVars);
}
+ } else if (query.sqlType === 'SQL: Table Model') {
+ if (query.sql) {
+ query.sql = getTemplateSrv().replace(query.sql, scopedVars);
+ }
+ if (query.database) {
+ query.database = getTemplateSrv().replace(query.database, scopedVars);
+ }
Review Comment:
The new `SQL: Table Model` branch in `applyTemplateVariables` adds templating behavior for `sql` and `database`, but there are no corresponding unit tests (existing tests cover the other modes). Adding a Jest test case would prevent regressions in macro/template expansion for table-model queries.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add table-model query support to the Grafana data source plugin [iotdb-extras]
Posted by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org>.
github-advanced-security[bot] commented on code in PR #114:
URL: https://github.com/apache/iotdb-extras/pull/114#discussion_r3618955062
##########
connectors/grafana-plugin/src/QueryEditor.tsx:
##########
@@ -175,7 +201,13 @@
componentDidMount() {
if (this.props.query.sqlType) {
- this.setState({ isDropDownList: this.props.query.isDropDownList, sqlType: this.props.query.sqlType });
+ this.setState({
+ isDropDownList: this.props.query.isDropDownList,
+ sqlType: this.props.query.sqlType,
+ database: this.props.query.database ?? '',
+ sql: this.props.query.sql ?? '',
+ format: this.props.query.format ?? tableFormats[0],
+ });
Review Comment:
## CodeQL / Potentially inconsistent state update
Component state update uses [potentially inconsistent value](1).
Component state update uses [potentially inconsistent value](2).
Component state update uses [potentially inconsistent value](3).
Component state update uses [potentially inconsistent value](4).
Component state update uses [potentially inconsistent value](5).
[Show more details](https://github.com/apache/iotdb-extras/security/code-scanning/301)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add table-model query support to the Grafana data source plugin [iotdb-extras]
Posted by "CritasWang (via GitHub)" <gi...@apache.org>.
CritasWang commented on PR #114:
URL: https://github.com/apache/iotdb-extras/pull/114#issuecomment-5029456069
Thanks for the PR! Two requests before we move forward with the review:
1. **Please try switching the backend from the REST API to [apache/iotdb-client-go](https://github.com/apache/iotdb-client-go)** — see the discussion in apache/iotdb#18258 (comment by @HTHou). The native client should perform better than REST, and the latest release (v2.0.8) already provides table-model support (`TableSession` / `PooledTableSession`). It would also give us typed values directly instead of decoding JSON and coercing `interface{}` (the `UseNumber` / `toInt64` workarounds in `table_query.go`), and the server-side `rest_query_default_row_size_limit` cap would no longer apply.
2. **Please also modernize the frontend build toolchain in this effort** — the plugin still builds with `@grafana/toolkit` (pinned to `latest` in `package.json`), which has been deprecated and archived by Grafana. The recommended path is migrating to `@grafana/create-plugin`. If that makes this PR too large, it's fine to do it as an immediate follow-up PR, but we should not keep adding features on top of a dead toolchain for long.
The frontend part of this PR (the new QueryEditor mode, macros, format/precision options) looks like it can stay mostly as-is regardless of which transport the backend uses.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org