Hive
Configure a Hive data source in DataWorks using one of three connection modes: instance mode (for EMR clusters in the same or a different Alibaba Cloud account), connection string mode (for self-managed Hive clusters), or CDH mode (for Cloudera Distribution of Hadoop clusters).
-
Data source type:
hive -
Supported
ConnectionPropertiesModevalues:InstanceMode,UrlMode,CdhMode
Instance mode — current account
Use this mode to connect to a Hive instance on an Alibaba Cloud EMR cluster in your own account.
|
Parameter |
Type |
Example |
Required |
Description |
|
|
String |
|
Yes |
The region ID of the EMR cluster. |
|
|
String |
|
Yes |
The EMR cluster instance ID. |
|
|
String |
|
Yes |
The name of the database. |
|
|
String |
|
Yes |
The Hive version. |
|
|
String |
|
Yes |
The identity used to access Object Storage Service (OSS). Valid values: |
|
|
String |
|
No |
The ID of the RAM user or RAM role. Required if |
|
|
String |
|
Yes |
The Hive login mode. Valid values: |
|
|
String |
|
No |
The username for Hive authentication. Required if |
|
|
String |
|
No |
The password for Hive authentication. Required if |
|
|
String |
|
No |
The security protocol. Valid values: |
|
|
String |
|
No |
The ID of the truststore file. Required if |
|
|
String |
|
No |
The password of the truststore file. Required if |
|
|
String |
|
No |
The ID of the keystore file. Required if |
|
|
String |
|
No |
The password of the keystore file. Required if |
|
|
String |
|
No |
The IDs of the Kerberos configuration files. Required if |
|
|
String |
|
No |
The ID of the Kerberos keytab file. Required if |
|
|
String |
|
No |
The Kerberos principal. Required if |
|
|
JSON Object |
|
No |
Extended configuration properties passed to the Hive driver. |
|
|
String |
|
Yes |
The environment type. Valid values: |
Example
{
"clusterId": "c-xxxxxxxxx",
"regionId": "cn-shanghai",
"database": "db",
"loginMode": "Anonymous",
"version": "2.3.9",
"authType": "Executor",
"securityProtocol": "authTypeNone",
"envType": "Dev"
}
Instance mode — another account
Use this mode to connect to a Hive instance on an EMR cluster owned by a different Alibaba Cloud account. This mode requires cross-account RAM role authorization. authType must be set to RamRole.
|
Parameter |
Type |
Example |
Required |
Description |
|
|
String |
|
Yes |
The UID of the other Alibaba Cloud account. |
|
|
String |
|
Yes |
The name of the RAM role assumed by the other account. |
|
|
String |
|
Yes |
The region ID of the EMR cluster. |
|
|
String |
|
Yes |
The EMR cluster instance ID. |
|
|
String |
|
Yes |
The name of the database. |
|
|
String |
|
Yes |
The Hive version. |
|
|
String |
|
Yes |
Must be set to |
|
|
String |
|
Yes |
The Hive login mode. Valid values: |
|
|
String |
|
No |
The username for Hive authentication. Required if |
|
|
String |
|
No |
The password for Hive authentication. Required if |
|
|
String |
|
No |
The security protocol. Valid values: |
|
|
String |
|
No |
The ID of the truststore file. Required if |
|
|
String |
|
No |
The password of the truststore file. Required if |
|
|
String |
|
No |
The ID of the keystore file. Required if |
|
|
String |
|
No |
The password of the keystore file. Required if |
|
|
String |
|
No |
The IDs of the Kerberos configuration files. Required if |
|
|
String |
|
No |
The ID of the Kerberos keytab file. Required if |
|
|
String |
|
No |
The Kerberos principal. Required if |
|
|
JSON Object |
|
No |
Extended configuration properties passed to the Hive driver. |
|
|
String |
|
Yes |
The environment type. Valid values: |
Example
{
"crossAccountOwnerId": "11111",
"crossAccountRoleName": "xx-role",
"clusterId": "c-xxxxxxxxx",
"regionId": "cn-shanghai",
"database": "db",
"loginMode": "LDAP",
"version": "2.3.9",
"authType": "RamRole",
"securityProtocol": "authTypeNone",
"envType": "Dev"
}
Connection string mode
Use this mode to connect to a self-managed Hive cluster by specifying the HiveServer2 host and port directly.
|
Parameter |
Type |
Example |
Required |
Description |
|
|
JSON Array |
|
Yes |
The HiveServer2 address. Contains exactly one host-and-port pair. |
|
|
String |
|
Yes |
The name of the database. |
|
|
String |
|
Yes |
The metadata storage type. Valid values: |
|
|
String |
|
Yes |
The Thrift URI of the Hive Metastore, in the format |
|
|
String |
|
Yes |
The Hive version. |
|
|
String |
|
No |
The AccessKey ID. Required if |
|
|
String |
|
No |
The AccessKey secret. Required if |
|
|
JSON Object |
|
No |
Additional JDBC driver properties. |
|
|
String |
|
No |
The default file system URI. |
|
|
String |
|
Yes |
The Hive login mode. Valid values: |
|
|
String |
|
No |
The username for Hive authentication. Required if |
|
|
String |
|
No |
The password for Hive authentication. Required if |
|
|
String |
|
No |
The security protocol. Valid values: |
|
|
String |
|
No |
The ID of the truststore file. Required if |
|
|
String |
|
No |
The password of the truststore file. Required if |
|
|
String |
|
No |
The ID of the keystore file. Required if |
|
|
String |
|
No |
The password of the keystore file. Required if |
|
|
String |
|
No |
The IDs of the Kerberos configuration files. Required if |
|
|
String |
|
No |
The ID of the Kerberos keytab file. Required if |
|
|
String |
|
No |
The Kerberos principal. Required if |
|
|
JSON Object |
|
No |
Extended configuration properties passed to the Hive driver. |
|
|
String |
|
Yes |
The environment type. Valid values: |
Example
{
"address": [
{
"host": "127.0.0.1",
"port": 5432
}
],
"database": "db",
"properties": {
"connectTimeout": "2000"
},
"username": "aliyun",
"password": "xxx",
"metastoreUris": "thrift://123:123",
"metaType": "HiveMetastore",
"loginMode": "LDAP",
"securityProtocol": "authTypeNone",
"envType": "Dev"
}
CDH mode
Use this mode to connect to a Hive cluster managed by Cloudera Distribution of Hadoop (CDH).
|
Parameter |
Type |
Example |
Required |
Description |
|
|
String |
|
Yes |
The CDH cluster identifier. |
|
|
String |
|
Yes |
The name of the database. |
|
|
String |
|
No |
The default file system URI. |
|
|
String |
|
Yes |
The Hive login mode. Valid values: |
|
|
String |
|
No |
The username for Hive authentication. Required if |
|
|
String |
|
No |
The password for Hive authentication. Required if |
|
|
String |
|
No |
The security protocol. Valid values: |
|
|
String |
|
No |
The ID of the truststore file. Required if |
|
|
String |
|
No |
The password of the truststore file. Required if |
|
|
String |
|
No |
The ID of the keystore file. Required if |
|
|
String |
|
No |
The password of the keystore file. Required if |
|
|
String |
|
No |
The IDs of the Kerberos configuration files. |
|
|
String |
|
No |
The ID of the Kerberos keytab file. |
|
|
String |
|
No |
The Kerberos principal. |
|
|
JSON Object |
|
No |
Extended configuration properties passed to the Hive driver. |
|
|
String |
|
Yes |
The environment type. Valid values: |
Example
{
"clusterIdentifier": "c-xxxxxxxxx",
"database": "db",
"ldapEnable": "LDAP",
"authType": "Executor",
"securityProtocol": "authTypeNone",
"envType": "Dev"
}
Limitations
-
CDH mode does not support Kerberos authentication. Only
authTypeNoneandauthTypeSslare valid values forsecurityProtocolin CDH mode. -
The
addressparameter in connection string mode accepts exactly one host-and-port pair. Multiple hosts are not supported. -
authIdentityis required only whenauthTypeisSubAccountorRamRolein instance mode.