A correct energy SQL query can still answer the wrong time period
For time-series analytics, query review cannot reveal measurements that never arrived. Completeness, units and gap treatment have to travel with the answer.
An energy text-to-SQL system can generate valid SQL, execute it successfully and still answer a different question from the one the user asked.
Logiciel Solutions describes the failure mode with a quarterly site-average request. If one site has eleven days of missing readings, a query that averages the rows present is arithmetically correct—but the result covers less than the requested quarter. Because the missing intervals are absent from the table, reviewing the generated SQL does not reveal the substitution.
That distinction matters for any natural-language interface over meter, sensor or historian data: execution success is not period completeness.
Put completeness in the result contract
Logiciel’s recommended design starts before generation. The semantic layer should encode each asset’s expected interval frequency, allowing the system to compute the proportion of expected readings that arrived alongside every aggregate. The answer should display that completeness measure rather than leave it as optional metadata.
This changes the acceptance test. Do not ask only whether generated SQL matches an approved query. Ask whether an answer for a requested period also states:
- the expected and observed interval coverage;
- how missing intervals were treated;
- whether any values were interpolated; and
- which period the returned aggregate actually represents.
A system that cannot supply those fields should not present a partial-period average as an unqualified quarterly result.
Units belong in the same boundary
Time-series sources may report at different granularities and in different units. Logiciel argues that conversion should happen centrally in the semantic layer, with mixed-unit aggregation prevented rather than repaired by each generated query. Aggregation rules also need explicit definitions: averaging pre-aggregated site values can weight a small site the same as a large one, even when that is not the intended business calculation.
The safe generation surface is therefore smaller than the raw warehouse schema. It consists of curated metrics with expected intervals, normalized units, gap policy and aggregation semantics attached.
Separate measurement from inference
Interpolation introduces another provenance boundary. If filled values are indistinguishable from observed readings, an answer can turn an estimate into apparent fact. Logiciel recommends marking interpolated values and stating gap treatment with the result.
This is practitioner guidance from a consultancy, not a published cross-system benchmark; the page does not name the energy client behind its example or provide an independently reproducible evaluation. But the implementation test is concrete: remove a known block of intervals, ask for the full-period aggregate, and verify that the interface reports incomplete coverage instead of returning a bare number.
For energy data, visible SQL is useful but insufficient. The answer contract must expose what the query cannot: the measurements that should have existed and did not.
sources
comments · 0