-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#2022 spark-commons #2023
#2022 spark-commons #2023
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
- code reviewed
- pulled
- built
- run
.withColumnIfDoesNotExist(InfoDateColumn, to_date(lit(reportDate), ReportDateFormat)) | ||
.withColumnIfDoesNotExist(InfoDateColumnString, lit(reportDate)) | ||
.withColumnIfDoesNotExist(InfoVersionColumn, lit(reportVersion)) | ||
.withColumnIfDoesNotExist(function)(InfoDateColumn, to_date(lit(reportDate), ReportDateFormat)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is late, but I think I take issue with DataFrameImplicits.DataFrameEnhancements.withColumnIfDoesNotExist(ifExists: (DataFrame, String) => DataFrame)(colName: String, colExpr: Column)
that originated in AbsaOSS/spark-commons#18, apparently.
IMHO the name of the method simply does not conform to what it does and what params it requires - the name suggests no-op column does not exist, but it allows an action in such a case, too. My vote is either to have two separate methods withColumnIfDoesNotExist
and transformIfColumnExists
or at least rename this method somehow to make sense.
Here, you can alleviate the problem only by renaming the function
to something more descriptive like ifExistsFn
or similar. (this occurs in multiple codebase files)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tend to agree. In minimum, the parameters order seems wrong, and could have a default value in the ifExists
parameter.
...jobs/src/main/scala/za/co/absa/enceladus/standardization/interpreter/stages/TypeParser.scala
Outdated
Show resolved
Hide resolved
…/interpreter/stages/TypeParser.scala Co-authored-by: Daniel K <dk1844@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
spark-jobs/src/main/scala/za/co/absa/enceladus/conformance/HyperConformance.scala
Outdated
Show resolved
Hide resolved
import org.apache.spark.sql.types._ | ||
import scala.util.Try | ||
|
||
object StructFieldImplicits { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove this functions? Within Enceladus they seemed/seems pretty useful - code is simpler and shorter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are already in spark-commons, just a bit renamed and on Metadata. I'm not sure if it makes sense to be duplicated in Enceladus and spark-commons
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I see. They are useful, but I like them even better in the original form, being more concise. 🤷♂️
utils/src/main/scala/za/co/absa/enceladus/utils/schema/SparkUtils.scala
Outdated
Show resolved
Hide resolved
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Refactoring, doesn't really need/can be retested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks fine, but my build *unit tests) fails, while develop-ver-3.0
passes.
Closes #2022