getTableColumnsMetadata
Retrieves column metadata from a JDBC ResultSet.
This method reads column metadata from ResultSetMetaData with graceful fallbacks for JDBC drivers that throw java.sql.SQLFeatureNotSupportedException for certain methods (e.g., Apache Hive).
Each DataFrame column is named by its label: the SQL AS alias, or the column name when there is no alias (see ResultSetMetaData.getColumnLabel). A name that repeats gets a number: name, name1; a repeated name_1 becomes name_11.
Fallback behavior for unsupported methods:
the DataFrame column name:
ResultSetMetaData.getColumnLabel→ResultSetMetaData.getColumnName→"untitled"; an empty label also falls back toResultSetMetaData.getColumnNamethe name the column has in its table, used to look up the table name and the nullability:
ResultSetMetaData.getColumnName→ResultSetMetaData.getColumnLabelgetTableName()→ thetablepart of a column nametable.column→nullisNullable()→DatabaseMetaData.getColumns, only when both the table name and the column name are known, and only for the column with exactly these names →true(assume nullable)getColumnTypeName()→"OTHER"getColumnType()→Types.OTHERgetColumnDisplaySize()→0getColumnClassName()→"java.lang.Object"
Override this method in subclasses to provide database-specific behavior (for example, to disable fallback for databases like Teradata or Oracle where DatabaseMetaData.getColumns is known to be slow).
Return
A list of TableColumnMetadata objects.
Parameters
The ResultSet containing query results.