小编Mas*_*LuV的帖子

如何在 Apache Spark 中反转排列 DataFrame

如何使用 Scala 反转此 DataFrame。我看到了sort函数,但必须是特定的列,我只想反转它们

+---+--------+-----+
|id |    name|note |
+---+--------+-----+
|1  | james  |any  |
|3  | marry  |some |
|2  | john   |some |
|5  | tom    |any  |
+---+--------+-----+
Run Code Online (Sandbox Code Playgroud)

到:

+---+--------+-----+
|id |    name|note |
+---+--------+-----+
|5  | tom    |any  |
|2  | john   |some |
|3  | marry  |some |
|1  | james  |any  |
+---+--------+-----+
Run Code Online (Sandbox Code Playgroud)

scala apache-spark apache-spark-sql

3
推荐指数
1
解决办法
1128
查看次数

[React-Native-Firebase]如何移除 onMessage 存在事件?

我声明了一个 onMessage 函数来做某事。但是当我导航到另一个屏幕并想要删除 ComponentWillUnmount() 中的 FCM.onMessage() 时。我怎样才能删除它?

const rnfirebase = RNFirebase.initializeApp()

export const FCM = rnfirebase.messaging()

ComponentDidMount(){
    FCM.onMessage((notif)=>{

        //Do something

    })

}
ComponentWillUnmount(){
    //I want to remove here

}
Run Code Online (Sandbox Code Playgroud)

react-native react-native-firebase

2
推荐指数
1
解决办法
1535
查看次数