You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-zh@flink.apache.org by xiao cai <fl...@163.com> on 2020/08/17 03:52:22 UTC
Print SQL connector无法正常使用
Hi All:
目前使用flink sql的Print SQL connector,想要将查询的结果打印出来,结果报错:
Caused by: org.apache.flink.table.api.NoMatchingTableFactoryException: Could not find a suitable table factory for 'org.apache.flink.table.factories.TableSinkFactory' in
the classpath.
可以保证:HBase-connector是在lib包下存在的,是否我还需要在lib下添加什么依赖?
下面为执行的sql:
CREATE TABLE dimension (
rowKey STRING,
cf ROW<age INT, area BIGINT>,
tas BIGINT
) WITH (
'connector.type' = 'hbase',
'connector.version' = '1.4.3',
'connector.table-name' = ’test',
'connector.write.buffer-flush.max-rows' = '10',
'connector.zookeeper.quorum' = ‘IP:port',
'connector.zookeeper.znode.parent' = '/hbase',
);
CREATE TABLE print_table (
f0 STRING,
f1 INT,
f2 BIGINT,
f3 BIGINT
) WITH (
'connector' = 'print'
);
insert into print_table
select rowKey, cf.age, cf.area, tas
from dimension
Re: Print SQL connector无法正常使用
Posted by china_tao <ta...@163.com>.
String createHbaseSql = CREATE TABLE dimension (
rowKey STRING,
cf ROW<age INT, area BIGINT>,
tas BIGINT
) WITH (
'connector.type' = 'hbase',
'connector.version' = '1.4.3',
'connector.table-name' = ’test',
'connector.write.buffer-flush.max-rows' = '10',
'connector.zookeeper.quorum' = ‘IP:port',
'connector.zookeeper.znode.parent' = '/hbase',
);
tableEnv.executeSql(createHbaseSql);
Table queryTable = tableEnv.sqlQuery("select * from dimension");
tableEnv.toAppendStream(queryTable, Row.class).print();
你先用这种方式,看看能不能打印出来,证明你hbase没有问题。然后在用print_table。
--
Sent from: http://apache-flink.147419.n8.nabble.com/
Re: Print SQL connector无法正常使用
Posted by Benchao Li <li...@apache.org>.
Hi,
看起来你用的hbase的配置还是老的配置,1.11中已经更新的新的connector配置选项了,
你可以尝试下用新版的connector配置[1]。
[1]
https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/table/connectors/hbase.html
xiao cai <fl...@163.com> 于2020年8月17日周一 上午11:52写道:
> Hi All:
> 目前使用flink sql的Print SQL connector,想要将查询的结果打印出来,结果报错:
> Caused by: org.apache.flink.table.api.NoMatchingTableFactoryException:
> Could not find a suitable table factory for
> 'org.apache.flink.table.factories.TableSinkFactory' in
> the classpath.
>
>
> 可以保证:HBase-connector是在lib包下存在的,是否我还需要在lib下添加什么依赖?
>
>
> 下面为执行的sql:
>
>
> CREATE TABLE dimension (
> rowKey STRING,
> cf ROW<age INT, area BIGINT>,
> tas BIGINT
> ) WITH (
> 'connector.type' = 'hbase',
> 'connector.version' = '1.4.3',
> 'connector.table-name' = ’test',
> 'connector.write.buffer-flush.max-rows' = '10',
> 'connector.zookeeper.quorum' = ‘IP:port',
> 'connector.zookeeper.znode.parent' = '/hbase',
> );
>
>
> CREATE TABLE print_table (
> f0 STRING,
> f1 INT,
> f2 BIGINT,
> f3 BIGINT
> ) WITH (
> 'connector' = 'print'
> );
>
>
> insert into print_table
> select rowKey, cf.age, cf.area, tas
> from dimension
--
Best,
Benchao Li