if语句在shell脚本中不起作用

时间:2017-03-31 09:16:57

标签: shell if-statement

以下是我的脚本,val1值为 3 val2值为 0 ,但默认情况下条件会检查{{ 1}}陈述。不会if条件。任何人都可以帮助显示我错过的地方或在这里做错了吗?

else

1 个答案:

答案 0 :(得分:0)

更改scala> codes.show(false) +---+---------------------------+ |id |rate_plan_code | +---+---------------------------+ |0 |[AAA, RACK, SMOBIX, SMOBPX]| +---+---------------------------+ val codesAsSingleString = codes.as[(Long, Array[String])] .map { case (id, codes) => (id, codes.mkString(", ")) } .toDF("id", "codes") scala> codesAsSingleString.show(false) +---+-------------------------+ |id |codes | +---+-------------------------+ |0 |AAA, RACK, SMOBIX, SMOBPX| +---+-------------------------+ scala> codesAsSingleString.printSchema root |-- id: long (nullable = false) |-- codes: string (nullable = true) 语句如下:

if