Skip to content
This repository was archived by the owner on Nov 10, 2018. It is now read-only.

ENH Load CSV files from different dialects #274

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

moreymat
Copy link

@moreymat moreymat commented Aug 3, 2018

This PR exposes some parameters of pyspark's CSV reader: sep, escape and multiLine, up to session.load_data.
This enables to load files in various dialects of CSV.

Expose parameters of pyspark's CSV reader: sep, escape and multiLine.
Copy link
Contributor

@gmichalo gmichalo left a comment

Choose a reason for hiding this comment

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

Thank you for your input! Our policy for PR is to merge into dev, not into master. Please change the base-branch for this PR to dev

@moreymat moreymat changed the base branch from master to dev August 3, 2018 14:06
@moreymat
Copy link
Author

moreymat commented Aug 3, 2018

@gmichalo thanks, I've changed the base branch and resolved the conflicts.
Let me know if you have any other request !


:return: dataframe
"""
try:
if schema is None:
df = spark_session.read.csv(file_path, header=True)
df = spark_session.read.csv(file_path, header=True, sep=sep,
escape=escape, multiLine=multiLine))
Copy link
Contributor

Choose a reason for hiding this comment

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

One of the two parenthesis needs to be removed

Copy link
Author

Choose a reason for hiding this comment

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

Oops. Done.

df = spark_session.read.csv(file_path, header=True, schema=schema)
df = spark_session.read.csv(file_path, header=True, schema=schema,
sep=sep, escape=escape,
multiLine=multiLine))
Copy link
Contributor

Choose a reason for hiding this comment

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

One of the two parenthesis needs to be removed

Copy link
Author

Choose a reason for hiding this comment

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

Fixed too.

@gmichalo gmichalo requested a review from j48zheng August 9, 2018 16:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants