Updated on 2024-12-19 GMT+08:00

Interconnecting Hive with LakeFormation

  1. Add the following content to the hive-site.xml file in the conf directory in the Hive server installation environment (replace some parameter values as prompted):

    <property>
    <name>hive.metastore.session.client.class</name>
    <value>com.huawei.cloud.dalf.lakecat.client.hiveclient.LakeCatMetaStoreClient</value>
    </property>
    <property>
    <name>lakeformation.project.id</name>
    <value>****</value>
    </property>
    <property>
    <name>lakeformation.instance.id</name>
    <value>LakeFormation instance ID</value>
    </property>
    <!--AK information for LakeFormation IAM authentication. This parameter is optional. Ignore it if you plan to use the custom authentication information obtaining class.-->
    <property>
    <name>lakeformation.authentication.access.key</name>
    <value>AK</value>
    </property>
    <!--SK information for LakeFormation IAM authentication. This parameter is optional. Ignore it if you plan to use the custom authentication information obtaining class.-->
    <property>
    <name>lakeformation.authentication.secret.key</name>
    <value>SK</value>
    </property>
    <!--SecurityToken for accessing LakeFormation IAM authentication information. This parameter is optional. If a permanent AK/SK or a custom authorizer information obtaining class is used, skip this parameter.-->
    <property>
    <name>lakeformation.authentication.security.token</name>
    <value>SecurityToken information</value>
    </property>
    <property>
    <name>fs.obs.impl</name>
    <value>org.apache.hadoop.fs.obs.OBSFileSystem</value>
    </property>
    <property>
    <name>fs.AbstractFileSystem.obs.impl</name>
    <value>org.apache.hadoop.fs.obs.OBS</value>
    </property>
    <property>
    <name>fs.obs.endpoint</name>
    <value>Endpoint information</value>
    </property>
    <property>
    <name>fs.obs.credentials.provider</name>
    <value>com.huawei.cloud.dalf.lakecat.client.obs.LakeFormationObsCredentialProvider</value>
    </property>
    <property>
    <name>fs.obs.impl.disable.cache</name>
    <value>true</value>
    </property>
    <property>
    <name>dfs.namenode.acls.enabled</name>
    <value>false</value>
    </property>
    <!--Name of the LakeFormation catalog to be connected. This parameter is optional. If this parameter is not set, the Hive catalog is connected instead. The value of this parameter is for reference only.-->
    <property>
    <name>lakecat.catalogname.default</name>
    <value>hive</value>
    </property>

  2. Restart the Hive service.
  3. Log in to the Hive client and run the following command:

    show tables;