Copilot commented on code in PR #9160:
URL: https://github.com/apache/gravitino/pull/9160#discussion_r2535482532
##########
api/src/main/java/org/apache/gravitino/Catalog.java:
##########
@@ -132,6 +132,19 @@ enum CloudName {
/** The property indicates the catalog is in use. */
String PROPERTY_IN_USE = "in-use";
+ /**
+ * The property name for the catalog location. This property indicates the
physical location of
+ * the catalog's data, such as a file path or a URI.
+ *
+ * <p>The location property is optional, it can be specified when creating
the catalog.
+ *
+ * <p>It depends on the catalog implementation to decide whether to leverage
this property.
+ * Besides. It also depends on the catalog implementation to decide whether
to allow altering this
Review Comment:
Punctuation error: "Besides." should be "Besides," (use comma instead of
period).
```suggestion
* Besides, it also depends on the catalog implementation to decide
whether to allow altering this
```
##########
core/src/main/java/org/apache/gravitino/catalog/TableOperationDispatcher.java:
##########
@@ -554,9 +538,9 @@ private EntityCombinedTable
internalLoadTable(NameIdentifier ident) {
catalogIdentifier,
HasPropertyMetadata::tablePropertiesMetadata,
table.properties()))
- // Some tables don't have properties or are not created by Gravitino,
- // we can't use stringIdentifier to judge whether schema is ever
imported or not.
- // We need to check whether the entity exists.
+ // For some catalogs like PG, the identifier information is not
stored in the table's
+ // metadata, we need to check if this table is existed in the store,
if so we don't
Review Comment:
Grammar error: "is existed" should be "exists".
```suggestion
// metadata, we need to check if this table exists in the store,
if so we don't
```
##########
core/src/main/java/org/apache/gravitino/catalog/TableOperationDispatcher.java:
##########
@@ -530,6 +502,18 @@ private EntityCombinedTable
internalLoadTable(NameIdentifier ident) {
c -> c.doWithTableOps(t -> t.loadTable(ident)),
NoSuchTableException.class);
+ boolean isManagedTable = isManagedEntity(catalogIdentifier,
Capability.Scope.TABLE);
+ if (isManagedTable) {
+ return EntityCombinedTable.of(table)
+ .withHiddenProperties(
+ getHiddenPropertyNames(
+ catalogIdentifier,
+ HasPropertyMetadata::tablePropertiesMetadata,
+ table.properties()))
+ // The metadata of managed table is store by Gravitino, so it is
always imported.
Review Comment:
Grammar error: "is store by" should be "is stored by".
```suggestion
// The metadata of managed table is stored by Gravitino, so it is
always imported.
```
##########
catalogs/catalog-lakehouse-generic/src/main/java/org/apache/gravitino/catalog/lakehouse/generic/LakehouseTableDelegator.java:
##########
@@ -0,0 +1,60 @@
+/*
+ * 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.gravitino.catalog.lakehouse.generic;
+
+import java.util.List;
+import org.apache.gravitino.EntityStore;
+import org.apache.gravitino.catalog.ManagedSchemaOperations;
+import org.apache.gravitino.catalog.ManagedTableOperations;
+import org.apache.gravitino.connector.PropertyEntry;
+import org.apache.gravitino.storage.IdGenerator;
+
+/**
+ * A delegator interface for different lakehouse table formats to provide
their specific table
+ * operations and property definitions.
+ */
+public interface LakehouseTableDelegator {
+
+ /**
+ * Returns the table format name handled by this delegator.
+ *
+ * @return the table format name
+ */
+ String tableFormat();
+
+ /**
+ * Returns the list of property entries specific to the table format.
+ *
+ * @return the list of property entries
+ */
+ List<PropertyEntry<?>> tablePropertyEntries();
+
+ /**
+ * Create the managed table operations for the specific table format. This
method should be return
Review Comment:
Grammar error: "should be return" should be "should return".
```suggestion
* Create the managed table operations for the specific table format. This
method should return
```
##########
api/src/main/java/org/apache/gravitino/Catalog.java:
##########
@@ -132,6 +132,19 @@ enum CloudName {
/** The property indicates the catalog is in use. */
String PROPERTY_IN_USE = "in-use";
+ /**
+ * The property name for the catalog location. This property indicates the
physical location of
+ * the catalog's data, such as a file path or a URI.
+ *
+ * <p>The location property is optional, it can be specified when creating
the catalog.
+ *
+ * <p>It depends on the catalog implementation to decide whether to leverage
this property.
+ * Besides. It also depends on the catalog implementation to decide whether
to allow altering this
+ * property after catalog creation. Besides, the behavior of altering this
property (moving the
+ * catalog data) is also catalog specific.
Review Comment:
The word "Besides" appears twice in consecutive sentences (line 142 and
143), which is redundant. Consider revising to: "It depends on the catalog
implementation to decide whether to leverage this property. It also depends on
the catalog implementation to decide whether to allow altering this property
after catalog creation. The behavior of altering this property (moving the
catalog data) is also catalog specific."
```suggestion
* It also depends on the catalog implementation to decide whether to
allow altering this property after catalog creation.
* The behavior of altering this property (moving the catalog data) is
also catalog specific.
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]