Re: udf that handles null values

2017-04-24 Thread Zeming Yu
issue today at stackoverflow. > > http://stackoverflow.com/questions/43595201/python-how- > to-convert-pyspark-column-to-date-type-if-there-are-null- > values/43595728#43595728 > > > Thank you, > *Pushkar Gujar* > > > On Mon, Apr 24, 2017 at 8:22 PM, Zeming Yu <zemin...@gm

Re: udf that handles null values

2017-04-24 Thread Pushkar.Gujar
> hi all, > > I tried to write a UDF that handles null values: > > def getMinutes(hString, minString): > if (hString != None) & (minString != None): return int(hString) * 60 + > int(minString[:-1]) > else: return None > > flight2 = (flight2.withCo

Re: udf that handles null values

2017-04-24 Thread cy h
com> 작성: > hi all, > > I tried to write a UDF that handles null values: > > def getMinutes(hString, minString): > if (hString != None) & (minString != None): return int(hString) * 60 + > int(minString[:-1]) > else: return None > > flight2

udf that handles null values

2017-04-24 Thread Zeming Yu
hi all, I tried to write a UDF that handles null values: def getMinutes(hString, minString): if (hString != None) & (minString != None): return int(hString) * 60 + int(minString[:-1]) else: return None flight2 = (flight2.withColumn("duration_minutes", udfGetMinut