KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ Store array of bytes in a table column

  • Store array of bytes in a table column

    Posted by RVR on September 11, 2024 at 3:29 pm

    I have a table like t:([] k:symbol$(); v:byte$()). The size of column v is 1 here. As per the documentation this corresponds to JAVA Byte. How can we store a byte array Byte[]?

    RVR replied 2 months, 1 week ago 2 Members · 2 Replies
  • 2 Replies
  • rocuinneagain

    Member
    September 11, 2024 at 4:18 pm

    q does not have a type for lists of lists so you use the generic untyped list ()

    q)tab:([] bytesCol:())
    q)`tab insert enlist (0x0021;0x0002232)
    0 1
    q)tab
    bytesCol
    ----------
    0x0021
    0x00002232
    q)meta tab
    c | t f a
    --------| -----
    bytesCol| X
    q)type tab`bytesCol
    0h
    • RVR

      Member
      September 11, 2024 at 6:41 pm

      Exactly what I was looking for. Thanks 🙂

Log in to reply.