Skip to content

Convert the Logical to Physical map to a visitor#43

Merged
Fokko merged 3 commits intoapache:mainfrom
Fokko:fd-convert-map-to-visitor
Oct 7, 2023
Merged

Convert the Logical to Physical map to a visitor#43
Fokko merged 3 commits intoapache:mainfrom
Fokko:fd-convert-map-to-visitor

Conversation

@Fokko
Copy link
Copy Markdown
Contributor

@Fokko Fokko commented Oct 6, 2023

I noticed that the FixedType was missing.

I noticed that the FixedType was missing.
Comment thread pyiceberg/io/pyarrow.py Outdated
return visit(iceberg_type, _PRIMITIVE_TO_PHYISCAL_TYPE_VISITOR)


class PrimitiveToPyhsicalType(SchemaVisitorPerPrimitiveType[str]):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Typo: Pyhsical (unless maybe that's how it's spelled in the python community)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤣 Good old typo

Comment thread pyiceberg/io/pyarrow.py Outdated
return "BYTE_ARRAY"

def visit_decimal(self, decimal_type: DecimalType) -> str:
raise ValueError("unknown")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We could convert to FIXED_LEN_BYTE_ARRAY or INT64 or INT32 based on the precision, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I would say FIXED_LEN_BYTE_ARRAY. This visitor is just to double-check that we get the type that we expect.

Copy link
Copy Markdown
Contributor

@rdblue rdblue left a comment

Choose a reason for hiding this comment

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

Looks good overall, but I'd fix the typo before merging.

@Fokko Fokko force-pushed the fd-convert-map-to-visitor branch from 9b4efa1 to c33eb7a Compare October 6, 2023 19:32
@Fokko Fokko merged commit ce85358 into apache:main Oct 7, 2023
@Fokko
Copy link
Copy Markdown
Contributor Author

Fokko commented Oct 7, 2023

Thanks @rdblue for the quick review! 🙌

@Fokko Fokko deleted the fd-convert-map-to-visitor branch October 7, 2023 13:46
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