Skip to content

Commit 0402d8d

Browse files
committed
polish after review
1 parent 75e1599 commit 0402d8d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Databases/DataLake/GlueCatalog.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,10 @@ bool GlueCatalog::tryGetTableMetadata(
317317
{
318318
result.setDataLakeSpecificProperties(DataLakeSpecificProperties{.iceberg_metadata_file_location = table_params.at("metadata_location")});
319319
}
320-
else if (const auto & location = table_outcome.GetStorageDescriptor().GetLocation(); !location.empty())
320+
else if (table_outcome.GetStorageDescriptor().LocationHasBeenSet())
321321
{
322+
const auto & location = table_outcome.GetStorageDescriptor().GetLocation();
323+
322324
std::string location_with_slash = location;
323325
if (!location_with_slash.ends_with('/'))
324326
location_with_slash += '/';
@@ -509,6 +511,9 @@ bool GlueCatalog::classifyTimestampTZ(const String & column_name, const TableMet
509511
return false;
510512
}
511513

514+
/// This function tries two resolve the metadata file path by following means:
515+
/// 1. Tries to read version-hint.text to get the latest version.
516+
/// 2. Lists all *.metadata.json files in the metadata directory and takes the most recent one.
512517
String GlueCatalog::resolveMetadataPathFromTableLocation(const String & table_location, const TableMetadata & table_metadata) const
513518
{
514519
// Construct path to version-hint.text

0 commit comments

Comments
 (0)