Skip to content

Empty query response #58

@zouxiang1993

Description

@zouxiang1993

Describe this problem

Steps to reproduce

  1. Create table
curl --location --request POST 'http://127.0.0.1:5440/sql' --data-raw '
CREATE TABLE `demo` (
    `name` string TAG,
    `value` double NOT NULL,
    `t` timestamp NOT NULL,
    `t2` timestamp NOT NULL,
    timestamp KEY (t))
ENGINE=Analytic
  with
(enable_ttl="false")
  1. Insert a row
curl --location --request POST 'http://127.0.0.1:5440/sql' --data-raw '
INSERT INTO demo (t, t2, name, value)
    VALUES (1651737067000, 1651737067009, "ceresdb", 100)
'
  1. Query by http interface
curl --location --request POST 'http://127.0.0.1:5440/sql' --data-raw '
SELECT t, avg(value) FROM `demo` group by t
'

response:

{"rows":[{"t":1651737067000,"AVG(demo.value)":100.0}]}
  1. Query by Java SDK
        CeresDBClient client = getClient();
        String query = "SELECT t, avg(value) FROM `demo` group by t";
        SqlQueryRequest request = new SqlQueryRequest(query);
        CompletableFuture<Result<SqlQueryOk, Err>> future = client.sqlQuery(request);
        Result<SqlQueryOk, Err> result = future.get();
        System.out.println(result);

The response's rowCount is 0.

Expected behavior

Additional Information

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