All Products
Search
Document Center

DataWorks:Hive

Last Updated:Mar 25, 2026

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 ConnectionPropertiesMode values: 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.

ParameterTypeExampleRequiredDescription
regionIdStringcn-shanghaiYesThe region ID of the EMR cluster.
clusterIdStringc-d1a993bbcd298315YesThe EMR cluster instance ID.
databaseStringdb1YesThe name of the database.
versionString2.3.9YesThe Hive version.
authTypeStringExecutorYesThe identity used to access Object Storage Service (OSS). Valid values: Executor (the executor in the development environment), PrimaryAccount (the Alibaba Cloud account, for production), SubAccount (a specified RAM user, for production), RamRole (a specified RAM role, for production).
authIdentityString123123NoThe ID of the RAM user or RAM role. Required if authType is SubAccount or RamRole.
loginModeStringLDAPYesThe Hive login mode. Valid values: Anonymous, LDAP.
usernameStringxxxNoThe username for Hive authentication. Required if loginMode is LDAP.
passwordStringxxxNoThe password for Hive authentication. Required if loginMode is LDAP.
securityProtocolStringauthTypeNoneNoThe security protocol. Valid values: authTypeNone (no authentication), authTypeSsl (SSL), authTypeKerberos (Kerberos).
truststoreFileString1NoThe ID of the truststore file. Required if securityProtocol is authTypeSsl.
truststorePasswordStringapasaraNoThe password of the truststore file. Required if securityProtocol is authTypeSsl.
keystoreFileString2NoThe ID of the keystore file. Required if securityProtocol is authTypeSsl.
keystorePasswordStringapasaraNoThe password of the keystore file. Required if securityProtocol is authTypeSsl.
kerberosFileConfString123123NoThe IDs of the Kerberos configuration files. Required if securityProtocol is authTypeKerberos.
kerberosFileKeytabString123123NoThe ID of the Kerberos keytab file. Required if securityProtocol is authTypeKerberos.
principalStringxxx@comNoThe Kerberos principal. Required if securityProtocol is authTypeKerberos.
hiveConfigJSON Object{"fs.oss.accessKeyId": "xxx"}NoExtended configuration properties passed to the Hive driver.
envTypeStringDevYesThe environment type. Valid values: Dev (development environment), Prod (production environment).

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.

ParameterTypeExampleRequiredDescription
crossAccountOwnerIdString11111YesThe UID of the other Alibaba Cloud account.
crossAccountRoleNameStringxx-roleYesThe name of the RAM role assumed by the other account.
regionIdStringcn-shanghaiYesThe region ID of the EMR cluster.
clusterIdStringc-d1a993bbcd298315YesThe EMR cluster instance ID.
databaseStringdb1YesThe name of the database.
versionString2.3.9YesThe Hive version.
authTypeStringRamRoleYesMust be set to RamRole for cross-account access.
loginModeStringLDAPYesThe Hive login mode. Valid values: Anonymous, LDAP.
usernameStringxxxNoThe username for Hive authentication. Required if loginMode is LDAP.
passwordStringxxxNoThe password for Hive authentication. Required if loginMode is LDAP.
securityProtocolStringauthTypeNoneNoThe security protocol. Valid values: authTypeNone (no authentication), authTypeSsl (SSL), authTypeKerberos (Kerberos).
truststoreFileString1NoThe ID of the truststore file. Required if securityProtocol is authTypeSsl.
truststorePasswordStringapasaraNoThe password of the truststore file. Required if securityProtocol is authTypeSsl.
keystoreFileString2NoThe ID of the keystore file. Required if securityProtocol is authTypeSsl.
keystorePasswordStringapasaraNoThe password of the keystore file. Required if securityProtocol is authTypeSsl.
kerberosFileConfString123123NoThe IDs of the Kerberos configuration files. Required if securityProtocol is authTypeKerberos.
kerberosFileKeytabString123123NoThe ID of the Kerberos keytab file. Required if securityProtocol is authTypeKerberos.
principalStringxxx@comNoThe Kerberos principal. Required if securityProtocol is authTypeKerberos.
hiveConfigJSON Object{"fs.oss.accessKeyId": "xxx"}NoExtended configuration properties passed to the Hive driver.
envTypeStringDevYesThe environment type. Valid values: Dev (development environment), Prod (production environment).

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.

