You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "yuzelin (via GitHub)" <gi...@apache.org> on 2023/08/30 08:37:50 UTC

[GitHub] [incubator-paimon] yuzelin commented on a diff in pull request #1915: [core] Add database name and table name in BucketsTable

yuzelin commented on code in PR #1915:
URL: https://github.com/apache/incubator-paimon/pull/1915#discussion_r1309904205


##########
paimon-core/src/main/java/org/apache/paimon/table/system/BucketsTable.java:
##########
@@ -99,6 +117,9 @@ public RowType rowType() {
         fields.add(new DataField(1, "_PARTITION", newBytesType(false)));
         fields.add(new DataField(2, "_BUCKET", new IntType(false)));
         fields.add(new DataField(3, "_FILES", newBytesType(false)));
+        fields.add(
+                new DataField(4, "_DATABASE_NAME", new VarCharType(Integer.MAX_VALUE).nullable()));
+        fields.add(new DataField(5, "_TABLE_NAME", new VarCharType(Integer.MAX_VALUE)));

Review Comment:
   Use `VarCharType(boolean isNullable, int length)`



##########
paimon-core/src/main/java/org/apache/paimon/table/system/BucketsTable.java:
##########
@@ -67,9 +71,23 @@ public class BucketsTable implements DataTable, ReadonlyTable {
     private final FileStoreTable wrapped;
     private final boolean isContinuous;
 
+    @Nullable private final String databaseName;
+    private final String tableName;
+
     public BucketsTable(FileStoreTable wrapped, boolean isContinuous) {
         this.wrapped = wrapped;
         this.isContinuous = isContinuous;
+        this.databaseName = null;
+        this.tableName = wrapped.name();
+    }
+
+    // if need to specify the database of a table, use this method
+    public BucketsTable(
+            FileStoreTable wrapped, boolean isContinuous, String databaseName, String tableName) {
+        this.wrapped = wrapped;
+        this.isContinuous = isContinuous;
+        this.databaseName = databaseName;
+        this.tableName = tableName;

Review Comment:
   this(...)
   tableName is not necessary to be an argument.



-- 
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@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org