Sorry,
I made myself not very clear - I would like to know how to find what clumn is a metric or dimension in any given table.
Once I know that I could run the following SQL to compare pre-post and could setup a batch that runs every night and is screening others table schemas.
thoughts?
SELECT
SUM(SKEWCALC .NUMBEROFROWS) AS TOTALROWS
, MIN(SKEWCALC .NUMBEROFROWS) AS MINROWSONAMP
, MAX(SKEWCALC .NUMBEROFROWS) AS MAXROWSONAMP
, AVG(SKEWCALC .NUMBEROFROWS) AS AVGROWSONAMP
, 100 - ( AVG (SKEWCALC. NUMBEROFROWS)/ MAX (SKEWCALC. NUMBEROFROWS) * 100 ) AS SKEWFACTOR
FROM
(
SELECT
HASHAMP (HASHBUCKET (HASHROW(
[your_PI&your_new_PI]
))) AS AMPNUMBER ,
CAST(COUNT(*) AS DECIMAL(18,0)) AS NUMBEROFROWS
FROM
[your_table_name]
GROUP BY 1
) AS SKEWCALC ;
Sorry,
I made myself not very clear - I would like to know how to find what clumn is a metric or dimension in any given table.
Once I know that I could run the following SQL to compare pre-post and could setup a batch that runs every night and is screening others table schemas.
thoughts?
SELECT
SUM(SKEWCALC .NUMBEROFROWS) AS TOTALROWS
, MIN(SKEWCALC .NUMBEROFROWS) AS MINROWSONAMP
, MAX(SKEWCALC .NUMBEROFROWS) AS MAXROWSONAMP
, AVG(SKEWCALC .NUMBEROFROWS) AS AVGROWSONAMP
, 100 - ( AVG (SKEWCALC. NUMBEROFROWS)/ MAX (SKEWCALC. NUMBEROFROWS) * 100 ) AS SKEWFACTOR
FROM
(
SELECT
HASHAMP (HASHBUCKET (HASHROW(
[your_PI&your_new_PI]
))) AS AMPNUMBER ,
CAST(COUNT(*) AS DECIMAL(18,0)) AS NUMBEROFROWS
FROM
[your_table_name]
GROUP BY 1
) AS SKEWCALC ;