Add metadata parameter for NULL categories
This commit is contained in:
parent
55bf6e86f7
commit
97b4e19777
@ -201,12 +201,17 @@ function _columnStats(ctx, columns) {
|
||||
);
|
||||
if (columns[name].type === 'string') {
|
||||
const topN = ctx.metaOptions.columnStats.topCategories || 1024;
|
||||
let includeNulls = true;
|
||||
if (ctx.metaOptions.columnStats.hasOwnProperty('includeNulls')) {
|
||||
includeNulls = ctx.metaOptions.columnStats.includeNulls;
|
||||
}
|
||||
|
||||
// TODO: ctx.metaOptions.columnStats.maxCategories
|
||||
// => use PG stats to dismiss columns with more distinct values
|
||||
queries.push(
|
||||
queryPromise(
|
||||
ctx.dbConnection,
|
||||
_getSQL(ctx, sql => queryUtils.getQueryTopCategories(sql, name, topN)),
|
||||
_getSQL(ctx, sql => queryUtils.getQueryTopCategories(sql, name, topN, includeNulls)),
|
||||
res => ({ [name]: { categories: res.rows } })
|
||||
)
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user