Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: execute ignore type with null #68

Open
TCeason opened this issue Apr 25, 2024 · 1 comment
Open

bug: execute ignore type with null #68

TCeason opened this issue Apr 25, 2024 · 1 comment

Comments

@TCeason
Copy link

TCeason commented Apr 25, 2024

Create table:

./target/debug/bendsql                                                                                                                                                                                ✔  eason@databend-arch1 
Welcome to BendSQL 0.17.0-1f08d67(2024-04-25T02:50:17.575815250Z).
Connecting to localhost:8000 as user root.
Connected to Databend Query v1.2.329-nightly-2e3459707e(rust-1.77.0-nightly-2024-04-24T06:04:56.359605219Z)

:) select * from t;
tuple res is Tuple([Nullable(Number(Int32)), Nullable(Nullable(String))])

SELECT
  *
FROM
  t

┌──────────────────────────────────────────────────────────────┐
│                              id                              │
│ Nullable(Tuple(Nullable(Int32), Nullable(Nullable(String)))) │
├──────────────────────────────────────────────────────────────┤
│ NULL                                                         │
└──────────────────────────────────────────────────────────────┘
1 row read in 0.084 sec. Processed 1 row, 31B (11.89 rows/s, 368B/s)

:) show create table t;

SHOW CREATE TABLE t

┌─────────────────────────────────────────────────────────────────────────────────────┐
│  Table │                                Create Table                                │
│ String │                                   String                                   │
├────────┼────────────────────────────────────────────────────────────────────────────┤
│ t      │ CREATE TABLE t (\n  id TUPLE(1 INT32, 2 ARRAY(STRING)) NULL\n) ENGINE=FUSE │
└─────────────────────────────────────────────────────────────────────────────────────┘
1 row read in 0.073 sec. Processed 0 row, 0B (0 row/s, 0B/s)

:) 
Bye~

The type of id is : Nullable(Tuple(Nullable(Int32), Nullable(Nullable(String))))

But in databend-py type of id is :Tuple(Int32 NULL, Array(String NULL

ignore a ) quote and The type is not null.

cat ~/a.py                                                                                                                                                                                  ✔  2m 5s   eason@databend-arch1 
#!/usr/bin/env python3


from databend_py import Client

client = Client.from_url("http://root:root@localhost:8000")
ct, res = client.execute('select * from t', with_column_types=True)
print(ct)
print(res)
    /data/eason/bendsql    main ⇡227 !1  python3 ~/a.py                                                                                                                                                                                        ✔  eason@databend-arch1 
[('id', 'Tuple(Int32 NULL, Array(String NULL')]
[('NULL',)]
@hantmac
Copy link
Member

hantmac commented May 8, 2024

@TCeason The raw response in python is [{'name': 'id', 'type': 'Nullable(Tuple(Int32 NULL, Array(String NULL) NULL))'}] as shown in the following pic:

image

So I need to shown the colum type as : Nullable(Tuple(Int32 NULL, Array(String NULL) NULL))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants