我有以下数据帧
val transactions_with_counts = sqlContext.sql(
"""SELECT user_id AS user_id, category_id AS category_id,
COUNT(category_id) FROM transactions GROUP BY user_id, category_id""")
Run Code Online (Sandbox Code Playgroud)
我正在尝试将行转换为Rating对象,但由于x(0)返回一个数组,因此失败
val ratings = transactions_with_counts
.map(x => Rating(x(0).toInt, x(1).toInt, x(2).toInt))
Run Code Online (Sandbox Code Playgroud)
错误:值toInt不是Any的成员
我有一个 Firehose 将数据存储在 s3 中的默认目录结构中:“YY/MM/DD/HH”和 athena 中的一个表,这些列定义为分区:
年:字符串,月:字符串,日:字符串,小时:字符串
跑完后
msck repair table clicks
Run Code Online (Sandbox Code Playgroud)
我只收到:
Partitions not in metastore: clicks:2017/08/26/10
Run Code Online (Sandbox Code Playgroud)
我可以手动添加这些分区并且一切正常,但是我想知道为什么 msck repair 不会自动添加这些分区并更新 Metastore?
我在我的项目中包含了cqerl Elixir的Erlang驱动程序根据文档,连接的Erlang语法是:
{ok, Client} = cqerl:new_client({}).
Run Code Online (Sandbox Code Playgroud)
我只是不知道如何将上述内容翻译成Elixir语法.
我有以下递归函数
trait SequenceGenerator[T] {
def program(l: List[T])(implicit rule: ProductionRule[T]): List[T] = {
l.flatMap(rule.generate)
}
def sequenceNumber(seed: List[T], number: Int)(implicit rule: ProductionRule[T]): List[T] = {
number match {
case 1 => program(seed)
case a => program(sequenceNumber(seed, a - 1))
}
}
}
Run Code Online (Sandbox Code Playgroud)
我想不出一种使sequenceNumber尾递归的方法。