-
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
#1894 HadoopFsPersistenceFactory
- adding Spline S3 write support
#1912
#1894 HadoopFsPersistenceFactory
- adding Spline S3 write support
#1912
Conversation
…stenceFactory`.
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 reviewed
@@ -0,0 +1,98 @@ | |||
/* | |||
* Copyright 2017 ABSA Group Limited |
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.
how does this pass the check? Don't we have a rule to say it should be 2018?
Also in JSONSerialization.scala
And has a range HadoopFsPersistenceFactory.scala
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 guess the apache-rat-plugin
matchers don't include year (kind of logically), and it's not possible to specify. 🤔
On the other hand I remember Atum failing on wrong year, but it's not using the plugin
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.
Thanks for noticing, it must have been as I copied some of the files from spline prior to making changes to them. Fixed.
I think the licence check only checks if there is a "valid" licence, but for the ABSA one, it does not check the year.
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.
Don't we have a rule to say it should be 2018?
@Zejnilovic what is that rule and why?
@@ -0,0 +1,98 @@ | |||
/* | |||
* Copyright 2017 ABSA Group Limited |
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 guess the apache-rat-plugin
matchers don't include year (kind of logically), and it's not possible to specify. 🤔
On the other hand I remember Atum failing on wrong year, but it's not using the plugin
...-jobs/src/main/scala/za/co/absa/enceladus/spline/persistence/HadoopFsDataLineageWriter.scala
Outdated
Show resolved
Hide resolved
...-jobs/src/main/scala/za/co/absa/enceladus/spline/persistence/HadoopFsDataLineageWriter.scala
Outdated
Show resolved
Hide resolved
...-jobs/src/main/scala/za/co/absa/enceladus/spline/persistence/HadoopFsDataLineageWriter.scala
Outdated
Show resolved
Hide resolved
override def store(lineage: DataLineage)(implicit ec: ExecutionContext): Future[Unit] = Future { | ||
val pathOption = getPath(lineage) | ||
import JSONSerialization._ | ||
for (path <- pathOption) { |
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.
Ha, interesting construction, a map
replacement
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.
foreach
replacement to be precise.
|
||
private def getPath(lineage: DataLineage): Option[Path] = | ||
lineage.rootOperation match { | ||
case dn: Write => Some(new Path(dn.path, fileName)) |
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.
Could the dn
have a more explanatory name?
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.
Thanks, adjusted.
* @return FS + relative path | ||
**/ | ||
def pathStringToFsWithPath(pathString: String): (FileSystem, Path) = { | ||
pathString.toS3Location match { |
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.
This implicit function comes from Atum. That seems like a weird dependency. Wasn't it part of commons too?
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.
At this point of develop
(using Atum 3.3.0, it is still part of Atum). Later, in Atum 3.5+, this is moved to commons.
Since this PR does not update Atum, the import change will have to be resolved in the future.
...jobs/src/main/scala/za/co/absa/enceladus/spline/persistence/HadoopFsPersistenceFactory.scala
Outdated
Show resolved
Hide resolved
...jobs/src/main/scala/za/co/absa/enceladus/spline/persistence/HadoopFsPersistenceFactory.scala
Outdated
Show resolved
Hide resolved
...src/main/scala/za/co/absa/enceladus/spline/persistence/serialization/JSONSerialization.scala
Outdated
Show resolved
Hide resolved
Btw, shouldn't the new factory class be added to |
…ization is linked from Spline, ... )
…oopFsPersistenceFactory` added to the spline.properties.template
Yes, it must be changed in the properties in order to be used, as I note in the PR description. However, |
* * [[za.co.absa.spline.persistence.hdfs.HdfsPersistenceFactory]]. | ||
*/ | ||
object HadoopFsPersistenceFactory { | ||
private val fileNameKey = "spline.hdfs.file.name" |
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 think this was copied from the old Spline, and I'm not sure what naming convention for constants are set in Enceladus, but I remember there was a conversation on CQC some time ago - constant names should generally be written upper camel case - https://docs.scala-lang.org/style/naming-conventions.html#constants-values-and-variables
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.
Usually we adhere to capital letters too. But not very pedantic in code reviews about it. 😉
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 review
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 reviewed
- pulled
- built
- run
Ran it locally, want to run on AWS too, to verify S3 functionality
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* |
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.
For some reason, this empty line makes Scalastyle prevent my build.
✔️ Tested both locally and in AWS. The _LINEAGE file was created both on hfds and S3. |
...-jobs/src/main/scala/za/co/absa/enceladus/spline/persistence/HadoopFsDataLineageWriter.scala
Outdated
Show resolved
Hide resolved
…ladus/spline/persistence/HadoopFsDataLineageWriter.scala Co-authored-by: David Benedeki <14905969+benedeki@users.noreply.github.com>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
* Update for next development version 2.24.0-SNAPSHOT * Suppress download noise in license check * Suppress compiler warning of obsolete Java (#1892) * 1868 statistics with missing counts and datasets missing proprties (#1873) * 1868 statistics with missing counts and datasets missing proprties * 1843 Summary page for properties (#1880) * 1843 Home page with properties, side panel with missing counts and summary page for properties with tab containing datasets missing that particular property * Feature/1603 mapping table filtering general (#1879) * #1603 serde tests for CR and MT DataFrameFilters (mongo-bson-based serde tests for CR and MT DataFrameFilters, mongo-bson-based serde tests extended for CR with a blank mappingTableFilter) * #1909 Increase the limit of columns shown in menas column selection * 1903 Add validation for complex default values in mapping tables on import * Project config and management updates (#1908) Project config and management updates * poc issue template * CODEOWNERS update * developers update * Badges to README.md * 1881 HyperConformance enceladus_info_version from payload (#1896) 1881 HyperConformance enceladus_info_version from payload * #1887 defaultTimestampTimeZone can be source type specific (#1899) #1887 defaultTimestampTimeZone can be source type specific * `DefaultsByFormat` extends the `Defaults` trait, being able to read defaults from configuration files * `DefaultsByFormat` offers further granularity by first checking the format specific setting only then taking the global one * Basic `GlobalDefaults` are not configuration dependent anymore * Standardization now user `DefaultsByFormat` for its defaults, where rawFormat is used for format parameter * Switched to configuration path to be `enceladus.defaultTimestampTimeZone.default` and `enceladus.defaultTimestampTimeZone.[rawFormat]` respectively * `defaultTimestampTimeZone` is still supported/read as an obsolete fallback Co-authored-by: Daniel K <dk1844@gmail.com> * #1887 defaultTimestampTimeZone can be source type specific (#1916) #1887 defaultTimestampTimeZone can be source type specific * rename of the configuration prefix from `enceladus.` to `standardization.` * #172 Save original timezone information in metadata file (#1900) * Upgrade of Atum to 3.6.0 * Writing the default time zones for timestamps and dates into _INFO file * #1894 `HadoopFsPersistenceFactory` - adding Spline S3 write support (#1912) * #1894 Spline S3 support via custom persistence factory `HadoopFsPersistenceFactory`. Co-authored-by: David Benedeki <14905969+benedeki@users.noreply.github.com> * Update versions for release v2.24.0 * Update for next development version 2.25.0-SNAPSHOT * #1926 Add executor extra java opts to helper scripts * #1931 Add switch for running kinit in helper scripts * #1882 Update Cobrix dependency to v.2.3.0 * #1882 Remove explicit "collapse_root" since it is the default since Cobrix 2.3.0 * #1882 Update Cobrix to 2.4.1 and update Cobol test suite for ASCII files. * #1882 Bump up Cobrix version to 2.4.2. * #1927 Spline _LINEAGE and Atum _INFO files permission alignment (#1934) * #1927 - testing setup: set both spline _LINEAGE and atum _INFO to hdfs file permissions 733 -> the result on EMR HDFS was 711 (due to 022 umask there) -> evidence of working * #1927 - cleanup of test settings of 733 fs permissions * #1927 Atum final version 3.7.0 used instead of the snapshot (same code) * #1927 comment change * #1927 - default 644 FS permissions for both _INFO and _LINEAGE files. * 1937 limit output file size (#1941) * 1937 limit output file size * 1937 limit output file size * 1937 renamings + constants * 1937 more conditions * 1937 rename params * 1937 feedback + script params * 1937 more feedback * 1937 final feedback * #1951: Windows Helper scripts - add missing features * `ADDITIONAL_JVM_EXECUTOR_CONF` * Kerberos configuration * Trust store configuration * kinit execution option * `--min-processing-block-size` & `--max-processing-block-size` * logo improvement * * --min-processing-block-size -> --min-processing-partition-size * --max-processing-block-size -> --max-processing-partition-size * #1869: SparkJobs working with LoadBalanced Menas (#1935) * `menas.rest.retryCount` - configuration, how many times an url should be retried if failing with retry-able error implemented * `menas.rest.availability.setup` - configuration, how the url list should be handled * _Standardization_, _Conformance_ and _HyperConformance_ changed to provide retry count and availability setup to Dao, read from configuration * `ConfigReader` enhanced and unified to read configurations more easily and universally * Mockito upgraded to 1.16.42 Co-authored-by: Daniel K <dk1844@gmail.com> * Feature/1863 mapping table filtering (#1929) * #1863 mapping cr & mt fitler successfully reuses the same fragment (both using the same named model) - todo reuse validation, reuse manipulation methods * #1863 FilterEdit.js allows reusing filterEdit TreeTable logic between mCR and MT editings * #1863 mCT editing validation enabled (commons from FilterEdit.js) * #1863 mCT datatype hinting hinting enabled (commons from DataTypeUtils.js) * #1863 mCR/MT edit dialog default width=950px, some cleanup * #1863 bugfixes: directly creating MT with filter (fix on accepting the field), UI fix for MT filter model initialization * #1863 npm audit fix * #1863 bugfix: adding new mCR (when no edit MCR dialog has been opened yet) did not work - fixed * #1863 selecting mapping column from MT schema works (for all schema levels) for edit. TODO = Schema type support #1863 mCR - schema-based columns suggested for filter, value types filled in silently during submit, too. * #1863 bugfix: empty MT - schema may be empty * #1863 bugfix: removing a filter left a null node - cleanup was needed (otherwise view would fail) logging cleanup * #1863 select list item now shows valueType as additionalText, cleanup * #1863 nonEmptyAndNonNullFilled - map->filter bug fixed. * #1863 typo for null filter Co-authored-by: David Benedeki <14905969+benedeki@users.noreply.github.com> * Update versions for release v2.25.0 * [merge] build fix * [merge] npm audit fix * [merge] npm audit fix * [merge] buildfix (menas->rest_api packaging fix) * [merge] review updates Co-authored-by: David Benedeki <benedeki@volny.cz> Co-authored-by: Saša Zejnilović <zejnils@gmail.com> Co-authored-by: David Benedeki <14905969+benedeki@users.noreply.github.com> Co-authored-by: Adrian Olosutean <adi.olosutean@gmail.com> Co-authored-by: Ruslan Iushchenko <yruslan@gmail.com>
Problem summary
Vanilla spline 0.3.9 is not able to write the _LINEAGE file to an S3 location: #1896
Solution
Naively, S3 support was sketched into Spline 0.3.x, however, that was undesirable for multiple reasons. Instead, @wajda suggested overriding the default configuration of Spline
spline.persistence.composition.factories=za.co.absa.spline.persistence.mongo.MongoPersistenceFactory,za.co.absa.spline.persistence.hdfs.HdfsPersistenceFactory
to use a custom
PersistenceFactory
instead (look at the end):spline.persistence.composition.factories=za.co.absa.spline.persistence.mongo.MongoPersistenceFactory,za.co.absa.enceladus.spline.persistence.HadoopFsPersistenceFactory
Using this approach, such a factory can be packed with Enceladus instead of Spline and the original Spline 0.3.9 can remain untouched. Thanks, @wajda!
Test run
Having provided all necessary requirements (Menas with a dataset's conformed publish path being located on S3, data, and configs), the test-run's result indeed includes the
_LINEAGE
file being present in the S3-located output:Release note suggestion
Enceladus can write Spline's
_LINEAGE
file in an S3 location.