Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Support information schema for external catalog #27359

Merged
merged 26 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into dla-info-schema
  • Loading branch information
letian-jiang authored Aug 1, 2023
commit b4f9d3fea46a7eedd919c8a57a0ad9e449888a22
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public HiveConnector(ConnectorContext context) {
this.cloudConfiguration = CloudConfigurationFactory.buildCloudConfigurationForStorage(properties);
HdfsEnvironment hdfsEnvironment = new HdfsEnvironment(cloudConfiguration);
this.internalMgr = new HiveConnectorInternalMgr(catalogName, properties, hdfsEnvironment);
this.metadataFactory = createMetadataFactory();
this.metadataFactory = createMetadataFactory(hdfsEnvironment);
this.infoSchemaDb = new InfoSchemaDb(catalogName);
validate();
onCreate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public HudiConnector(ConnectorContext context) {
HdfsEnvironment hdfsEnvironment = new HdfsEnvironment(cloudConfiguration);
this.catalogName = context.getCatalogName();
this.internalMgr = new HudiConnectorInternalMgr(catalogName, properties, hdfsEnvironment);
this.metadataFactory = createMetadataFactory();
this.infoSchemaDb = new InfoSchemaDb(catalogName);
this.metadataFactory = createMetadataFactory(hdfsEnvironment);
validate();
onCreate();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,10 @@ public TGetTablesResult getTableNames(TGetTablesParams params) throws TException
continue;
}

if (tbl != null && !PrivilegeActions.checkAnyActionOnTableLikeObject(currentUser,
null, params.db, tbl)) {
try {
PrivilegeChecker.checkAnyActionOnTableLikeObject(currentUser,
null, params.db, tbl);
} catch (AccessDeniedException e) {
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import com.starrocks.privilege.AccessDeniedException;
import com.starrocks.server.GlobalStateMgr;
import com.starrocks.server.MetadataMgr;
import com.starrocks.sql.analyzer.PrivilegeChecker;
import com.starrocks.sql.analyzer.SemanticException;
import com.starrocks.sql.ast.UserIdentity;
import com.starrocks.thrift.TAuthInfo;
Expand Down Expand Up @@ -330,7 +331,9 @@ public static TGetTablesInfoResponse generateTablesInfoResponse(TGetTablesInfoRe
continue;
}

if (!PrivilegeActions.checkAnyActionOnTableLikeObject(result.currentUser, null, dbName, table)) {
try {
PrivilegeChecker.checkAnyActionOnTableLikeObject(result.currentUser, null, dbName, table);
} catch (AccessDeniedException e) {
continue;
}

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.