我正在尝试在scala中编写一个spark代码来连接到impala表并执行简单的select查询。但得到错误"未找到:值getRowFromResultSet"在下面的代码中。关于如何打印结果集的示例将是一个很大的帮助。
val JDBCDriver = "com.cloudera.impala.jdbc41.Driver"
val ConnectionURL = "jdbc:impala://url.server.net:21050/default;auth=noSasl"
Class.forName(JDBCDriver).newInstance
val con = DriverManager.getConnection(ConnectionURL)
val stmt = con.createStatement()`enter code here`
val rs = stmt.executeQuery(query)
val resultSetList = Iterator.continually((rs.next(), rs)).takeWhile(_._1).map(r => {
getRowFromResultSet(r._2)// (ResultSet) => (spark.sql.Row)
}).toList
sc.parallelize(resultSetList)