MOBIN-F opened a new pull request, #36:
URL: https://github.com/apache/flink-connector-hbase/pull/36

   Specifies whether to use an HBase table that supports dynamic columns.
   
   Refer to the dynamic.table parameter in this document: 
[https://www.alibabacloud.com/help/en/flink/developer-reference/apsaradb-for-hbase-connector#section-ltp-3fy-9qv](https://www.alibabacloud.com/help/en/flink/developer-reference/apsaradb-for-hbase-connector#section-ltp-3fy-9qv)
   
   Sample code for a result table that supports dynamic columns
   ```
   CREATE TEMPORARY TABLE datagen_source (
     id INT,
     f1hour STRING,
     f1deal BIGINT,
     f2day STRING,
     f2deal BIGINT
   ) WITH (
     'connector'='datagen'
   );
   
   CREATE TEMPORARY TABLE hbase_sink (
     rowkey INT,
     f1 ROW<`hour` STRING, deal BIGINT>,
     f2 ROW<`day` STRING, deal BIGINT>
   ) WITH (
     'connector'='hbase-2.2',
     'table-name'='<yourTableName>',
     'zookeeper.quorum'='<yourZookeeperQuorum>',
     'dynamic.table'='true'
   );
   
   INSERT INTO hbase_sink
   SELECT id, ROW(f1hour, f1deal), ROW(f2day, f2deal) FROM datagen_source;
   ```
   
   If dynamic.table is set to true, HBase table that supports dynamic columns 
is used.
   Two fields must be declared in the rows that correspond to each column 
family. The value of the first field indicates the dynamic column, and the 
value of the second field indicates the value of the dynamic column.
   
   For example, the datagen_source table contains a row of data The row of data 
indicates that the ID of the commodity is 1, the transaction amount of the 
commodity between 10:00 and 11:00 is 100, and the transaction amount of the 
commodity on July 26, 2020 is 10000. In this case, a row whose rowkey is 1 is 
inserted into the ApsaraDB for HBase table. f1:10 is 100, and f2:2020-7-26 is 
10000.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to