John M.

    John M.

    1 week ago
    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

    1 week ago
    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.

    1 week ago
    thank you!
    Andrey Pechkurov

    Andrey Pechkurov

    1 week ago
    You're welcome!