All Products
Search
Document Center

MaxCompute:Lindorm external tables

Last Updated:Mar 27, 2026

This topic describes how to create a Lindorm external table in MaxCompute and map a Lindorm data source.

Introduction

Lindorm is a cloud-native multi-model database designed and optimized for scenarios such as the Internet of Things (IoT), the internet, and the Internet of Vehicles. It supports unified access to and integrated processing of diverse data types, including wide tables, time series, text, objects, streams, and spatial data. Lindorm is compatible with multiple standard interfaces, such as SQL, HBase/Cassandra/S3, TSDB, HDFS, Solr, and Kafka, and is one of the core databases that supports Alibaba's key services.

After establishing a network connection between MaxCompute and Lindorm, you can create an external table to map to a Lindorm table. This lets you perform the following operations:

  • Synchronize data from a Lindorm table to MaxCompute for subsequent ETL processing.

  • Run a federated query by joining with other Lindorm tables.

  • Write data from MaxCompute to a Lindorm table.

Limitations

  • Region availability: This feature is available only in the following regions: China (Beijing), China (Shanghai), China (Zhangjiakou), China (Hangzhou), China (Shenzhen), China (Hong Kong), China (Shanghai) Finance Cloud Zone F, Japan (Tokyo), Singapore, Malaysia (Kuala Lumpur), Indonesia (Jakarta), Germany (Frankfurt), US (Silicon Valley), and US (Virginia).

  • Lindorm external tables do not support the cluster property.

Considerations

When you read data from a source Lindorm table, mismatches in column count are handled as follows: If the source table has fewer columns than defined in the external table DDL, the missing columns are populated with NULL values. Conversely, if the source table has more columns, the extra column data is discarded.

Create a Lindorm external table

Syntax

When you create a Lindorm external table, you must specify HBaseStorageHandler in the DDL statement and provide the configuration details for the Lindorm instance.

Table and column names are case-insensitive. Forcing case conversion is not supported. The syntax is as follows:

-- Enable Hive-compatible mode.
SET odps.sql.hive.compatible = true;
-- Set the HBase version to lindorm.
SET odps.sql.hbase.version=lindorm;
-- Create a Lindorm external table.
CREATE EXTERNAL TABLE if NOT EXISTS <mc_lindorm_external>
(
  <col_name1> <data_type>,
  <col_name2> <data_type>,
  ......
)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' -- The handler for the Lindorm data source.
WITH SERDEPROPERTIES(
  'hbase.columns.mapping'='<:key,col-family:col-name1,col-family:col-name2,...>')
TBLPROPERTIES(
    -- The hbase.table.name and hbase.zookeeper.quorum parameters are required.
    'hbase.table.name'='',
    'hbase.zookeeper.quorum'='',
    -- Configure the hbase.client.username and hbase.client.password parameters.
    'hbase.client.username'='****','hbase.client.password'='****',
    -- The hbase.zookeeper.property.clientPort, mcfed.zookeeper.session.timeout, and hbase.client.retries.number parameters are optional.
    -- The default value of hbase.zookeeper.property.clientPort is 30020.
    ['hbase.zookeeper.property.clientPort'='{30020}',]
    ['mcfed.zookeeper.session.timeout'='{{VALUE}}',]
    ['hbase.client.retries.number'='{{VALUE}}',]
    'networklink'='{{NETWORKLINK_NAME}}'
);

