Repository navigation
Fix inspect file and partition tables for UUID columns - #4358
Open
rahulsmahadev wants to merge 1 commit into
Open
rahulsmahadev wants to merge 1 commit into
rahulsmahadev wants to merge 1 commit into
Conversation
inspect.files(), entries() and partitions() raised ArrowNotImplementedError on tables with a uuid column: pa.Table.from_pylist cannot build the arrow.uuid type nested in readable_metrics or a partition struct. Build these tables from the storage types and cast them to the schema, so the output types are unchanged. UUID partition values are passed as their 16 bytes, which pyarrow 18 requires. Co-authored-by: Isaac <no-reply@databricks.com>
Contributor
Author
|
@geruh @soumya-ghosh could you take a look when you have a chance? It fixes the file and partition metadata tables from #1626 for tables with uuid columns. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
The file, entry and partition metadata tables raise on any table with a
uuidcolumn:readable_metricsholds the uuid bounds asarrow.uuidvalues inside a struct, and pyarrow cannot build an extension type nested in a struct from Python values, sopa.Table.from_pylistraises. This affectsentries(),files(),data_files(),delete_files(),all_files(),all_data_files(),all_delete_files(), andpartitions()for a table partitioned by identity on a uuid column, even when the bounds are null.This change builds these tables with the storage types (
fixed_size_binary(16)for a uuid) and casts the result to the unchanged schema. UUID partition values are passed as their 16 bytes, which pyarrow 18 (the minimum supported version) needs. UUID row filters (#2372) are a separate issue and are not touched.Are these changes tested?
Yes. Three new tests in
tests/table/test_inspect.pyfail withArrowNotImplementedError: extensionwithout the fix and pass with it, on pyarrow 25 and 18:test_inspect_files_and_entries_render_uuid_bounds: the bounds and thearrow.uuidoutput type for the file and entry tables.test_inspect_files_of_empty_table_with_uuid_column:files()andall_files()on a table without snapshots.test_inspect_partitions_and_files_render_uuid_partition:partitions(),files()andentries()for a table partitioned by identity on a uuid column.Are there any user-facing changes?
Bug fix only: these metadata tables no longer raise on tables with a uuid column. The output schema is unchanged.
This pull request and its description were written by Isaac.