KurtYoung commented on a change in pull request #8844:
[FLINK-12951][table-planner] Add logic to bridge DDL to table source(…
URL: https://github.com/apache/flink/pull/8844#discussion_r300314732
##########
File path:
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/TableEnvironmentImpl.java
##########
@@ -337,17 +372,35 @@ public TableConfig getConfig() {
return tableConfig;
}
- protected void registerTableInternal(String name, CatalogBaseTable
table) {
+ private String[] getDefaultTablePath(String name) {
+ return new String[] { defaultCatalogName, defaultDatabaseName,
name };
+ }
+
+ /**
+ * Registers a {@link CatalogBaseTable} under a given object path. The
{@code path} could be
+ * 3 formats:
+ * <ol>
+ * <li>`catalog.db.table`: A full table path including the catalog
name,
+ * the database name and table name.</li>
+ * <li>`db.table`: database name following table name, with the
current catalog name.</li>
+ * <li>`table`: Only the table name, with the current catalog name
and database name.</li>
+ * </ol>
+ * The registered tables then can be referenced in Sql queries.
+ *
+ * @param path The path under which the table will be
registered
+ * @param catalogTable The table to register
+ * @param ignoreIfExists If true, do nothing if there is already same
table name under
+ * the {@code path}. If false, a
TableAlreadyExistException throws.
+ */
+ private void registerTableInternal(String[] path,
+ CatalogBaseTable catalogTable,
+ boolean ignoreIfExists) {
+ String[] fullName =
catalogManager.paddedTableName(Arrays.asList(path));
Review comment:
Looks like you are trying to pad table names in different places, one is
here, another one is `getDefaultTablePath`, could we make it unified? It seems
unnecessary to call `getDefaultTablePath` every time before calling this
function.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services