This is an automated email from the ASF dual-hosted git repository.
yuqi4733 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/main by this push:
new a8e9a31a0 [#4294] improvement(catalogs): Improved readability of
trinomial operator usage code (#4297)
a8e9a31a0 is described below
commit a8e9a31a07196c5baccae4601f361369dc3977c0
Author: khmgobe <[email protected]>
AuthorDate: Tue Jul 30 10:46:02 2024 +0900
[#4294] improvement(catalogs): Improved readability of trinomial operator
usage code (#4297)
### What changes were proposed in this pull request?
Change the trinomial operator usage code to make it easier to understand
### Why are the changes needed?
Improved readability
Fix: https://github.com/apache/gravitino/issues/4294
### Does this PR introduce any user-facing change?
No
### How was this patch tested?
Check change code and existing code comparison
---------
Co-authored-by: Justin Mclean <[email protected]>
---
.../catalog/hadoop/SecureHadoopCatalogOperations.java | 5 ++++-
.../gravitino/catalog/lakehouse/paimon/PaimonSchema.java | 13 +++++++++----
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git
a/catalogs/catalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/SecureHadoopCatalogOperations.java
b/catalogs/catalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/SecureHadoopCatalogOperations.java
index 30cc53f32..51b7069bd 100644
---
a/catalogs/catalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/SecureHadoopCatalogOperations.java
+++
b/catalogs/catalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/SecureHadoopCatalogOperations.java
@@ -417,7 +417,10 @@ public class SecureHadoopCatalogOperations
File file = new File(filePath);
if (file.exists()) {
- file.delete();
+ boolean isDeleted = file.delete();
+ if (!isDeleted) {
+ LOG.error("Failed to delete file: {}", filePath);
+ }
}
}
diff --git
a/catalogs/catalog-lakehouse-paimon/src/main/java/org/apache/gravitino/catalog/lakehouse/paimon/PaimonSchema.java
b/catalogs/catalog-lakehouse-paimon/src/main/java/org/apache/gravitino/catalog/lakehouse/paimon/PaimonSchema.java
index 84a3f133c..40061fcfb 100644
---
a/catalogs/catalog-lakehouse-paimon/src/main/java/org/apache/gravitino/catalog/lakehouse/paimon/PaimonSchema.java
+++
b/catalogs/catalog-lakehouse-paimon/src/main/java/org/apache/gravitino/catalog/lakehouse/paimon/PaimonSchema.java
@@ -78,10 +78,15 @@ public class PaimonSchema extends BaseSchema {
protected PaimonSchema internalBuild() {
PaimonSchema paimonSchema = new PaimonSchema();
paimonSchema.name = name;
- paimonSchema.comment =
- comment == null
- ? (properties == null ? null :
properties.get(PaimonSchemaPropertiesMetadata.COMMENT))
- : comment;
+
+ if (comment != null) {
+ paimonSchema.comment = comment;
+ } else if (properties != null) {
+ paimonSchema.comment =
properties.get(PaimonSchemaPropertiesMetadata.COMMENT);
+ } else {
+ paimonSchema.comment = null;
+ }
+
paimonSchema.properties = properties;
paimonSchema.auditInfo = auditInfo;
return paimonSchema;