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

SNOW-966360 Support Explode Function #69

Merged
merged 10 commits into from
Nov 30, 2023
Merged

SNOW-966360 Support Explode Function #69

merged 10 commits into from
Nov 30, 2023

Conversation

sfc-gh-bli
Copy link
Collaborator

@sfc-gh-bli sfc-gh-bli commented Nov 29, 2023

  • Support explode function
    • it is a client side table function
    • works with DataFrame.select, DataFrame.join and Session.tableFunction

// process explode function with literal values
private def callExplode(input: Column): DataFrame = {
import this.implicits._
val dummyDF = Seq(1).toDF("a")
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand here why we need to create a DF with dummy value and column names. This is not even in test.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I want to reuse the DataFrame.join function since it supports explode function.
So I want to create an empty DataFrame, and then add input in this DataFrame via withColumn.
However, Snowpark doesn't support empty DataFrame, therefore I created a dummy DataFrame and remove the dummy column later.

@sfc-gh-bli sfc-gh-bli enabled auto-merge (squash) November 30, 2023 22:28
@sfc-gh-bli sfc-gh-bli merged commit e056bd3 into main Nov 30, 2023
13 checks passed
@sfc-gh-bli sfc-gh-bli deleted the snow-966360 branch November 30, 2023 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants