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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to