[
https://issues.apache.org/jira/browse/SPARK-11180?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Reynold Xin resolved SPARK-11180.
---------------------------------
Resolution: Fixed
Fix Version/s: 1.6.0
> DataFrame.na.fill does not support Boolean Type:
> -------------------------------------------------
>
> Key: SPARK-11180
> URL: https://issues.apache.org/jira/browse/SPARK-11180
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 1.5.0, 1.5.1
> Reporter: Satya Narayan
> Priority: Minor
> Fix For: 1.6.0
>
>
> Currently DataFrame.na.fill does not support Boolean primitive type. We
> have use cases where while data massaging/preparation we want to fill boolean
> columns with false/true value.
> Ex:
> {code}
> val empDf = sqlContext.createDataFrame(Seq[(Integer,String,java.lang.Boolean)]
> ((1,null,null),(2,"SVP",true),(3,"Dir",false)))
> .toDF("EmpId","Designation","isOfficer")
> empDf: org.apache.spark.sql.DataFrame = [EmpId: int, Designation: string,
> isOfficer: boolean]
> scala> empDf.show
> |EmpId|Designation|isOfficer|
> | 1| null| null|
> | 2| SVP| true|
> | 3| Dir| false|
> {code}
> We want to set "isOfficer" false whenever there is null.
> {code}
> scala> empDf.na.fill(Map("isOfficer"->false))
> throws exception
> java.lang.IllegalArgumentException: Unsupported value type java.lang.Boolean
> (false).
> at
> org.apache.spark.sql.DataFrameNaFunctions$$anonfun$fill0$1.apply(DataFrameNaFunctions.scala:370)
> ...........
> {code}
> Can you add support for Boolean into na.fill function.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]