Skip to content

Commit d22c3e2

Browse files
authored
fix: day_diff data type missmatch (#1485)
1 parent 5e24ba4 commit d22c3e2

File tree

4 files changed

+3179
-3346
lines changed

4 files changed

+3179
-3346
lines changed

src/reporting/private/template-def-spice.json

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@
967967
},
968968
{
969969
"Name": "day_diff",
970-
"DataType": "INTEGER"
970+
"DataType": "STRING"
971971
},
972972
{
973973
"Name": "total_users",
@@ -7395,7 +7395,7 @@
73957395
],
73967396
"Colors": [
73977397
{
7398-
"NumericalDimensionField": {
7398+
"CategoricalDimensionField": {
73997399
"FieldId": "LogicalTable1.day_diff.2.1715343040286",
74007400
"Column": {
74017401
"DataSetIdentifier": "Retention_View",
@@ -7962,30 +7962,11 @@
79627962
"LineChartAggregatedFieldWells": {
79637963
"Category": [
79647964
{
7965-
"NumericalDimensionField": {
7965+
"CategoricalDimensionField": {
79667966
"FieldId": "LogicalTable1.day_diff.0.1711696674313",
79677967
"Column": {
79687968
"DataSetIdentifier": "Retention_View",
79697969
"ColumnName": "day_diff"
7970-
},
7971-
"FormatConfiguration": {
7972-
"FormatConfiguration": {
7973-
"NumberDisplayFormatConfiguration": {
7974-
"SeparatorConfiguration": {
7975-
"DecimalSeparator": "DOT",
7976-
"ThousandsSeparator": {
7977-
"Symbol": "COMMA",
7978-
"Visibility": "VISIBLE"
7979-
}
7980-
},
7981-
"NegativeValueConfiguration": {
7982-
"DisplayMode": "NEGATIVE"
7983-
},
7984-
"NullValueFormatConfiguration": {
7985-
"NullString": "null"
7986-
}
7987-
}
7988-
}
79897970
}
79907971
}
79917972
}
@@ -12502,8 +12483,8 @@
1250212483
"CustomFilterListConfiguration": {
1250312484
"MatchOperator": "CONTAINS",
1250412485
"CategoryValues": [
12505-
"1",
12506-
"7"
12486+
" 1",
12487+
" 7"
1250712488
],
1250812489
"NullOption": "NON_NULLS_ONLY"
1250912490
}

src/reporting/private/template-def.json

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@
968968
},
969969
{
970970
"Name": "day_diff",
971-
"DataType": "INTEGER"
971+
"DataType": "STRING"
972972
},
973973
{
974974
"Name": "total_users",
@@ -7398,7 +7398,7 @@
73987398
],
73997399
"Colors": [
74007400
{
7401-
"NumericalDimensionField": {
7401+
"CategoricalDimensionField": {
74027402
"FieldId": "LogicalTable1.day_diff.2.1715343040286",
74037403
"Column": {
74047404
"DataSetIdentifier": "Retention_View",
@@ -7965,31 +7965,13 @@
79657965
"LineChartAggregatedFieldWells": {
79667966
"Category": [
79677967
{
7968-
"NumericalDimensionField": {
7968+
"CategoricalDimensionField": {
79697969
"FieldId": "LogicalTable1.day_diff.0.1711696674313",
79707970
"Column": {
79717971
"DataSetIdentifier": "Retention_View",
79727972
"ColumnName": "day_diff"
7973-
},
7974-
"FormatConfiguration": {
7975-
"FormatConfiguration": {
7976-
"NumberDisplayFormatConfiguration": {
7977-
"SeparatorConfiguration": {
7978-
"DecimalSeparator": "DOT",
7979-
"ThousandsSeparator": {
7980-
"Symbol": "COMMA",
7981-
"Visibility": "VISIBLE"
7982-
}
7983-
},
7984-
"NegativeValueConfiguration": {
7985-
"DisplayMode": "NEGATIVE"
7986-
},
7987-
"NullValueFormatConfiguration": {
7988-
"NullString": "null"
7989-
}
7990-
}
7991-
}
79927973
}
7974+
79937975
}
79947976
}
79957977
],
@@ -12660,8 +12642,8 @@
1266012642
"CustomFilterListConfiguration": {
1266112643
"MatchOperator": "CONTAINS",
1266212644
"CategoryValues": [
12663-
"1",
12664-
"7"
12645+
" 1",
12646+
" 7"
1266512647
],
1266612648
"NullOption": "NON_NULLS_ONLY"
1266712649
}

src/reporting/quicksight-custom-resource.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,15 @@ function _getDataSetDefs(
790790
tableName: CLICKSTREAM_RETENTION_VIEW_NAME_PLACEHOLDER,
791791
useSpice: 'yes',
792792
lookbackColumn: 'first_date',
793-
customSql: `SELECT * FROM {{schema}}.${CLICKSTREAM_RETENTION_VIEW_NAME} `,
793+
customSql: `
794+
SELECT
795+
platform,
796+
first_date,
797+
LPAD(day_diff::varchar, 4, ' ') as day_diff,
798+
returned_user_count,
799+
total_users
800+
FROM {{schema}}.${CLICKSTREAM_RETENTION_VIEW_NAME}
801+
`,
794802
columns: [
795803
{
796804
Name: 'platform',
@@ -802,7 +810,7 @@ function _getDataSetDefs(
802810
},
803811
{
804812
Name: 'day_diff',
805-
Type: 'INTEGER',
813+
Type: 'STRING',
806814
},
807815
{
808816
Name: 'returned_user_count',
@@ -1690,7 +1698,14 @@ function _getDataSetDefs(
16901698
{
16911699
tableName: CLICKSTREAM_RETENTION_VIEW_NAME_PLACEHOLDER,
16921700
useSpice: 'no',
1693-
customSql: `SELECT * FROM {{schema}}.${CLICKSTREAM_RETENTION_VIEW_NAME} where first_date >= <<$startDate19>> and first_date < DATEADD(DAY, 1, date_trunc('day', <<$endDate19>>))`,
1701+
customSql: `
1702+
SELECT
1703+
platform,
1704+
first_date,
1705+
LPAD(day_diff::varchar, 4, ' ') as day_diff,
1706+
returned_user_count,
1707+
total_users
1708+
FROM {{schema}}.${CLICKSTREAM_RETENTION_VIEW_NAME} where first_date >= <<$startDate19>> and first_date < DATEADD(DAY, 1, date_trunc('day', <<$endDate19>>))`,
16941709
columns: [
16951710
{
16961711
Name: 'platform',
@@ -1702,7 +1717,7 @@ function _getDataSetDefs(
17021717
},
17031718
{
17041719
Name: 'day_diff',
1705-
Type: 'INTEGER',
1720+
Type: 'STRING',
17061721
},
17071722
{
17081723
Name: 'returned_user_count',

0 commit comments

Comments
 (0)