Alberto_Umana
Databricks Employee
Databricks Employee

Hello @NS2,

List of fields returned by Cursor.columns() in Databricks SQL Connector for Python: https://docs.databricks.com/en/dev-tools/python-sql-connector.html#cursor-class&language-Cluster

  • TABLE_CAT: The name of the catalog.
  • TABLE_SCHEM: The name of the schema.
  • TABLE_NAME: The name of the table.
  • COLUMN_NAME: The name of the column.
  • DATA_TYPE: The SQL data type of the column. This corresponds to Java SQL types
  • TYPE_NAME: The data source-dependent type name.
  • COLUMN_SIZE: The column size.
  • BUFFER_LENGTH: The buffer length.
  • DECIMAL_DIGITS: The number of decimal digits.
  • NUM_PREC_RADIX: The radix (typically either 10 or 2).
  • NULLABLE: Whether the column allows NULL values.
  • REMARKS: A description of the column.
  • COLUMN_DEF: The default value of the column.
  • SQL_DATA_TYPE: The SQL data type.
  • SQL_DATETIME_SUB: The SQL datetime subcode.
  • CHAR_OCTET_LENGTH: The maximum number of bytes in the column.
  • ORDINAL_POSITION: The index of the column in the table (starting at 1).
  • IS_NULLABLE: Whether the column allows NULL values (YES/NO).
  • SCOPE_CATALOG: The catalog of the table that is the scope of a reference attribute.
  • SCOPE_SCHEMA: The schema of the table that is the scope of a reference attribute.
  • SCOPE_TABLE: The table name that is the scope of a reference attribute.
  • SOURCE_DATA_TYPE: The source type of a distinct type or user-generated Ref type.
  • IS_AUTOINCREMENT: Whether the column is auto-incremented (YES/NO).
  • IS_GENERATEDCOLUMN: Whether the column is a generated column (YES/NO).

View solution in original post