Extract template to filter out special numeric values
This commit is contained in:
parent
6373fe8652
commit
c580600590
@ -51,22 +51,23 @@ var MAX_INTERVAL_VALUE = 366;
|
||||
var BIN_MIN_NUMBER = 6;
|
||||
var BIN_MAX_NUMBER = 48;
|
||||
|
||||
const filterOutSpecialNumericValues = ctx => `
|
||||
${ctx._column} != 'infinity'::float
|
||||
AND
|
||||
${ctx._column} != '-infinity'::float
|
||||
AND
|
||||
${ctx._column} != 'NaN'::float
|
||||
`;
|
||||
|
||||
const filteredQueryTpl = ctx => `
|
||||
__cdb_filtered_source AS (
|
||||
SELECT *
|
||||
FROM (${ctx._query}) __cdb_filtered_source_query
|
||||
WHERE
|
||||
${ctx._column} IS NOT NULL
|
||||
${ctx._isFloatColumn ? `
|
||||
AND
|
||||
${ctx._column} != 'infinity'::float
|
||||
AND
|
||||
${ctx._column} != '-infinity'::float
|
||||
AND
|
||||
${ctx._column} != 'NaN'::float
|
||||
` : ''}
|
||||
WHERE ${ctx._column} IS NOT NULL
|
||||
${ctx._isFloatColumn ? `AND ${filterOutSpecialNumericValues(ctx)}` : ''}
|
||||
)
|
||||
`
|
||||
`;
|
||||
|
||||
var basicsQueryTpl = dot.template([
|
||||
'__cdb_basics AS (',
|
||||
' SELECT',
|
||||
|
Loading…
Reference in New Issue
Block a user