Skip to content

Spark 3.0 readiness part 1 #647

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

Merged
merged 51 commits into from
Sep 18, 2020

Conversation

Niharikadutta
Copy link
Collaborator

@Niharikadutta Niharikadutta commented Sep 1, 2020

This PR adds support for following APIs added in Spark 3.0:

SparkSession APIs

  • python def getActiveSession(cls)
  • scala def executeCommand(runner: String, command: String, options: Map[String, String]): DataFrame

DataFrame APIs

  • scala/python def tail(n: Int): Array[T]
  • scala printSchema(level: Int): Unit
  • scala def explain(mode: String): Unit
  • scala def observe(name: String, expr: Column, exprs: Column*): Dataset[T]

DataFrameStatFunctions APIs

  • scala def sampleBy[T](col: Column, fractions: Map[T, Double], seed: Long): DataFrame

This PR addresses part of #633

Niharikadutta and others added 30 commits April 19, 2020 22:31
This reverts commit a766146, reversing
changes made to 73db52b.

Reverting countvectorizer changes
…ie/spark"

This reverts commit ad6bced, reversing
changes made to 4c5d502.

reverting countvectorizer changes -2
@Niharikadutta Niharikadutta reopened this Sep 4, 2020
@imback82
Copy link
Contributor

imback82 commented Sep 8, 2020

Can you resolve conflicts? Thanks!

@imback82 imback82 added the enhancement New feature or request label Sep 12, 2020
@imback82 imback82 added this to the 1.0.0 milestone Sep 12, 2020
@Niharikadutta
Copy link
Collaborator Author

After merging from master, I can see VectorUdf tests failing in collectToPython with java.lang.IllegalArgumentException. I am looking into it.

suhsteve
suhsteve previously approved these changes Sep 16, 2020
Copy link
Member

@suhsteve suhsteve left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Contributor

@imback82 imback82 left a comment

Choose a reason for hiding this comment

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

Few nits, but LGTM, thanks @Niharikadutta!

public void PrintSchema(int level) =>
Console.WriteLine(
(string)((JvmObjectReference)_jvmObject.Invoke("schema"))
.Invoke("treeString", level));
Copy link
Contributor

Choose a reason for hiding this comment

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

indentation looks off?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed, please let me know if that looks better!

Copy link
Member

@suhsteve suhsteve Sep 18, 2020

Choose a reason for hiding this comment

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

You can try the following if the indentation looks funny.

        public void PrintSchema(int level)
        {
            var schema = (JvmObjectReference)_jvmObject.Invoke("schema");
            Console.WriteLine((string)schema.Invoke("treeString", level));
        }

@imback82 imback82 merged commit 1ab206d into dotnet:master Sep 18, 2020
@Niharikadutta Niharikadutta deleted the nidutta/spark3.0readiness_part1 branch September 18, 2020 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants