@Internal
public class HBaseTableSource
extends org.apache.flink.connector.hbase.source.AbstractHBaseTableSource
The table name and required HBase configuration is passed during HBaseTableSource
construction. Use AbstractHBaseTableSource.addColumn(String, String, Class) to specify the family, qualifier, and
type of columns to scan.
The TableSource returns Row with nested Rows for each column family.
The HBaseTableSource is used as shown in the example below.
HBaseTableSource hSrc = new HBaseTableSource(conf, "hTable");
hSrc.setRowKey("rowkey", String.class);
hSrc.addColumn("fam1", "col1", byte[].class);
hSrc.addColumn("fam1", "col2", Integer.class);
hSrc.addColumn("fam2", "col1", String.class);
tableEnv.registerTableSourceInternal("hTable", hSrc);
Table res = tableEnv.sqlQuery(
"SELECT t.fam2.col1, SUM(t.fam1.col2) FROM hTable AS t " +
"WHERE t.rowkey LIKE 'flink%' GROUP BY t.fam2.col1");
| Constructor and Description |
|---|
HBaseTableSource(org.apache.hadoop.conf.Configuration conf,
String tableName)
The HBase configuration and the name of the table to read.
|
HBaseTableSource(org.apache.hadoop.conf.Configuration conf,
String tableName,
org.apache.flink.connector.hbase.util.HBaseTableSchema hbaseSchema,
int[] projectFields) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.flink.api.common.io.InputFormat<org.apache.flink.types.Row,?> |
getInputFormat(org.apache.flink.connector.hbase.util.HBaseTableSchema projectedSchema) |
HBaseTableSource |
projectFields(int[] fields) |
addColumn, explainSource, getAsyncLookupFunction, getDataSet, getDataStream, getHBaseTableSchema, getLookupFunction, getReturnType, getTableSchema, isAsyncEnabled, isBounded, setCharset, setRowKeypublic HBaseTableSource(org.apache.hadoop.conf.Configuration conf,
String tableName)
conf - hbase configurationtableName - the tableNamepublic HBaseTableSource(org.apache.hadoop.conf.Configuration conf,
String tableName,
org.apache.flink.connector.hbase.util.HBaseTableSchema hbaseSchema,
int[] projectFields)
public HBaseTableSource projectFields(int[] fields)
public org.apache.flink.api.common.io.InputFormat<org.apache.flink.types.Row,?> getInputFormat(org.apache.flink.connector.hbase.util.HBaseTableSchema projectedSchema)
getInputFormat in class org.apache.flink.connector.hbase.source.AbstractHBaseTableSourceCopyright © 2014–2021 The Apache Software Foundation. All rights reserved.