Package ai.velr

Class ArrowColumn

java.lang.Object
ai.velr.ArrowColumn

public final class ArrowColumn extends Object
One Arrow C Data Interface column to bind under a logical table name.

An ArrowColumn describes one named column and one or more Arrow C Data Interface chunks. It does not own the native Arrow structs; ownership follows the rules documented on cData(String, long, long) and chunks(String, List).

  • Method Details

    • cData

      public static ArrowColumn cData(String name, long schemaAddress, long arrayAddress)
      Create a column from Arrow C Data Interface struct addresses.

      The schema address points to an ArrowSchema struct borrowed for the duration of bindArrow. The array address points to an ArrowArray struct whose payload is transferred to Velr by bindArrow. After a successful or failed bind call, callers should close wrapper objects that own the struct memory, but must not call the ArrowArray release callback.

      Parameters:
      name - column name exposed to Cypher as a field on rows from BIND(...)
      schemaAddress - memory address of an ArrowSchema struct
      arrayAddress - memory address of an ArrowArray struct
      Returns:
      a single-chunk Arrow column descriptor
    • chunk

      public static ArrowColumn.Chunk chunk(long schemaAddress, long arrayAddress)
      Create one Arrow C Data Interface chunk from struct addresses.
      Parameters:
      schemaAddress - memory address of an ArrowSchema struct
      arrayAddress - memory address of an ArrowArray struct
      Returns:
      a chunk descriptor for use with chunks(String, Chunk...)
    • chunks

      public static ArrowColumn chunks(String name, ArrowColumn.Chunk... chunks)
      Create a chunked column from Arrow C Data Interface struct addresses.

      Each chunk follows the same ownership rules as cData(String, long, long). Schemas are borrowed for the duration of the bind call. Array payloads are transferred to Velr.

      Parameters:
      name - column name exposed to Cypher as a field on rows from BIND(...)
      chunks - one or more Arrow C Data Interface chunks
      Returns:
      a chunked Arrow column descriptor
    • chunks

      public static ArrowColumn chunks(String name, List<ArrowColumn.Chunk> chunks)
      Create a chunked column from Arrow C Data Interface struct addresses.

      Each chunk follows the same ownership rules as cData(String, long, long). Schemas are borrowed for the duration of the bind call. Array payloads are transferred to Velr.

      Parameters:
      name - column name exposed to Cypher as a field on rows from BIND(...)
      chunks - one or more Arrow C Data Interface chunks
      Returns:
      a chunked Arrow column descriptor
    • name

      public String name()
      Return the column name exposed to Cypher.
      Returns:
      column name
    • chunkCount

      public int chunkCount()
      Return the number of Arrow chunks in this column.
      Returns:
      chunk count
    • chunks

      public List<ArrowColumn.Chunk> chunks()
      Return the immutable chunk list.
      Returns:
      chunks in bind order
    • schemaAddress

      public long schemaAddress()
      Return the schema address for the first chunk.
      Returns:
      ArrowSchema address for chunk zero
    • arrayAddress

      public long arrayAddress()
      Return the array address for the first chunk.
      Returns:
      ArrowArray address for chunk zero
    • schemaAddress

      public long schemaAddress(int chunkIndex)
      Return the schema address for a chunk.
      Parameters:
      chunkIndex - zero-based chunk index
      Returns:
      ArrowSchema address
    • arrayAddress

      public long arrayAddress(int chunkIndex)
      Return the array address for a chunk.
      Parameters:
      chunkIndex - zero-based chunk index
      Returns:
      ArrowArray address