Title
#users-public
John M.

John M.

09/14/2022, 3:15 AM
I have a table that has some fields of type BYTE as follows (real table has multiple, but I cut the extras for simplicity sake here):
CREATE TABLE trade
(
time TIMESTAMP,
sym SYMBOL,
price DOUBLE,
size INT,
cond BYTE
)
when I try to insert data to that byte field using https://github.com/questdb/net-questdb-client I get an exception with "Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.." and no data inserted. Insert code like this:
ls.Table("trade")
.Symbol("sym", (string)trade.Symbol)
.Column("price", (float)trade.Price)
.Column("size", (short)trade.Size)
.Column("cond", (byte)trade.TradeCondition)
.At(trade.ExTime);
Any other data type works though (so if I just remove any "byte" columns from schema/inserts it works fine). Is there some known issue inserting BYTE types using the net-questdb-client, or am I just doing something wrong?
Andrey Pechkurov

Andrey Pechkurov

09/14/2022, 5:06 AM
Hi John, Influx Line Protocol doesn't support byte type. Instead, it supports 64-bit integer (long) type. But if you write a long value into a byte column over ILP, the server will cast it automatically. See the cast table here along with some examples:https://questdb.io/docs/reference/api/ilp/columnset-types#integer
John M.

John M.

09/14/2022, 6:18 AM
thank you!
Andrey Pechkurov

Andrey Pechkurov

09/14/2022, 6:18 AM
You're welcome!