databendlabs / bendsql

Databend Native Client
Apache License 2.0
49 stars 26 forks source link

bug: show wrong data type #438

Closed youngsofun closed 5 months ago

youngsofun commented 5 months ago
root@localhost:8000/default> CREATE TABLE array_int64_table(arr ARRAY(INT64));

CREATE TABLE array_int64_table(arr ARRAY(INT64))

0 row written in 0.217 sec. Processed 0 row, 0 B (0 row/s, 0 B/s)

root@localhost:8000/default> select * from array_int64_table;

SELECT
  *
FROM
  array_int64_table

0 row read in 0.479 sec. Processed 0 row, 0 B (0 row/s, 0 B/s)

root@localhost:8000/default> INSERT INTO array_int64_table
VALUES
([1, 2, 3, 4]),
([5, 6, 7, 8]);

INSERT INTO
  array_int64_table
VALUES
  ([1, 2, 3, 4]),
  ([5, 6, 7, 8])

2 rows written in 0.170 sec. Processed 2 rows, 90 B (11.79 rows/s, 530 B/s)

root@localhost:8000/default> select * from array_int64_table;

SELECT
  *
FROM
  array_int64_table

┌───────────────────────┐
│          arr          │
│ Nullable(Array(Null)) │
├───────────────────────┤
│ [1,2,3,4]             │
│ [5,6,7,8]             │
└───────────────────────┘
2 rows read in 0.066 sec. Processed 2 rows, 90 B (30.42 rows/s, 1.34 KiB/s)
youngsofun commented 5 months ago

curl return schema "schema":[{"name":"arr","type":"Nullable(Array(Int64 NULL))"}]

everpcpc commented 5 months ago
root@localhost:8000/default> select * from array_int64_table;

SELECT
  *
FROM
  array_int64_table

┌──────────────────────────────────┐
│                arr               │
│ Nullable(Array(Nullable(Int64))) │
├──────────────────────────────────┤
│ [1,2,3,4]                        │
│ [5,6,7,8]                        │
└──────────────────────────────────┘
2 rows read in 0.151 sec. Processed 2 rows, 90B (13.27 rows/s, 597B/s)

Cannot reproduce in v0.18.3