Skip to content

Commit

Permalink
#362 Improve fetching descriptions for databases that keep table cata…
Browse files Browse the repository at this point in the history
…log always in lowercase.
  • Loading branch information
yruslan committed Feb 27, 2024
1 parent 3ff801e commit 248b41c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,12 @@ object JdbcSparkUtils {
dbMetadata.getColumns(parts(0), null, parts(1), null)
}
} else {
// table only
dbMetadata.getColumns(null, null, fullTableName.toUpperCase, null)
// Table only. The exact casing was already checked. Checking upper and lower casing in case
// the JDBC driver is case-sensitive, but objects ub db metadata are automatically upper- or lower- cased.
if (dbMetadata.getColumns(null, null, fullTableName.toUpperCase, null).next())
dbMetadata.getColumns(null, null, fullTableName.toUpperCase, null)
else
dbMetadata.getColumns(null, null, fullTableName.toLowerCase, null)
}
} else {
// table only
Expand Down

0 comments on commit 248b41c

Please sign in to comment.