You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "dimas-b (via GitHub)" <gi...@apache.org> on 2025/08/26 22:35:37 UTC
Re: [PR] Add type-check to PolarisEntity subclass ctors [polaris]
dimas-b commented on code in PR #2302:
URL: https://github.com/apache/polaris/pull/2302#discussion_r2302294300
##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java:
##########
@@ -570,12 +573,15 @@ public boolean sendNotification(TableIdentifier identifier, NotificationRequest
* Fetch the metastore table entity for the given table identifier
*
* @param tableIdentifier The identifier of the table
- * @return the Polaris table entity for the table
+ * @return the Polaris table entity for the table or null for external catalogs
*/
- private IcebergTableLikeEntity getTableEntity(TableIdentifier tableIdentifier) {
+ private @Nullable IcebergTableLikeEntity getTableEntity(TableIdentifier tableIdentifier) {
PolarisResolvedPathWrapper target = resolutionManifest.getResolvedPath(tableIdentifier);
-
- return IcebergTableLikeEntity.of(target.getRawLeafEntity());
+ PolarisEntity rawLeafEntity = target.getRawLeafEntity();
+ if (rawLeafEntity.getType() == PolarisEntityType.TABLE_LIKE) {
+ return IcebergTableLikeEntity.of(rawLeafEntity);
+ }
+ return null; // could be an external catalog
Review Comment:
I wonder how the entity path ends up pointing to a `CATALOG` when it's a `loadTable` call :thinking:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org