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

[SW-2496] Fix the Flow link for Databricks Azure #2417

Merged
merged 2 commits into from Dec 15, 2020
Merged

Conversation

mn-mikke
Copy link
Collaborator

There are two problems.

  • Databricks chanced base address which is not easy to resolve since contains a random number which is not stored anywhere on the driver or in the environment properties. The problem is solved via resolving base address in the web browser.

More details on: https://docs.microsoft.com/en-us/azure/databricks/workspace/per-workspace-urls

  • The UIUtils.headerSparkPage method in Databricks Spark has more parameters than Apache Spark. I solved the problem via reflection call.

Databricks: request: javax.servlet.http.HttpServletRequest, title: String,content: => Seq[scala.xml.Node], activeTab: org.apache.spark.ui.SparkUITab, helpText: Option[String], showVisualization: Boolean, useDataTables: Boolean, supportScreenshot: Boolean

Apache: request: javax.servlet.http.HttpServletRequest, title: String,content: => Seq[scala.xml.Node], activeTab: org.apache.spark.ui.SparkUITab, helpText: Option[String], showVisualization: Boolean, useDataTables: Boolean

@@ -32,7 +33,24 @@ object SparkSpecificUtils extends CrossSparkUtils {
content: => Seq[Node],
activeTab: SparkUITab,
helpText: String): Seq[Node] = {
UIUtils.headerSparkPage(request, "Sparkling Water", content, activeTab, helpText = Some(helpText))
val method = UIUtils.getClass.getMethods.find(m => m.getName == "headerSparkPage").get
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is obviously fragile and can break if an overloaded method is added to spark.ui

But I guess that you can live with this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if the method doesn't exist the Spark UI shows an exception if Sparkling Water tab is clicked. For Apache Spark we know that there is such a method. This could if a user deploys SW to a obscure platform with a custom build of Spark which we haven't tested. IMHO, we can live with that.

@mn-mikke mn-mikke merged commit 5af8b3a into master Dec 15, 2020
@mn-mikke mn-mikke deleted the mn/SW-2496 branch December 15, 2020 18:43
mn-mikke added a commit that referenced this pull request Dec 15, 2020
* [SW-2496] Fix the Flow link for Databricks Azure

* spotless apply

(cherry picked from commit 5af8b3a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants