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

support for pyspark connection method #308

Closed
wants to merge 1 commit into from

Conversation

cccs-jc
Copy link

@cccs-jc cccs-jc commented Mar 30, 2022

#305

resolves #

Description

Checklist

  • I have signed the CLA
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change to the "dbt-spark next" section.

@cla-bot
Copy link

cla-bot bot commented Mar 30, 2022

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: cccs-jc.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

Copy link
Collaborator

@JCZuurmond JCZuurmond left a comment

Choose a reason for hiding this comment

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

Hi @cccs-jc : I have added some comments. Could you merge your changes with the existing Spark session module?

try:
from pyspark.rdd import _load_from_socket
import pyspark.sql.functions as F
from pyspark.sql import SparkSession
Copy link
Collaborator

Choose a reason for hiding this comment

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

Functions and Sparksessions are not used in this file


def __init__(self, python_module):
self.result = None
if python_module:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I prefer to avoid such a hook, it's very specific. The python_module is a unexpected parameter for PysparkConnectionWrapper, it's unclear why it is needed and how it works.

We could add docs about this, still it is confusing to write PysparkConnectionWrapper(python_module)

Copy link
Author

Choose a reason for hiding this comment

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

I can change it, what do you propose ?

self.result = self.spark.sql(sql)
logger.debug("Executed with no errors")
if "show tables" in sql:
self.result = self.result.withColumn("description", F.lit(""))
Copy link
Collaborator

Choose a reason for hiding this comment

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

why add the description column?

Copy link
Author

Choose a reason for hiding this comment

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

this is an iceberg specific issue. When using iceberg it's missing the column. I'll remove this from the PR

@github-actions
Copy link
Contributor

This PR has been marked as Stale because it has been open for 180 days with no activity. If you would like the PR to remain open, please remove the stale label or comment on the PR, or it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Sep 28, 2022
@github-actions github-actions bot closed this Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants