安装Impala Driver
Code
library(implyr)
library(odbc)
impala <- src_impala(
drv = odbc(),
driver = 'Cloudera ODBC Driver for Impala',
host = '',
port = YOUR PORT,
database = '',
uid = '',
pwd = '',
authmech = 3,
usessl = 1,
encoding = 'gbk'
)
# df <- dbGetQuery(impala, 'select * from test.table')
其中authmech, usessl
只有在Impala使用SSL加密通信时需要使用,encoding='gbk'
设置是为了正确地取出中文字符。