You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/12/27 15:09:10 UTC

[GitHub] [doris] morningman commented on a diff in pull request #15201: [feature](multi catalog nereids)Add file scan node to nereids.

morningman commented on code in PR #15201:
URL: https://github.com/apache/doris/pull/15201#discussion_r1057730020


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java:
##########
@@ -491,6 +495,29 @@ public PlanFragment visitPhysicalOlapScan(PhysicalOlapScan olapScan, PlanTransla
         return planFragment;
     }
 
+    @Override
+    public PlanFragment visitPhysicalFileScan(PhysicalFileScan fileScan, PlanTranslatorContext context) {
+        // Create OlapScanNode

Review Comment:
   ExternalFileScanNode



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindRelation.java:
##########
@@ -63,12 +68,37 @@ public Rule build() {
                     // Use database name from table name parts.
                     return bindWithDbNameFromNamePart(ctx.cascadesContext, ctx.root);
                 }
+                case 3: { // catalog.db.table
+                    // Use catalog and database name from name parts.
+                    return bindWithCatalogNameFromNamePart(ctx.cascadesContext, ctx.root);
+                }
                 default:
                     throw new IllegalStateException("Table name [" + ctx.root.getTableName() + "] is invalid.");
             }
         }).toRule(RuleType.BINDING_RELATION);
     }
 
+    private TableIf getTable(String catalogName, String dbName, String tableName, Env env) {
+        CatalogIf catalog = env.getCatalogMgr().getCatalog(catalogName);
+        if (catalog == null) {
+            throw new RuntimeException(String.format("Catalog %s does not exist.", catalogName));
+        }
+        DatabaseIf<TableIf> db = null;
+        try {
+            db = (DatabaseIf<TableIf>) catalog.getDb(dbName)
+                    .orElseThrow(() -> new RuntimeException("Database [" + dbName + "] does not exist."));
+        } catch (Throwable e) {
+            throw new RuntimeException(e);
+        }
+        db.readLock();

Review Comment:
   No need to add db lock



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org