我有一个数据库 db1 包含许多表
例如,我想删除所有带有前缀 v1_ 的表,例如
DROP TABLE IF EXISTS v1_*;
Run Code Online (Sandbox Code Playgroud)
你有什么主意吗?
我偶然注意到scala可以推断某个方法参数的类型.但我不明白确切的规则.有人可以解释为什么test1方法工作以及为什么test2方法不起作用
object Test {
def test1[A]: A => A = a => a
def test2[A]: A = a
}
Run Code Online (Sandbox Code Playgroud)
我无法找到问题的好标题,因为我不明白这两行中发生了什么.你有什么主意吗?
我有一个这样的RDD:
+----------+--------+
|firstName |lastName|
+----------+--------+
| john| smith|
| anna| tourde|
+----------+--------+
Run Code Online (Sandbox Code Playgroud)
我想创建一个新列,就像我们可以用 zipWithIndex 做的那样,但初始值为 8。
+----------+--------+-----+
|firstName |lastName|index|
+----------+--------+-----+
| john| smith| 8|
| anna| tourde| 9|
+----------+--------+-----+
Run Code Online (Sandbox Code Playgroud)
你有什么主意吗?谢谢
我创建一个actor A.当我向A发送消息时,该receive方法尝试创建一个actor B.当我运行一段代码调用:
context.system.actorOf(Props[B], "B")
Run Code Online (Sandbox Code Playgroud)
我得到一个例外:
InvalidActorNameException: actor name [B] is not unique!
Run Code Online (Sandbox Code Playgroud)
你知道为什么会这样吗?
我有一个像这样的数据框:
+--+--------+--------+----+-------------+------------------------------+
|id|name |lastname|age |timestamp |creditcards |
+--+--------+--------+----+-------------+------------------------------+
|1 |michel |blanc |35 |1496756626921|[[hr6,3569823], [ee3,1547869]]|
|2 |peter |barns |25 |1496756626551|[[ye8,4569872], [qe5,3485762]]|
+--+--------+--------+----+-------------+------------------------------+
Run Code Online (Sandbox Code Playgroud)
我的 df 的架构如下所示:
root
|-- id: string (nullable = true)
|-- name: string (nullable = true)
|-- lastname: string (nullable = true)
|-- age: string (nullable = true)
|-- timestamp: string (nullable = true)
|-- creditcards: array (nullable = true)
| |-- element: struct (containsNull = true)
| | |-- id: string (nullable = true)
| | |-- number: …Run Code Online (Sandbox Code Playgroud)