ParameterTypeExampleRequiredDescription
addressJSON Array[{"host":"127.0.0.1","port":"1234"}]YesThe HiveServer2 address. Contains exactly one host-and-port pair.
databaseStringhive_databaseYesThe name of the database.
metaTypeStringHiveMetastoreYesThe metadata storage type. Valid values: HiveMetastore, DLF1.0.
metastoreUrisStringthrift://123:123YesThe Thrift URI of the Hive Metastore, in the format thrift://<host>:<port>.
versionString2.3.9YesThe Hive version.
accessIdStringxxxxxNoThe AccessKey ID. Required if metaType is DLF1.0.
accessKeyStringxxxxxNoThe AccessKey secret. Required if metaType is DLF1.0.
propertiesJSON Object{"useSSL": "false"}NoAdditional JDBC driver properties.
defaultFSStringxxxNoThe default file system URI.
loginModeStringLDAPYesThe Hive login mode. Valid values: Anonymous, LDAP.
usernameStringxxxNoThe username for Hive authentication. Required if loginMode is LDAP.
passwordStringxxxNoThe password for Hive authentication. Required if loginMode is LDAP.
securityProtocolStringauthTypeNoneNoThe security protocol. Valid values: authTypeNone (no authentication), authTypeSsl (SSL), authTypeKerberos (Kerberos).
truststoreFileString1NoThe ID of the truststore file. Required if securityProtocol is authTypeSsl.
truststorePasswordStringapasaraNoThe password of the truststore file. Required if securityProtocol is authTypeSsl.
keystoreFileString2NoThe ID of the keystore file. Required if securityProtocol is authTypeSsl.
keystorePasswordStringapasaraNoThe password of the keystore file. Required if securityProtocol is authTypeSsl.
kerberosFileConfString123123NoThe IDs of the Kerberos configuration files. Required if securityProtocol is authTypeKerberos.
kerberosFileKeytabString123123NoThe ID of the Kerberos keytab file. Required if securityProtocol is authTypeKerberos.
principalStringxxx@comNoThe Kerberos principal. Required if securityProtocol is authTypeKerberos.
hiveConfigJSON Object{"fs.oss.accessKeyId": "xxx"}NoExtended configuration properties passed to the Hive driver.
envTypeStringDevYesThe environment type. Valid values: Dev (development environment), Prod (production environment).

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).

ParameterTypeExampleRequiredDescription
clusterIdentifierStringcdh_clusterYesThe CDH cluster identifier.
databaseStringdb1YesThe name of the database.
defaultFSStringxxxNoThe default file system URI.
loginModeStringLDAPYesThe Hive login mode. Valid values: Anonymous, LDAP.
usernameStringxxxNoThe username for Hive authentication. Required if loginMode is LDAP.
passwordStringxxxNoThe password for Hive authentication. Required if loginMode is LDAP.
securityProtocolStringauthTypeNoneNoThe security protocol. Valid values: authTypeNone (no authentication), authTypeSsl (SSL). Kerberos authentication (authTypeKerberos) is not supported in CDH mode.
truststoreFileString1NoThe ID of the truststore file. Required if securityProtocol is authTypeSsl.
truststorePasswordStringapasaraNoThe password of the truststore file. Required if securityProtocol is authTypeSsl.
keystoreFileString2NoThe ID of the keystore file. Required if securityProtocol is authTypeSsl.
keystorePasswordStringapasaraNoThe password of the keystore file. Required if securityProtocol is authTypeSsl.
kerberosFileConfString123123NoThe IDs of the Kerberos configuration files.
kerberosFileKeytabString123123NoThe ID of the Kerberos keytab file.
principalStringxxx@comNoThe Kerberos principal.
hiveConfigJSON Object{"fs.oss.accessKeyId": "xxx"}NoExtended configuration properties passed to the Hive driver.
envTypeStringDevYesThe environment type. Valid values: Dev (development environment), Prod (production environment).

Example

{
    "clusterIdentifier": "c-xxxxxxxxx",
    "database": "db",
    "ldapEnable": "LDAP",
    "authType": "Executor",
    "securityProtocol": "authTypeNone",
    "envType": "Dev"
}

Limitations

  • CDH mode does not support Kerberos authentication. Only authTypeNone and authTypeSsl are valid values for securityProtocol in CDH mode.

  • The address parameter in connection string mode accepts exactly one host-and-port pair. Multiple hosts are not supported.

  • authIdentity is required only when authType is SubAccount or RamRole in instance mode.