不正确姿势在SqlLab中会出现如下问题:
argument of type 'NoneType' is not iterable
正确姿势是:
presto://hive@localhost:port/<presto_catalog_name>/<hive_db_name>
前边都好理解,最主要是后边两个参数,presto_catalog_name 和 hive_db_name
hive_db_name
是 hive 中数据库的名字,这个好说,不填默认是 default
presto_catalog_name
catalog 这个名字熟悉吗?没错,还记得我们在配置 presto 时在其安装目录的 /etc 下,有新建一个catalog 文件夹吗,就是他,我们在里边放了连接器(比如:Hive连接器)的配置文件,以 .properties结尾的,比如我的 Hive 连接器配置文件名为:hive.properties, 所以,我这里的presto_catalog_name 就是 hive ,我连接 default 数据库的完整表达为:
presto://hive@192.168.0.152:8080/hive/default
参考:
presto Hive 连接器
argument of type ‘NoneType’ is not iterable