Class ColumnLengths

java.lang.Object
dev.frostlake.types.ColumnLengths

public final class ColumnLengths extends Object
The length a client reads for a result column: a text column's length in characters and a binary column's in bytes, which Snowflake's driver answers as the column's precision and display size. Every other family has none.

Live-verified through the account's own JDBC driver: VARCHAR(9) reads 9, a table's bare VARCHAR 16777216, a cast to bare VARCHAR 134217728, u || u over two 16MB columns 33554432 and the NULL literal's VARCHAR 0; BINARY(5) reads 5 and a table's bare BINARY 8388608, while a binary the plan never sized — TO_BINARY, a cast to bare BINARY — reads the 64MB maximum, 67108864, as it does wherever its width is spelled.

  • Method Details

    • of

      public static Integer of(DataType type)
      The length of a column of the given type.
      Parameters:
      type - the column's declared type
      Returns:
      its length, or null for a type that has none