You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "flyrain (via GitHub)" <gi...@apache.org> on 2025/03/06 08:08:57 UTC
[PR] Separate Polaris Entities POC [polaris]
flyrain opened a new pull request, #1128:
URL: https://github.com/apache/polaris/pull/1128
(no comment)
--
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
Re: [PR] Separate Polaris Entities [polaris]
Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on PR #1128:
URL: https://github.com/apache/polaris/pull/1128#issuecomment-2730217779
> As that's a more general approach, I really prefer to move this one into draft state and discuss the approach on the dev-ML.
@snazy, here is the dev mail list: https://lists.apache.org/thread/ghtoydoyqfpd3m5qhscqpbgzqm92cyd9. As @eric-maynard mentioned, it was here for a while.
--
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
Re: [PR] Separate Polaris Entities [polaris]
Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on code in PR #1128:
URL: https://github.com/apache/polaris/pull/1128#discussion_r1988385028
##########
service/common/src/main/java/org/apache/polaris/service/admin/PolarisAdminService.java:
##########
@@ -116,7 +117,7 @@ public class PolarisAdminService {
private final SecurityContext securityContext;
private final AuthenticatedPolarisPrincipal authenticatedPrincipal;
private final PolarisAuthorizer authorizer;
- private final PolarisMetaStoreManager metaStoreManager;
+ private final PolarisDaoManager daoManager;
Review Comment:
Using this class to show case how business logic invokes type-specific DAO objects. We can easily extend it to other classes like `BasePolarisCatalog`, `PolarisEntityManager` and `Resolver`
--
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
Re: [PR] Separate Polaris Entities [polaris]
Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on code in PR #1128:
URL: https://github.com/apache/polaris/pull/1128#discussion_r1987762174
##########
polaris-core/src/main/java/org/apache/polaris/core/persistence/dao/CatalogDao.java:
##########
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.core.persistence.dao;
+
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
+import java.util.List;
+import java.util.Map;
+import org.apache.polaris.core.PolarisCallContext;
+import org.apache.polaris.core.entity.PolarisBaseEntity;
+import org.apache.polaris.core.entity.PolarisEntityCore;
+import org.apache.polaris.core.persistence.dao.entity.CreateCatalogResult;
+import org.apache.polaris.core.persistence.dao.entity.DropEntityResult;
+import org.apache.polaris.core.persistence.dao.entity.EntityResult;
+import org.apache.polaris.core.persistence.dao.entity.ListEntitiesResult;
+import org.apache.polaris.core.persistence.dao.entity.ResolvedEntityResult;
+
+public interface CatalogDao {
+ CreateCatalogResult createCatalog(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisBaseEntity catalog,
+ @Nonnull List<PolarisEntityCore> principalRoles);
+
+ @Nonnull
+ EntityResult updateEntityPropertiesIfNotChanged(
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity entity);
+
+ @Nonnull
+ DropEntityResult dropEntityIfExists(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisEntityCore entityToDrop,
+ @Nullable Map<String, String> cleanupProperties,
+ boolean cleanup);
+
+ // TODO this should return a type-specific entity result, e.g., CatalogEntityResult
+ @Nonnull
+ EntityResult readEntityByName(@Nonnull PolarisCallContext callCtx, @Nonnull String name);
Review Comment:
As I put in the comment and dev mail list, the type-specific return entity refactor will come later.
--
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
Re: [PR] Separate Polaris Entities [polaris]
Posted by "sfc-gh-ygu (via GitHub)" <gi...@apache.org>.
sfc-gh-ygu commented on code in PR #1128:
URL: https://github.com/apache/polaris/pull/1128#discussion_r1988155954
##########
extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/jdbc/PostgresCatalogDaoImpl.java:
##########
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.extension.persistence.impl.jdbc;
+
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
+import java.util.List;
+import java.util.Map;
+import org.apache.polaris.core.PolarisCallContext;
+import org.apache.polaris.core.entity.PolarisBaseEntity;
+import org.apache.polaris.core.entity.PolarisEntityCore;
+import org.apache.polaris.core.persistence.dao.CatalogDao;
+import org.apache.polaris.core.persistence.dao.entity.CreateCatalogResult;
+import org.apache.polaris.core.persistence.dao.entity.DropEntityResult;
+import org.apache.polaris.core.persistence.dao.entity.EntityResult;
+import org.apache.polaris.core.persistence.dao.entity.ListEntitiesResult;
+import org.apache.polaris.core.persistence.dao.entity.ResolvedEntityResult;
+
+public class PostgresCatalogDaoImpl implements CatalogDao {
Review Comment:
yes, we should put them in a different module ideally. I put them here mainly for demo purpose. Let me remove it in the next commit.
--
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
Re: [PR] Separate Polaris Entities [polaris]
Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on PR #1128:
URL: https://github.com/apache/polaris/pull/1128#issuecomment-2729817856
> Can you point out in the code where "exposes persistence internals and pushes those things up to the call sites"? I'm also open for suggestion how we can separate concern better.
Sure, as mentioned elsewhere, there should eventually be distinct APIs for each concern. Those APIs do not have to and therefore must not deal for example with persistence-internal IDs or dictate how objects are stored but provide the "concern specific" operations.
As that's a more general approach, I really prefer to move this one into draft state and discuss the approach on the dev-ML.
--
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
Re: [PR] Separate Polaris Entities [polaris]
Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on PR #1128:
URL: https://github.com/apache/polaris/pull/1128#issuecomment-2730005067
Isn’t there a thread from 3/6 already?
On Mon, Mar 17, 2025 at 7:52 AM Robert Stupp ***@***.***>
wrote:
> Can you point out in the code where "exposes persistence internals and
> pushes those things up to the call sites"? I'm also open for suggestion how
> we can separate concern better.
>
> Sure, as mentioned elsewhere, there should eventually be distinct APIs for
> each concern. Those APIs do not have to and therefore must not deal for
> example with persistence-internal IDs or dictate how objects are stored but
> provide the "concern specific" operations.
>
> As that's a more general approach, I really prefer to move this one into
> draft state and discuss the approach on the dev-ML.
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/polaris/pull/1128#issuecomment-2729817856>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AFRE3SA3HOD77KDTYF7RGHL2U3OUTAVCNFSM6AAAAABYOAQGR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRZHAYTOOBVGY>
> .
> You are receiving this because your review was requested.Message ID:
> ***@***.***>
> [image: snazy]*snazy* left a comment (apache/polaris#1128)
> <https://github.com/apache/polaris/pull/1128#issuecomment-2729817856>
>
> Can you point out in the code where "exposes persistence internals and
> pushes those things up to the call sites"? I'm also open for suggestion how
> we can separate concern better.
>
> Sure, as mentioned elsewhere, there should eventually be distinct APIs for
> each concern. Those APIs do not have to and therefore must not deal for
> example with persistence-internal IDs or dictate how objects are stored but
> provide the "concern specific" operations.
>
> As that's a more general approach, I really prefer to move this one into
> draft state and discuss the approach on the dev-ML.
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/polaris/pull/1128#issuecomment-2729817856>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AFRE3SA3HOD77KDTYF7RGHL2U3OUTAVCNFSM6AAAAABYOAQGR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRZHAYTOOBVGY>
> .
> You are receiving this because your review was requested.Message ID:
> ***@***.***>
>
--
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
Re: [PR] Separate Polaris Entities [polaris]
Posted by "singhpk234 (via GitHub)" <gi...@apache.org>.
singhpk234 commented on code in PR #1128:
URL: https://github.com/apache/polaris/pull/1128#discussion_r1988138540
##########
extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/jdbc/PostgresCatalogDaoImpl.java:
##########
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.extension.persistence.impl.jdbc;
+
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
+import java.util.List;
+import java.util.Map;
+import org.apache.polaris.core.PolarisCallContext;
+import org.apache.polaris.core.entity.PolarisBaseEntity;
+import org.apache.polaris.core.entity.PolarisEntityCore;
+import org.apache.polaris.core.persistence.dao.CatalogDao;
+import org.apache.polaris.core.persistence.dao.entity.CreateCatalogResult;
+import org.apache.polaris.core.persistence.dao.entity.DropEntityResult;
+import org.apache.polaris.core.persistence.dao.entity.EntityResult;
+import org.apache.polaris.core.persistence.dao.entity.ListEntitiesResult;
+import org.apache.polaris.core.persistence.dao.entity.ResolvedEntityResult;
+
+public class PostgresCatalogDaoImpl implements CatalogDao {
Review Comment:
imho, then this should be outside the eclipselink package ?
extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/jdbc/PostgresCatalogDaoImpl.java
may be extension/persistence ?
- extension
- persistence
- relational
- jdbc
- eclipselink
--
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
Re: [PR] Separate Polaris Entities [polaris]
Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1128:
URL: https://github.com/apache/polaris/pull/1128#discussion_r1988463025
##########
polaris-core/src/main/java/org/apache/polaris/core/persistence/dao/TaskDao.java:
##########
Review Comment:
Nice, it looks good now. One other note is that the package name `transactional` is a little confusing but that can wait until later refactors.
--
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
Re: [PR] Separate Polaris Entities [polaris]
Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on PR #1128:
URL: https://github.com/apache/polaris/pull/1128#issuecomment-2715456701
> While this PR goes into the direction of concern-based APIs, it still exposes persistence internals and pushes those things up to the call sites, which should not be the case.
Can you point out in the code where "exposes persistence internals and pushes those things up to the call sites"? I'm also open for suggestion how we can separate concern better.
--
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
Re: [PR] Separate Polaris Entities [polaris]
Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on code in PR #1128:
URL: https://github.com/apache/polaris/pull/1128#discussion_r1987759902
##########
extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/jdbc/PostgresCatalogDaoImpl.java:
##########
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.extension.persistence.impl.jdbc;
+
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
+import java.util.List;
+import java.util.Map;
+import org.apache.polaris.core.PolarisCallContext;
+import org.apache.polaris.core.entity.PolarisBaseEntity;
+import org.apache.polaris.core.entity.PolarisEntityCore;
+import org.apache.polaris.core.persistence.dao.CatalogDao;
+import org.apache.polaris.core.persistence.dao.entity.CreateCatalogResult;
+import org.apache.polaris.core.persistence.dao.entity.DropEntityResult;
+import org.apache.polaris.core.persistence.dao.entity.EntityResult;
+import org.apache.polaris.core.persistence.dao.entity.ListEntitiesResult;
+import org.apache.polaris.core.persistence.dao.entity.ResolvedEntityResult;
+
+public class PostgresCatalogDaoImpl implements CatalogDao {
Review Comment:
All classes under this package are placeholders for jdbc impl.
--
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
Re: [PR] Separate Polaris Entities [polaris]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #1128:
URL: https://github.com/apache/polaris/pull/1128#issuecomment-2811537367
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
--
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
Re: [PR] Separate Polaris Entities [polaris]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #1128: Separate Polaris Entities
URL: https://github.com/apache/polaris/pull/1128
--
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
Re: [PR] Separate Polaris Entities [polaris]
Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1128:
URL: https://github.com/apache/polaris/pull/1128#discussion_r1988140377
##########
polaris-core/src/main/java/org/apache/polaris/core/persistence/dao/TaskDao.java:
##########
Review Comment:
Instead of Fdb, I think we need multiple impls:
* jdbc
* eclipse-link
* treemap
* "delegating" to the metastoremanager, which is needed temporarily for backwards compatibility
--
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
Re: [PR] Separate Polaris Entities [polaris]
Posted by "sfc-gh-emaynard (via GitHub)" <gi...@apache.org>.
sfc-gh-emaynard commented on code in PR #1128:
URL: https://github.com/apache/polaris/pull/1128#discussion_r1988140050
##########
polaris-core/src/main/java/org/apache/polaris/core/persistence/transactional/FdbCatalogDaoImpl.java:
##########
Review Comment:
Instead of `Fdb`, I think we need multiple impls:
* jdbc
* eclipse-link
* treemap
* "delegating" to the metastoremanager, which is needed temporarily for backwards compatibility
##########
polaris-core/src/main/java/org/apache/polaris/core/persistence/transactional/FdbCatalogDaoImpl.java:
##########
Review Comment:
Instead of `Fdb`, I think we need multiple impls:
* jdbc
* eclipse-link
* treemap
* "delegating" to the metastoremanager, which is needed temporarily for backwards compatibility
--
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
Re: [PR] Separate Polaris Entities [polaris]
Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on code in PR #1128:
URL: https://github.com/apache/polaris/pull/1128#discussion_r1988382483
##########
polaris-core/src/main/java/org/apache/polaris/core/persistence/dao/TaskDao.java:
##########
Review Comment:
Renamed the current DAO implementations to `DelegatingXXXDaoImpl` for backward compatibility. We can add JDBC implementation in a followup PR.
--
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
Re: [PR] Separate Polaris Entities [polaris]
Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on code in PR #1128:
URL: https://github.com/apache/polaris/pull/1128#discussion_r1988382483
##########
polaris-core/src/main/java/org/apache/polaris/core/persistence/dao/TaskDao.java:
##########
Review Comment:
Renamed the current impl to `DelegatingXXXDaoImpl`
--
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