我是靠谱客的博主 痴情薯片,这篇文章主要介绍spark 编写规范及技巧,现在分享给大家,希望可以做个参考。

1.为了凸显规范及逼格,使用入口类。

/**
  * @Author: Houzhq
  * @Date: 2019/6/11 15:37
  * @Version 1.0
  * @Note
  */
object EntranceA {
  def main(args:Array[String]): Unit ={
    args.toList match {
      case task :: a => task match {
//        case "temprise" => TempRise(a.toArray)
//        case "volt_temp_diff" => VTdiff(a.toArray)
//        case "nocurrent" => NoCurrent(a.toArray)
//        case "batteryact" => BatteryActive(a.toArray)
//        case "historydistance" => HistoryDistance(a.toArray)
//        case "absolutehistorydistance" => HistoryDistance(a.toArray)
//        case "tempchange" => TempChange(a.toArray)
//        case "tempchange2" => TempChange2(a.toArray)
//        case "coolcharge" => CoolCharge(a.toArray)
//        case "tempdraw" => TempDrawData(a.toArray)
        case "geo" => ChargeGeoInfo(a.toArray)
        case "daily" => DailyStatA(a.toArray)
        case "tempchange3" => TempChange3(a.toArray)
        case "temprise2" => TempRise2(a.toArray)
        case _ => print("Invalid task")
      }
      case Nil => print("no args!")
    }
  }

}

 

最后

以上就是痴情薯片最近收集整理的关于spark 编写规范及技巧的全部内容,更多相关spark内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(113)

评论列表共有 0 条评论

立即
投稿
返回
顶部