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

Make RowType fields available in SPI? #5601

Closed
zhenxiao opened this issue Jul 7, 2016 · 7 comments
Closed

Make RowType fields available in SPI? #5601

zhenxiao opened this issue Jul 7, 2016 · 7 comments

Comments

@zhenxiao
Copy link
Collaborator

zhenxiao commented Jul 7, 2016

Currently, RowType is in presto-main, not in presto-spi
To better handle nested fields in Parquet(or ORC), need to get fields for a RowType, and RowField. Is it possible to put RowType in presto-spi? Or, is there other ways to make Parquet or ORC aware of RowType and RowFields?
@martint @dain @cberner @electrum @erichwang

@cberner
Copy link
Contributor

cberner commented Jul 7, 2016

Could you provide more details about why it's needed? The current implementation doesn't need it, and it can support reading and writing them

@zhenxiao
Copy link
Collaborator Author

zhenxiao commented Jul 7, 2016

When we are trying to implement Nested Schema Evolution, and Nested Column Pruning in #5547, we need to get RowFields of a RowType, and use each RowField name to look up the corresponding parquet type in parquet file schema. There is no RowType information in SPI, then Parquet files could not get RowFields.

@cberner
Copy link
Contributor

cberner commented Jul 7, 2016

You should be able to get that information by calling getTypeSignature().getParameters() which is on Type in the SPI

@zhenxiao
Copy link
Collaborator Author

zhenxiao commented Jul 7, 2016

Thank you, @cberner Correct me if I get misunderstanding. if I have a RowType struct:
RowType <Integer ColumnA, Double ColumnB>

My understanding is getTypeSignature().getParameters() will return <Integer, Double>, will it return ColumnA and ColumnB?

@cberner
Copy link
Contributor

cberner commented Jul 8, 2016

yes, it should return a list of the fields which can be accessed as NamedTypeSignature I believe

@zhenxiao
Copy link
Collaborator Author

zhenxiao commented Jul 8, 2016

oh, get it. Thank you

@cberner
Copy link
Contributor

cberner commented Jul 8, 2016

Np. Please re-open if you end up needing this

@cberner cberner closed this as completed Jul 8, 2016
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

No branches or pull requests

2 participants