wyb commented on a change in pull request #3819:
URL: https://github.com/apache/incubator-doris/pull/3819#discussion_r439424765
##########
File path: fe/src/main/java/org/apache/doris/analysis/FromClause.java
##########
@@ -72,6 +78,39 @@ public int compare(TableRef tableref1, TableRef tableref2) {
});
}
+ private void checkFromHiveTable(Analyzer analyzer) throws
AnalysisException {
+ for (TableRef tblRef : tableRefs_) {
+ if (!(tblRef instanceof BaseTableRef)) {
+ continue;
+ }
+
+ TableName tableName = tblRef.getName();
+ String dbName = tableName.getDb();
+ if (Strings.isNullOrEmpty(dbName)) {
+ dbName = analyzer.getDefaultDb();
+ } else {
+ dbName =
ClusterNamespace.getFullName(analyzer.getClusterName(),
tblRef.getName().getDb());
+ }
+ if (Strings.isNullOrEmpty(dbName)) {
+ ErrorReport.reportAnalysisException(ErrorCode.ERR_NO_DB_ERROR);
+ }
+
+ Database db = analyzer.getCatalog().getDb(dbName);
+ if (db == null) {
+
ErrorReport.reportAnalysisException(ErrorCode.ERR_BAD_DB_ERROR, dbName);
+ }
+
+ String tblName = tableName.getTbl();
+ Table table = db.getTable(tblName);
Review comment:
Lock is acquired in StmtExecutor.analyze 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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]