File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
terraform/account-wide-infrastructure/modules/glue/src Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 99 to_timestamp ,
1010 when ,
1111)
12+ from pyspark .sql .types import NullType
1213
1314
1415def resolve_dupes (df ):
@@ -49,4 +50,15 @@ def dtype_conversion(df):
4950 .withColumn ("time" , from_unixtime (col ("time" )).cast ("timestamp" ))
5051 .withColumn ("date" , to_date (col ("time" )))
5152 )
52- return df .drop ("event_timestamp_cleaned" )
53+
54+ df = df .drop ("event_timestamp_cleaned" )
55+
56+ select_exprs = []
57+ for column_name in df .columns :
58+ column_type = df .schema [column_name ].dataType
59+ if isinstance (column_type , NullType ):
60+ select_exprs .append (col (column_name ).cast ("string" ).alias (column_name ))
61+ else :
62+ select_exprs .append (col (column_name ))
63+
64+ return df .select (* select_exprs )
You can’t perform that action at this time.
0 commit comments