Skip to content

Column-wise configuration #2450

Closed
Closed

Description

@asfimport

After adding some new statistics and encodings into Parquet it is getting very hard to be smart and choose the best configs automatically. For example for which columns should we save column index and/or bloom-filters? Is it worth using dictionary for a column that we know will fall back to another encoding?

The idea of this feature is to allow the library user to fine-tune the configuration by setting it column-wise. To support this we extend the existing configuration keys by a suffix to identify the related column. (From now on we introduce new keys following the same syntax.)
{key of the configuration}#{column path in the file schema}
For example: parquet.enable.dictionary#column.path.col_1

This jira covers the framework to support the column-wise configuration with the implementation of some existing configs where it make sense (e.g. parquet.enable.dictionary). Implementing new configuration is not part of this effort.

Reporter: Gabor Szadovszky / @gszadovszky
Assignee: Gabor Szadovszky / @gszadovszky

Related issues:

PRs and other links:

Note: This issue was originally created as PARQUET-1784. Please see the migration documentation for further details.

Activity

  1. asfimport commented on Feb 5, 2020

    @asfimport
    Author

    Gabor Szadovszky / @gszadovszky:
    Referencing columns by their index is really hard to be implemented. Most of the code parts where the config is used the schema is not available. This option is removed from the description.

  2. asfimport commented on Feb 5, 2020

    @asfimport
    Author

    Walid Gara / @garawalid:
    I think it's a good idea. We can think also of using * to mention all columns.

    Example:

    conf.set("parquet.bloom.filter.column.names", "*"); 
  3. asfimport commented on Feb 6, 2020

    @asfimport
    Author

    Gabor Szadovszky / @gszadovszky:
    @garawalid,

    The idea is to use a "root" key for the configuration and add a specific #column.path suffix to the key to set the configuration for the related column only. So, to turn the bloom filters on for all the columns would be

    conf.set("parquet.bloom.filter", true); 

    and to turn it off for a specific column:

    conf.set("parquet.bloom.filter#column.path", false);
  4. asfimport commented on Feb 6, 2020

    @asfimport
    Author

    Walid Gara / @garawalid:
    @gszadovszky

    I'm working on a general concept of allowing configuration to be set for specific columns. See PARQUET-1784 for details.
    What do you think of having the mentioned configuration as follows?

    conf.set("parquet.bloom.filter.enabled", false); // Might not be required as this is the default
    conf.set("parquet.bloom.filter.enabled#content", true); // Might not be necessary as by setting the expected ndv you explicitly sets this one
    conf.set("parquet.bloom.filter.enabled#line", true); // Might not be necessary as by setting the expected ndv you explicitly sets this one
    conf.set("parquet.bloom.filter.expected.ndv#content", 1000);
    conf.set("parquet.bloom.filter.expected.ndv#line", 200);

    This might require more writing but more clear and less error prone.
    I made some research about passing multiple values to the config parameter. In Spark, Hive, Hadoop and ORC, they use a comma-separated list. I'm wondering whether this new style of configuration breaks the UX.

    Examples of properties:

    • Spark: spark.ui.filters

    • Hive: hive.metastore.end.function.listeners

    • Hadoop: yarn.app.mapreduce.am.env

    • ORC: orc.bloom.filter.columns

      Your suggestion sounds good to me and I find it flexible and less error-prone as you said.

       

  5. asfimport commented on Feb 7, 2020

    @asfimport
    Author

    Gabor Szadovszky / @gszadovszky:
    @garawalid,

    Thanks for the research and the examples.

    If one would like to set some parquet specific configuration it needs to consult the Parquet documentations to know which key is to be used and which values are allowed. Therefore, I don't think Parquet needs to follow the existing configurations of other components.

    What I would like to implement here is to have a common way for setting the configuration of different columns. Let's check the following example. We would like to set the encoding of some specific columns while we would like to keep the encoding of the other columns to be selected automatically . We might configure it the following way using lists.

    conf.setStrings("parquet.encoding.columns", "float_col", "double_col");
    conf.setStrings("parquet.encoding", "byte_stream_split", "byte_stream_split");

    Or, we use the pattern described in this jira:

    conf.set("parquet.encoding#float_col", "byte_stream_split");
    conf.set("parquet.encoding#double_col", "byte_stream_split");

    I think, the latter is cleaner and less error prone. Moreover, org.apache.hadoop.conf.Configuration only gives support for string lists while in the latter case you can use any value type supported by org.apache.hadoop.conf.Configuration in a clean way.

    What do you think? If you have time, you may also like to check my PR as well?

  6. asfimport commented on Feb 7, 2020

    @asfimport
    Author

    Walid Gara / @garawalid:
    @gszadovszky

    I absolutely agree with you, we don't need to follow other projects in the Hadoop ecosystem.

    It seems that conf.set better than conf.setStrings.

    Let me know if you need any anything, I'll be happy to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions