-
In scala I occasionally use this syntax to fine-tune the nullability of a column: This allows me to keep the dataframe the same, but make assertions about the nulls. The nulls need to be fine-tuned prior to writing the data to SQL (eg. via com.microsoft.sqlserver.jdbc.spark). The database won't allow loading nullable data into a non-nullable SQL Server column. Is there any approach for this in the .net libraries? I cannot find the "rdd" member, and I'm assuming that is by design. But it would be helpful to know how to adjust the approach I've used in the past. Here is more information about the "rdd" approach The "withcolumn" approach doesn't seem to allow me to customize the nullability. Any tips would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I ended up using SelectExpr and passing it expressions like so: "COALESCE(SourceModule,'') AS SourceModule", |
Beta Was this translation helpful? Give feedback.
-
I still think it would be helpful for this project to provide an equivalent for:
That is an extremely common way of swapping the null criteria on columns, and it is helpful when using it in conjunction with the SQL Server connector. |
Beta Was this translation helpful? Give feedback.
-
Have you tried ? |
Beta Was this translation helpful? Give feedback.
I ended up using SelectExpr and passing it expressions like so:
"COALESCE(SourceModule,'') AS SourceModule",