|
98 | 98 | e.step_1 AS step_1 |
99 | 99 | FROM |
100 | 100 | (SELECT toTimeZone(e.timestamp, 'UTC') AS timestamp, |
101 | | - if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id) AS aggregation_target, |
| 101 | + toString(if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id)) AS aggregation_target, |
102 | 102 | e.uuid AS uuid, |
103 | 103 | e.`$session_id` AS `$session_id`, |
104 | 104 | e.`$window_id` AS `$window_id`, |
|
114 | 114 | HAVING ifNull(equals(tupleElement(argMax(tuple(person_distinct_id_overrides.is_deleted), person_distinct_id_overrides.version), 1), 0), 0) SETTINGS optimize_aggregation_in_order=1) AS e__override ON equals(e.distinct_id, e__override.distinct_id) |
115 | 115 | WHERE and(equals(e.team_id, 99999), and(and(greaterOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), in(e.event, tuple('$pageview'))), ifNull(equals(step_0, 1), 0)) |
116 | 116 | UNION ALL SELECT toTimeZone(e.created, 'UTC') AS timestamp, |
117 | | - accurateCastOrNull(e.user_id, 'UUID') AS aggregation_target, |
| 117 | + toString(accurateCastOrNull(e.user_id, 'UUID')) AS aggregation_target, |
118 | 118 | tupleElement(tuple(throwIf(isNull(e.uuid), 'Encountered a null value in posthog_test_test_table_1.uuid, but a non-null value is required. Please ensure this column contains no null values, or add a filter to exclude rows with null values.'), toUUIDOrDefault(toString(e.uuid), reinterpretAsUUID(hex(MD5(concat('posthog_test_test_table_1_0_', ifNull(toString(e.uuid), ''))))))), 2) AS uuid, |
119 | 119 | NULL AS `$session_id`, |
120 | 120 | NULL AS `$window_id`, |
|
372 | 372 | e.step_2 AS step_2 |
373 | 373 | FROM |
374 | 374 | (SELECT toTimeZone(e.created_date, 'UTC') AS timestamp, |
375 | | - coalesce(e.converted_opportunity_id, e.id) AS aggregation_target, |
| 375 | + toString(coalesce(e.converted_opportunity_id, e.id)) AS aggregation_target, |
376 | 376 | tupleElement(tuple(throwIf(isNull(e.id), 'Encountered a null value in posthog_test_salesforce_lead.id, but a non-null value is required. Please ensure this column contains no null values, or add a filter to exclude rows with null values.'), toUUIDOrDefault(toString(e.id), reinterpretAsUUID(hex(MD5(concat('posthog_test_salesforce_lead_0_', ifNull(toString(e.id), ''))))))), 2) AS uuid, |
377 | 377 | NULL AS `$session_id`, |
378 | 378 | NULL AS `$window_id`, |
|
382 | 382 | FROM s3('http://host.docker.internal:19000/posthog/test_storage_bucket-posthog.hogql_queries.insights.funnels.funnel_data_warehouse/posthog_test_salesforce_lead/*.csv', 'object_storage_root_user', 'object_storage_root_password', 'CSVWithNames', '`id` String, `created_date` DateTime64(3, \'UTC\'), `converted_opportunity_id` Nullable(String)') AS e |
383 | 383 | WHERE and(and(greaterOrEquals(timestamp, toDateTime64('2024-05-01 00:00:00.000000', 6, 'UTC')), lessOrEquals(timestamp, toDateTime64('2024-06-30 23:59:59.999999', 6, 'UTC'))), ifNull(equals(step_0, 1), 0)) |
384 | 384 | UNION ALL SELECT toTimeZone(e.created_date, 'UTC') AS timestamp, |
385 | | - e.id AS aggregation_target, |
| 385 | + toString(e.id) AS aggregation_target, |
386 | 386 | tupleElement(tuple(throwIf(isNull(e.id), 'Encountered a null value in posthog_test_salesforce_opportunity.id, but a non-null value is required. Please ensure this column contains no null values, or add a filter to exclude rows with null values.'), toUUIDOrDefault(toString(e.id), reinterpretAsUUID(hex(MD5(concat('posthog_test_salesforce_opportunity_1_', ifNull(toString(e.id), ''))))))), 2) AS uuid, |
387 | 387 | NULL AS `$session_id`, |
388 | 388 | NULL AS `$window_id`, |
|
392 | 392 | FROM s3('http://host.docker.internal:19000/posthog/test_storage_bucket-posthog.hogql_queries.insights.funnels.funnel_data_warehouse/posthog_test_salesforce_opportunity/*.csv', 'object_storage_root_user', 'object_storage_root_password', 'CSVWithNames', '`id` String, `close_date` Nullable(Date), `created_date` DateTime64(3, \'UTC\')') AS e |
393 | 393 | WHERE and(and(greaterOrEquals(timestamp, toDateTime64('2024-05-01 00:00:00.000000', 6, 'UTC')), lessOrEquals(timestamp, toDateTime64('2024-06-30 23:59:59.999999', 6, 'UTC'))), ifNull(equals(step_1, 1), 0)) |
394 | 394 | UNION ALL SELECT e.close_date AS timestamp, |
395 | | - e.id AS aggregation_target, |
| 395 | + toString(e.id) AS aggregation_target, |
396 | 396 | tupleElement(tuple(throwIf(isNull(e.id), 'Encountered a null value in posthog_test_salesforce_opportunity.id, but a non-null value is required. Please ensure this column contains no null values, or add a filter to exclude rows with null values.'), toUUIDOrDefault(toString(e.id), reinterpretAsUUID(hex(MD5(concat('posthog_test_salesforce_opportunity_2_', ifNull(toString(e.id), ''))))))), 2) AS uuid, |
397 | 397 | NULL AS `$session_id`, |
398 | 398 | NULL AS `$window_id`, |
|
0 commit comments