Parameters

  • mc_lindorm_external: Required. The name of the Lindorm external table to create.

  • col_name: Required. The column name of the Lindorm external table.

  • data_type: Required. The data type of the column.

  • WITH SERDEPROPERTIES:

    • 'hbase.columns.mapping'='<:key,col-family:col-name1,col-family:col-name2,...>': Required. The column mapping between the Lindorm external table and the source Lindorm table. For more information, see HBaseIntegration-ColumnMapping.

      • The row key (:key[,:key2,:keyn]) must be specified first.

      • The column format is col-family:col-name1,col-family:col-name2. A single job can contain only one col-family.

  • TBLPROPERTIES:

    • 'hbase.table.name'='<namespace:lindorm_table_name>': Required. The namespace and name of the Lindorm table to map. If you do not specify a namespace, the default namespace is used. You must create this table in the Lindorm console beforehand.

    • 'hbase.zookeeper.quorum'='<VPC ip1|host1:port,VPC ip2|host2:port...>': Required. The ZooKeeper connection string for the Lindorm instance's wide-table engine. This value is available as the Java API access URL in the Lindorm console.

    • hbase.client.username: Required.

      1. Log on to the Lindorm console and select a region in the upper-left corner.

      2. On the Instances page, click the name of the target instance to open its details page.

      3. In the left-side navigation pane, click Database Connections.

      4. On the Wide Table Engine tab, obtain the Default Username.

    • hbase.client.password: Required.

      1. Log on to the Lindorm console and select a region in the upper-left corner.

      2. On the Instances page, click the name of the target instance to open its details page.

      3. In the left-side navigation pane, click Database Connections.

      4. On the Wide Table Engine tab, obtain the Default Initial Password.

    • 'hbase.zookeeper.property.clientPort'='{2181|30020}': Optional. The ZooKeeper port for Lindorm. The default value is 30020.

    • 'mcfed.zookeeper.session.timeout'='<value>': Optional. The ZooKeeper session timeout period, in milliseconds. The recommended value is 30000.

    • 'hbase.client.retries.number'='<value>': Optional. The maximum number of connection retries.

    • 'networklink'='<networklink_name>': Required. The name of the network link that connects to the VPC of the Lindorm instance.

    Note

    ZooKeeper-related configurations include properties starting with mcfed.zookeeper and some properties under the hbase prefix.

Example

  1. You have created a MaxCompute project and installed and configured the MaxCompute client.

  2. You have activated the Lindorm service and created a Lindorm instance.

  3. You have downloaded and configured Lindorm Shell. For more information, see Access the wide-table engine by using Lindorm Shell.

  4. Network connection

    • You have established a network connection between MaxCompute and Lindorm based on a VPC connection solution. For more information about VPC connection solutions, see Network enablement process.

    • This connection only allows MaxCompute to access the specified VPC. To access resources in other VPCs or across regions, follow the instructions in VPC access (direct connection over a leased line) to set up connectivity between the VPC specified in the leased line connection solution and other VPCs.

  5. Use Lindorm Shell to create a Lindorm table and insert data.

    1. Create the lindorm_test table.

      CREATE 'lindorm_test','f';
    2. Insert data into the lindorm_test table.

      put 'lindorm_test', '1122', 'f:col1', 'hello';
      put 'lindorm_test', '1122', 'f:col2', 'hbase';
    3. Query data from the lindorm_test table.

      scan 'lindorm_test';

      The following result is returned:

      image

  6. Create a MaxCompute external table and map it to the Lindorm data source.

    1. Run the following command on the MaxCompute client to create a Lindorm external table named lindorm_test_ext.

      SET odps.sql.hive.compatible = true;
      SET odps.sql.hbase.version=lindorm;
      
      CREATE EXTERNAL TABLE lindorm_test_ext
      (
        row_key  INT,
        col1 STRING,
        col2 STRING
      )
      STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
      WITH SERDEPROPERTIES (
        'hbase.columns.mapping'=':key,f:col1,f:col2')
      TBLPROPERTIES (
        'hbase.table.name'='lindorm_test',
        'hbase.zookeeper.quorum'='ld-2z****-proxy-lindorm.lindorm.rds.aliyuncs.com:30020',
        'hbase.client.username'='<user_name>',
        'hbase.client.password'='***',
        'networklink'='<your network link name>');
    2. Query data from the external table lindorm_test_ext.

      SET odps.sql.hive.compatible = true;
      SET odps.sql.hbase.version=lindorm;
      
      SELECT * FROM lindorm_test_ext;
      
      -- The following result is returned:
      +------------+------------+----------+
      | key        | col1       | col2     |
      +------------+------------+----------+
      | 1122       | hello      | hbase    |  
      +------------+------------+----------+
    3. Insert data into the external table lindorm_test_ext.

      SET odps.sql.hive.compatible = true;
      SET odps.sql.hbase.version = lindorm;
      INSERT OVERWRITE TABLE lindorm_test_ext SELECT '1123', 'lindorm', 'mftestinsert';
    4. Query data from the external table lindorm_test_ext again.

      SET odps.sql.hive.compatible = true;
      SET odps.sql.hbase.version=lindorm;
      
      SELECT * FROM lindorm_test_ext;
      
      -- The following result is returned:
      +------------+------------+-------------+
      | key        | col1       | col2        |
      +------------+------------+-------------+
      | 1122       | hello      | hbase       | 
      | 1123       | lindorm    | mftestinsert|   
      +------------+------------+-------------+
    5. Use the scan statement to query data from the Lindorm table lindorm_test.

      scan 'lindorm_test';

      The following result is returned:

      image