-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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] Unified catalog support kudu #45590
[Feature] Unified catalog support kudu #45590
Conversation
Signed-off-by: predator4ann <yunlong.sun@hotmail.com>
} | ||
return properties; | ||
} | ||
|
||
@Override | ||
public List<String> getPartitionColumnNames() { | ||
return partColNames; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The most risky bug in this code is:
The KuduTable
constructor does not initialize the properties
, masterAddresses
, catalogName
, databaseName
, tableName
, and partColNames
fields which could lead to NullPointerException when accessing these fields.
You can modify the code like this:
public KuduTable() {
super(TableType.KUDU);
this.properties = new HashMap<>();
this.masterAddresses = "";
this.catalogName = "";
this.databaseName = "";
this.tableName = "";
this.partColNames = new ArrayList<>();
}
HiveMetaClient metaClient = HiveMetaClient.createHiveMetaClient(this.hdfsEnvironment, properties); | ||
hiveMetastore = Optional.of(new HiveMetastore(metaClient, catalogName, MetastoreType.HMS)); | ||
hiveMetastore = Optional.of(new HiveMetastore(metaClient, catalogName, metastoreType)); | ||
// TODO caching hiveMetastore support | ||
} | ||
return new KuduMetadata(catalogName, hdfsEnvironment, kuduMaster, schemaEmulationEnabled, schemaEmulationPrefix, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The most risky bug in this code is:
A security issue due to changing visibility of configuration keys from private
to public
.
You can modify the code like this:
@@ -38,12 +38,14 @@
public class KuduConnector implements Connector {
private static final String HIVE = "hive";
+ private static final String GLUE = "glue";
private static final String KUDU = "kudu";
- private static final Set<String> SUPPORTED_METASTORE_TYPE = Sets.newHashSet(HIVE, KUDU);
- private static final String KUDU_MASTER = "kudu.master";
- private static final String KUDU_CATALOG_TYPE = "kudu.catalog.type";
- private static final String KUDU_SCHEMA_EMULATION_ENABLED = "kudu.schema-emulation.enabled";
- private static final String KUDU_SCHEMA_EMULATION_PREFIX = "kudu.schema-emulation.prefix";
+ private static final Set<String> SUPPORTED_METASTORE_TYPE = Sets.newHashSet(HIVE, GLUE, KUDU);
+ private static final String KUDU_MASTER = "kudu.master";
+ private static final String KUDU_CATALOG_TYPE = "kudu.catalog.type";
+ private static final String KUDU_SCHEMA_EMULATION_ENABLED = "kudu.schema-emulation.enabled";
+ private static final String KUDU_SCHEMA_EMULATION_PREFIX = "kudu.schema-emulation.prefix";
+ private static final String DEFAULT_KUDU_MASTER = "localhost:7051";
private final String catalogName;
private final String kuduMaster;
private final String catalogType;
Quality Gate passedIssues Measures |
[FE Incremental Coverage Report]✅ pass : 13 / 13 (100.00%) file detail
|
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
@mergify backport branch-3.2 |
✅ Backports have been created
|
Signed-off-by: predator4ann <yunlong.sun@hotmail.com> (cherry picked from commit f9cd67d) # Conflicts: # docs/en/data_source/catalog/kudu_catalog.md # docs/zh/data_source/catalog/kudu_catalog.md # fe/fe-core/src/main/java/com/starrocks/catalog/KuduTable.java # fe/fe-core/src/main/java/com/starrocks/connector/kudu/KuduConnector.java # fe/fe-core/src/main/java/com/starrocks/connector/unified/UnifiedConnector.java
@mergify backport branch-3.3 |
✅ Backports have been created
|
Signed-off-by: predator4ann <yunlong.sun@hotmail.com> (cherry picked from commit f9cd67d)
i'm using unified catalog with glue, and there is no kudu support there and i'm getting an error now trying to access unified catalog Null hive.metastore.uris, please check your property's key and value of catalog or resource. |
Apologies for any confusion, but there's no need to check |
Make unified catalog support kudu data sources.
example:
Fixes #45591
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: