Try using TDengine v2.3.3.0 with restful API.
Insert some data like this with binary data type. Insert data into some sub tables with different lengths of value. Then do distinct query of the column.
create stable stb1 (ts timestamp, name binary(10)) tags(n int);
insert into tb1 using stb1 tags(1) values(now, 'a');
insert into tb2 using stb1 tags(2) values(now, 'bc');
insert into tb3 using stb1 tags(3) values(now, 'def');
insert into tb4 using stb1 tags(4) values(now, 'ghij');
insert into tb5 using stb1 tags(5) values(now, 'klmno');
insert into tb6 using stb1 tags(6) values(now, 'pqrs');
insert into tb7 using stb1 tags(7) values(now, 'tuv');
insert into tb8 using stb1 tags(8) values(now, 'wx');
insert into tb9 using stb1 tags(9) values(now, 'y');
Query data with curl:
curl -u root:taosdata -d 'select distinct(name) from test01.stb1' localhost:6041/rest/sql | \
jq '.data[][0]' -r |sort
The result is
a
bc
def
ghij
klmno
pqrso
tuvso
wxvso
yxvso
Sorry for the bad experience, this bug will be fixed in next version of TDengine. You could build and replace taosadapter with the github version currently.