Skip to content

Commit

Permalink
format object json key
Browse files Browse the repository at this point in the history
  • Loading branch information
jerry-024 committed Dec 23, 2024
1 parent 0b10fe6 commit 09368b3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,12 @@ public String getDatabaseName() {
return database;
}

@JsonIgnoreProperties
public String getObjectName() {
return object;
}

@JsonIgnoreProperties
public String getFullName() {
return UNKNOWN_DATABASE.equals(this.database)
? object
Expand All @@ -136,16 +138,19 @@ public String getTableName() {
return branch;
}

@JsonIgnoreProperties
public String getBranchNameOrDefault() {
String branch = getBranchName();
return branch == null ? BranchManager.DEFAULT_MAIN_BRANCH : branch;
}

@JsonIgnoreProperties
public @Nullable String getSystemTableName() {
splitObjectName();
return systemTable;
}

@JsonIgnoreProperties
public boolean isSystemTable() {
return getSystemTableName() != null;
}
Expand Down Expand Up @@ -181,10 +186,12 @@ private void splitObjectName() {
}
}

@JsonIgnoreProperties
public String getEscapedFullName() {
return getEscapedFullName('`');
}

@JsonIgnoreProperties
public String getEscapedFullName(char escapeChar) {
return String.format(
"%c%s%c.%c%s%c", escapeChar, database, escapeChar, escapeChar, object, escapeChar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.paimon.utils.Preconditions;

import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.annotation.JsonCreator;
import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.annotation.JsonGetter;
import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.annotation.JsonProperty;

Expand Down Expand Up @@ -112,22 +113,27 @@ public String comment() {
return comment;
}

@JsonGetter(FIELD_FIELDS)
public List<DataField> getFields() {
return fields;
}

@JsonGetter(FIELD_PARTITION_KEYS)
public List<String> getPartitionKeys() {
return partitionKeys;
}

@JsonGetter(FIELD_PRIMARY_KEYS)
public List<String> getPrimaryKeys() {
return primaryKeys;
}

@JsonGetter(FIELD_OPTIONS)
public Map<String, String> getOptions() {
return options;
}

@JsonGetter(FIELD_COMMENT)
public String getComment() {
return comment;
}
Expand Down

0 comments on commit 09368b3

Please sign in to comment.