Hi Gabor, Right now, I think the only way to get those parameters is to implement a `PartitionSpecVisitor`, which will be passed the parameters. We can definitely improve the API here where we need to. Initially, I wanted to avoid having code that would special case transforms instead of delegating to the Transform API. That's why it is so locked down.
rb On Tue, Sep 22, 2020 at 7:33 AM Gabor Kaszab <[email protected]> wrote: > Hey, > > I'm working on the integration of Apache Iceberg project into Apache > Impala. Currently, I'm investigating how to implement partition transforms > that have parameters (Bucket and Truncate) and I haven't found a way to > retrieve their parameters (numBuckets and width) from table metadata > through the Iceberg API. > > I see that there are functions for this purpose (numBuckets() > <https://github.com/apache/iceberg/blob/master/api/src/main/java/org/apache/iceberg/transforms/Bucket.java#L75> > and width() > <https://github.com/apache/iceberg/blob/master/api/src/main/java/org/apache/iceberg/transforms/Truncate.java#L56>) > but I found that the classes Bucket and Truncate are only accessible within > their packages and I'm not able to import them into Impala project. I can > import the base class Transforms but that doesn't provide an interface for > my needs. > > Without this support I won't be able to implement a few things, e.g. SHOW > CREATE TABLE just to name one. > > Am I missing something? Is there a way to get the parameters of a > partition transform through the API? > > Cheers, > Gabor > > > -- Ryan Blue Software Engineer Netflix
