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

[python] Parquet read path #407

Merged
merged 1 commit into from Oct 3, 2019

Conversation

TGooch44
Copy link
Contributor

First part of commit to add in read support for parquet format.

@TGooch44
Copy link
Contributor Author

@danielcweeks

Copy link
Contributor

@danielcweeks danielcweeks left a comment

Choose a reason for hiding this comment

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

Few minor comments. I tried running the tox tests and there were a number of minor lint issues for formatting and a few of the tests weren't passing with issues around decimal and double.

ORC = "orc"
PARQUET = "parquet"
AVRO = "avro"
ORC = "orc", True
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be more clear to use a dictionary here to make it clear what these values mean:

e.g.:

    ORC = dict(extension = "orc", splittable=True)
    PARQUET = dict(extension = "parquet", splittable=True)
    AVRO = dict(extension = "avro", splittable=True)

I had to read through the code to understand what these meant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All right fixed the test and lint errors. I agree that it's better to be explicit about the enum attributes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also added a test for file format just for good measure

processing_func = process_funcs.get(field.type.type_id)

if processing_func is None:
try:
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not clear on how we are dealing with values that are not in the avro record here. In the case that an optional field is not in the avro record, we should emit "null", but it appears that we always fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me think through this. I had refactored this code and I think I just left out the .is_required check on that raise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added in the is_required check to the raise and also tweaked the get map function to follow the pattern of the rest of the functions eg use bracket with a try block instead of get.

I'm going to write up some tests for the avro module to explicitly test some of these cases. Not sure if you want to wait on the merge for this or not

@TGooch44 TGooch44 force-pushed the parquet_read_path_1 branch 5 times, most recently from 4fcf04a to 5f71879 Compare October 3, 2019 12:57
@danielcweeks danielcweeks merged commit 57b1099 into apache:master Oct 3, 2019
jun-ma-0 pushed a commit to jun-ma-0/incubator-iceberg that referenced this pull request Dec 3, 2019
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.

None yet

2 participants