Skip to content
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

Change dbname declaration in spark.catalog.exists #861

Open
wants to merge 21 commits into
base: 0720_release
Choose a base branch
from

Conversation

souravbaner-da
Copy link
Contributor

Close #858

GeekSheikh and others added 16 commits March 6, 2023 12:19
* initial commit

* Refractor InitializerFunctions.scala

* Refractor InitializerFunctions.scala

* Change Scala Sources Name

* Refractor InitializerFunctions.scala

* Refractor InitializerFunctions.scala

* Added Initializerv2.scala

* Added Initializerv2.scala

* Changed as per Sriram comment

* Changed as per Sriram comment

* dropped Initializer Deprecated

---------

Co-authored-by: geeksheikh <geeksheikh@users.noreply.github.com>
Co-authored-by: Sourav Banerjee <30810740+Sourav692@users.noreply.github.com>
Co-authored-by: Daniel Tomes <10840635+GeekSheikh@users.noreply.github.com>
* initial commit

* Refractor Initializer (#683)

* initial commit

* Refractor InitializerFunctions.scala

* Refractor InitializerFunctions.scala

* Change Scala Sources Name

* Refractor InitializerFunctions.scala

* Refractor InitializerFunctions.scala

* Added Initializerv2.scala

* Added Initializerv2.scala

* Changed as per Sriram comment

* Changed as per Sriram comment

* dropped Initializer Deprecated

---------

Co-authored-by: geeksheikh <geeksheikh@users.noreply.github.com>
Co-authored-by: Sourav Banerjee <30810740+Sourav692@users.noreply.github.com>
Co-authored-by: Daniel Tomes <10840635+GeekSheikh@users.noreply.github.com>

* Change Job Trigger type to Triggered

* Change Job Trigger type to Triggered

* Change Job Trigger type to Triggered

---------

Co-authored-by: geeksheikh <geeksheikh@users.noreply.github.com>
Co-authored-by: Sourav Banerjee <30810740+Sourav692@users.noreply.github.com>
Co-authored-by: Daniel Tomes <10840635+GeekSheikh@users.noreply.github.com>
* initial commit

* Refractor Initializer (#683)

* initial commit

* Refractor InitializerFunctions.scala

* Refractor InitializerFunctions.scala

* Change Scala Sources Name

* Refractor InitializerFunctions.scala

* Refractor InitializerFunctions.scala

* Added Initializerv2.scala

* Added Initializerv2.scala

* Changed as per Sriram comment

* Changed as per Sriram comment

* dropped Initializer Deprecated

---------

Co-authored-by: geeksheikh <geeksheikh@users.noreply.github.com>
Co-authored-by: Sourav Banerjee <30810740+Sourav692@users.noreply.github.com>
Co-authored-by: Daniel Tomes <10840635+GeekSheikh@users.noreply.github.com>

* gcp integration added

* gcp integration added

* minor updates from daniel

* review comment implemented

---------

Co-authored-by: geeksheikh <geeksheikh@users.noreply.github.com>
Co-authored-by: Sourav Banerjee <109206082+souravbaner-da@users.noreply.github.com>
Co-authored-by: Sourav Banerjee <30810740+Sourav692@users.noreply.github.com>
Co-authored-by: Daniel Tomes <10840635+GeekSheikh@users.noreply.github.com>
* conde changes completed

* column name changed from etl_storage_prefix to storage prefix

---------

Co-authored-by: geeksheikh <geeksheikh@users.noreply.github.com>
…er. (#679)

Co-authored-by: Carson Wilkins <carson.wilkins@databricks.com>
* code changes completed

* code changes completed

* code changes completed

* code changes completed
* initial 0713 commit

* handled null AccumUpates
Co-authored-by: Sourav Banerjee <30810740+Sourav692@users.noreply.github.com>
@souravbaner-da souravbaner-da added the bug Something isn't working label Apr 3, 2023
@souravbaner-da souravbaner-da added this to the 0.7.2.0 milestone Apr 3, 2023
@souravbaner-da souravbaner-da self-assigned this Apr 3, 2023
@github-advanced-security
Copy link

You have successfully added a new SonarCloud configuration ``. As part of the setup process, we have scanned this repository and found no existing alerts. In the future, you will see all code scanning alerts on the repository Security tab.

@souravbaner-da souravbaner-da linked an issue Apr 3, 2023 that may be closed by this pull request
@GeekSheikh
Copy link
Contributor

GeekSheikh commented Apr 5, 2023

@souravbaner-da -- test is failing

describe("Tests for initialize database") {
ignore ("initializeDatabase function should create both elt and consumer database") {
import spark.implicits._
val conf = new Config
conf.setDatabaseNameAndLoc("overwatch_etl", "file:/src/test/resources/overwatch/spark-warehouse/overwatch_etl.db", "file:/src/test/resources/overwatch/spark-warehouse/overwatch.db")
conf.setConsumerDatabaseNameandLoc("overwatch", "file:/src/test/resources/overwatch/spark-warehouse/overwatch.db")
val init = new Initializer(conf)
val database = PrivateMethod[Database]('initializeDatabase)
init invokePrivate database()
val databases = spark.sql("show databases").select("namespace").map(f => f.getString(0)).collect()
assert(databases.contains("overwatch_etl"))
assert(databases.contains("overwatch"))
}
}

it("dataTargetIsValid function should throw exception when the current db location is different than the one present already") {
val dataTarget = DataTarget(Some("overwatch_etl"),Some("/path/to/database"), Some("/path/prefix"), Some("overwatch"), Some("/path/to/consumer_database"))
spark.sql("create database if not exists overwatch_etl")
val conf = new Config
val init = new Initializer(conf)
val dataTargetIsValid = PrivateMethod[Boolean]('dataTargetIsValid)
assertThrows[BadConfigException](init invokePrivate dataTargetIsValid(dataTarget))
}

@sonarcloud
Copy link

sonarcloud bot commented Apr 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@souravbaner-da
Copy link
Contributor Author

Currently this issue will be on hold. As the suggested solution depend on spark version. Specifically from spark version 3.3.0 the solution is working fine and for all other version the solution is failing.
Only solution for this is to check spark version during the check of database exist and build our solution depend on the spark version.
May be look into it in future release.

For now in overwatch public doc we will mention that database name in config should not contain any special character. Corresponding PR for the documentation is
#875

@souravbaner-da
Copy link
Contributor Author

Currently this PR is on hold. Will start working on this after we are done with below issue #858

@GeekSheikh GeekSheikh modified the milestones: 0.7.2.1, 0.7.3.0 Jun 19, 2023
@gueniai gueniai changed the title Change dbname declartion in spark.catalog.exists Change dbname declaration in spark.catalog.exists Aug 10, 2023
@gueniai gueniai modified the milestones: 0.7.3.0, backlog Aug 10, 2023
@CLAassistant
Copy link

CLAassistant commented Nov 27, 2023

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] OW fails when ETL DB name has a hyphen
7 participants