You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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
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 defaultconf.set("parquet.bloom.filter.enabled#content", true); // Might not be necessary as by setting the expected ndv you explicitly sets this oneconf.set("parquet.bloom.filter.enabled#line", true); // Might not be necessary as by setting the expected ndv you explicitly sets this oneconf.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.
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.
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?
Activity
asfimport commentedon Feb 5, 2020
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.
asfimport commentedon Feb 5, 2020
Walid Gara / @garawalid:
I think it's a good idea. We can think also of using * to mention all columns.
Example:
asfimport commentedon Feb 6, 2020
Gabor Szadovszky / @gszadovszky:
@garawalid,
The idea is to use a "root" key for the configuration and add a specific
#column.pathsuffix to the key to set the configuration for the related column only. So, to turn the bloom filters on for all the columns would beand to turn it off for a specific column:
asfimport commentedon Feb 6, 2020
Walid Gara / @garawalid:
@gszadovszky
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.
asfimport commentedon Feb 7, 2020
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.
Or, we use the pattern described in this jira:
I think, the latter is cleaner and less error prone. Moreover,
org.apache.hadoop.conf.Configurationonly gives support for string lists while in the latter case you can use any value type supported byorg.apache.hadoop.conf.Configurationin a clean way.What do you think? If you have time, you may also like to check my PR as well?
asfimport commentedon Feb 7, 2020
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.