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-781549: Add DataFrame.getColumns() #7

Open
sfc-gh-jfreeberg opened this issue Feb 8, 2023 · 14 comments
Open

SNOW-781549: Add DataFrame.getColumns() #7

sfc-gh-jfreeberg opened this issue Feb 8, 2023 · 14 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@sfc-gh-jfreeberg
Copy link
Collaborator

sfc-gh-jfreeberg commented Feb 8, 2023

Add a method to the DataFrame class, .getColumns() which returns a List<Column> of the dataframe's column names.

@sfc-gh-jfreeberg sfc-gh-jfreeberg added good first issue Good for newcomers python-parity Python SDK methods missing from Java/Scala and removed python-parity Python SDK methods missing from Java/Scala labels Feb 8, 2023
@sfc-gh-jfreeberg sfc-gh-jfreeberg closed this as not planned Won't fix, can't repro, duplicate, stale Apr 6, 2023
@github-actions github-actions bot changed the title Add DataFrame.getColumns() SNOW-781549: Add DataFrame.getColumns() Apr 6, 2023
@sbouhaddi
Copy link

Can i take a look at this one?

@sfc-gh-jfreeberg
Copy link
Collaborator Author

@sbouhaddi -- Yeah absolutely! Check CONTRIBUTING.md for some instructions on setting up your local environment. Ping @sfc-gh-bli or me if you have any questions.

@sbouhaddi
Copy link

Can you assign it to me please?
Thank you

@mfirry
Copy link

mfirry commented Apr 14, 2023

Hi, new here: can something like def getColumns(): Seq[Column] = df.schema.fields.map(f => Column(f.columnIdentifier.name)).toSeq work?

@sbouhaddi
Copy link

Hello,
I didn't look at it yet.
Planning to do it this weekend, i will try your solution and let you know thank you

@sfc-gh-jfreeberg
Copy link
Collaborator Author

Thanks for taking a look @mfirry and @sbouhaddi ! Tag me here if you have any questions

@sbouhaddi
Copy link

@sfc-gh-jfreeberg
It's not mentioned in the issue description , should this modification impact the java class , the scala one or both.
Can you please share that info with me
Thanks

@sbouhaddi
Copy link

@sfc-gh-jfreeberg
Should i install or do something locally to make the project work ?
I created a snowflake account but i d'ont think that was enough
I'm having this exception
**net.snowflake.client.jdbc.SnowflakeSQLException: JDBC driver encountered communication error. Message: Exception encountered for HTTP request: Connection reset.**

When i execute

mvn -DtagsToExclude=com.snowflake.snowpark.UDFTest -Dgpg.skip scoverage:report

@sfc-gh-jfreeberg
Copy link
Collaborator Author

@sbouhaddi -- This should be support for both the Java and Scala classes. I'd recommend implementing it on the Scala class, then importing and adding a wrapper around the Java method (if you browse the Java DataFrame class you'll see a similar pattern).

As for the build problem, which JDK do you have installed locally?

@sfc-gh-jfreeberg
Copy link
Collaborator Author

@sbouhaddi -- Any luck?

@sbouhaddi
Copy link

@sfc-gh-jfreeberg Sorry i was a bit busy last week.
I will look at it this week hopefully.

@sbouhaddi
Copy link

it's my first time with scala , i'm willing to learn and finish this issue .
But i'm needing some help and guidance if someone can provide it

@mfirry
Copy link

mfirry commented Jul 11, 2023

@sfc-gh-jfreeberg ?

@sfc-gh-wfateem
Copy link

@sbouhaddi That error indicates that there's likely a firewall or proxy blocking your connection to the snowflakecomputing.com host:

 **net.snowflake.client.jdbc.SnowflakeSQLException: JDBC driver encountered communication error. Message: Exception encountered for HTTP request: Connection reset.**

You need to be able to run the following query in Snowflake to identify which hosts and ports you need to open up traffic to and from:
select system$allowlist()

But if you're unable to connect to the *.snowflakecomputing.com host from your own machine then you're unlikely going to be able to access it using a browser either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants