You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to know if there is a way to turn off case sensitivity on requiredColumns and addedColumns? Even if I have spark.sql.caseSensitive set to false my unit test is still failing.
The [LOWERCASE] columns are not included in the DataFrame with the following columns [lowercase]
com.github.mrpowers.spark.daria.sql.MissingDataFrameColumnsException: The [LOWERCASE] columns are not included in the DataFrame with the following columns [lowercase]
at com.github.mrpowers.spark.daria.sql.DataFrameColumnsChecker.validatePresenceOfColumns(DataFrameColumnsChecker.scala:19)
Thank you!
The text was updated successfully, but these errors were encountered:
This seems to be a problem with how the library is validating the columns. I can go ahead and fix this problem by applying the following change if @MrPowers agrees with that.
I would change class com.github.mrpowers.spark.daria.sql.DataFrameColumnsChecker, from val missingColumns = requiredColNames.diff(df.columns.toSeq) to
val givenColumns = df.columns.toSeq.map(_.toLowerCase)
val requiredColumnsLower = requiredColNames.map(_.toLowerCase)
requiredColumnsLower.diff(givenColumns)
That way the block of code keeps with time complexity O(n) and the problem is solved.
Hi.
I would like to know if there is a way to turn off case sensitivity on requiredColumns and addedColumns? Even if I have spark.sql.caseSensitive set to false my unit test is still failing.
sparkSession.conf.set("spark.sql.caseSensitive", false)
Thank you!
The text was updated successfully, but these errors were encountered: