Skip to content

Internal error: Primary key column should not be none #33848

@Link-Tian

Description

@Link-Tian

Bug Description

I am encountering an internal error of Primary key column should not be none while executing this sql below

INSERT INTO us.ohlcv_1d(tbname, symbol, ts, open, high, low, close, volume) SELECT tbname, symbol, '2025-12-01T00:00:00.000-05:00', first(open), max(high), min(low), last(close), sum(volume) FROM us.ohlcv_1m WHERE symbol = 'AAPL' AND ts >= '2025-12-01T00:00:00.000-05:00' AND ts < '2025-12-02T00:00:00.000-05:00' PARTITION BY tbname, symbol

If I just execute the subquery alone, I get the correct result

SELECT tbname, symbol, '2025-12-01T00:00:00.000-05:00', first(open), max(high), min(low), last(close), sum(volume) FROM us.ohlcv_1m WHERE symbol = 'AAPL' AND ts >= '2025-12-01T00:00:00.000-05:00' AND ts < '2025-12-02T00:00:00.000-05:00' PARTITION BY tbname, symbol
Image

I'm wondering if there is something wrong with my SQL statement, or if the feature is not supported, or if it's a bug?

To Reproduce
Steps to reproduce the behavior:

Execute the following SQL statement

INSERT INTO us.ohlcv_1d(tbname, symbol, ts, open, high, low, close, volume) SELECT tbname, symbol, '2025-12-01T00:00:00.000-05:00', first(open), max(high), min(low), last(close), sum(volume) FROM us.ohlcv_1m WHERE symbol = 'AAPL' AND ts >= '2025-12-01T00:00:00.000-05:00' AND ts < '2025-12-02T00:00:00.000-05:00' PARTITION BY tbname, symbol

Expected Behavior

A piece of data is inserted into the us.ohlcv_1d Stable.

Screenshots

Image

Environment (please complete the following information):

  • OS: [e.g. CentOS 7.0]
    Docker image tdengine/tsdb
  • Memory, CPU, current Disk Space
    6G 6U 100G
  • TDengine Version [e.g. 1.6.1.7]
    3.3.8.8

Additional Context
No

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions