Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
n_campbell
Regular Visitor

DatabaseMetadata.getExported or Imported keys does not return metadata for a warehouse/lakehouse

One or more tables were defined (alter table...) with primary, unique and foreign key constraints.

A connection is established to a warehouse or lakehouse end point.

When the DatabaseMetadata.getImported/ExportedKeys method is called for a specified table in a schema, no metadata (empty Resultset) is returned. Only DatabaseMetadata.getPrimaryKeys returns constraint metadata for a table.

Is this a known defect?

Changing method reference from primary to exported/imported will result in no metadata.

System.out.println("Get constraints");
int i = 0;
try (ResultSet rsFunctions = dbMeta.getPrimaryKeys("dqm_warehouse", "dbcert", "TCONS3");) {
while (rsFunctions.next()) {
System.out.println(rsFunctions.getString(1) + "." + rsFunctions.getString(2) + "."
+ rsFunctions.getString(3));
++i;
}
}
System.out.println("Constraints found " + i);

0 REPLIES 0

Helpful resources

Announcements
August Fabric Update Carousel

Fabric Monthly Update - August 2025

Check out the August 2025 Fabric update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.