:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(settings): surface feedback on disabled org save button (#62329)
posthog[bot]313c0ab8ac3f
diff --git a/frontend/src/scenes/settings/organization/OrgDisplayName.tsx b/frontend/src/scenes/settings/organization/OrgDisplayName.tsxindex 38c21a7c8ca8..e8e57f6af4ff 100644--- a/frontend/src/scenes/settings/organization/OrgDisplayName.tsx+++ b/frontend/src/scenes/settings/organization/OrgDisplayName.tsx@@ -38,6 +38,17 @@ export function OrganizationDisplayName(): JSX.Element {const logoChanged = logoMediaId !== (currentOrganization?.logo_media_id || null)const hasChanges = nameChanged || logoChanged+ const saveDisabledReason = restrictionReason+ ? restrictionReason+ : !hasChanges+ ? 'No changes to save'+ : !name+ ? 'You must provide a name'+ : !currentOrganization+ ? 'Organization not loaded'+ : undefined+ const saving = currentOrganizationLoading || uploading+return (<div className="flex gap-6 items-start"><LemonFileInput@@ -86,34 +97,26 @@ export function OrganizationDisplayName(): JSX.Element {data-attr="organization-name-input-settings"placeholder="Organization name"/>- <LemonButton- type="primary"- onClick={(e) => {- e.preventDefault()- const updates: Record<string, unknown> = {}- if (nameChanged) {- updates.name = name- }- if (logoChanged) {- updates.logo_media_id = logoMediaId- }- updateOrganization(updates)- }}- disabledReason={- restrictionReason- ? restrictionReason- : !hasChanges- ? 'No changes to save'- : !name- ? 'You must provide a name'- : !currentOrganization- ? 'Organization not loaded'- : undefined- }- loading={currentOrganizationLoading || uploading}- >- Save- </LemonButton>+ <div className="flex items-center gap-2">+ <LemonButton+ type="primary"+ onClick={(e) => {+ e.preventDefault()+ const updates: Record<string, unknown> = {}+ if (nameChanged) {+ updates.name = name+ }+ if (logoChanged) {+ updates.logo_media_id = logoMediaId+ }+ updateOrganization(updates)+ }}+ disabledReason={saveDisabledReason}+ loading={saving}+ >+ Save+ </LemonButton>+ </div></div></div>)diff --git a/posthog/schema_migrations/__init__.py b/posthog/schema_migrations/__init__.pyindex f8eca29caae3..9b783b546edb 100644--- a/posthog/schema_migrations/__init__.py+++ b/posthog/schema_migrations/__init__.py@@ -36,4 +36,4 @@ def _discover_migrations():LATEST_VERSIONS[kind] = new_version_migrations_discovered = True- logger.info("migrations_discovered", latest_versions={str(k): v for k, v in LATEST_VERSIONS.items()})+ logger.debug("migrations_discovered", latest_versions={str(k): v for k, v in LATEST_VERSIONS.items()})diff --git a/products/product_analytics/backend/hogql_queries/paths/test/__snapshots__/test_paths_query_runner_ee.ambr b/products/product_analytics/backend/hogql_queries/paths/test/__snapshots__/test_paths_query_runner_ee.ambrindex b74d3eaf65cf..806cfa5e8103 100644--- a/products/product_analytics/backend/hogql_queries/paths/test/__snapshots__/test_paths_query_runner_ee.ambr+++ b/products/product_analytics/backend/hogql_queries/paths/test/__snapshots__/test_paths_query_runner_ee.ambr@@ -2946,6 +2946,570 @@use_hive_partitioning=0'''# ---+# name: TestClickhousePaths.test_recording_with_start_and_end+ '''+ SELECT persons.id AS id,+ persons.created_at AS created_at,+ source.event_count AS event_count,+ source.matching_events AS matching_events+ FROM (+ SELECT person_id AS actor_id,+ groupUniqArray(100)(tuple(timestamp, uuid,+ session_id,+ window_id)) AS matching_events,+ count(*) AS event_count+ FROM (+ SELECT person_id AS person_id,+ path AS path,+ conversion_time AS conversion_time,+ event_in_session_index AS event_in_session_index,+ concat(ifNull(toString(event_in_session_index), ''), '_',+ ifNull(toString(path), '')) AS path_key,+ if(ifNull(greater(event_in_session_index,+ 1), 0), concat(ifNull(toString(minus(event_in_session_index,+ 1)), ''), '_',+ ifNull(toString(prev_path), '')), NULL) AS last_path_key,+ path_dropoff_key AS path_dropoff_key,+ final_uuid AS uuid,+ final_timestamp AS timestamp,+ final_session_id AS session_id,+ final_window_id AS window_id+ FROM (+ SELECT person_id AS person_id,+ joined_path_tuple.1 AS path,+ joined_path_tuple.2 AS conversion_time,+ joined_path_tuple.3 AS prev_path,+ event_in_session_index,+ session_index AS session_index,+ arrayPopFront(arrayPushBack(path_basic,+ '')) AS path_basic_0,+ arrayMap((x,+ y) -> if(ifNull(equals(x,+ y), isNull(x)+ and isNull(y)), 0,+ 1), path_basic,+ path_basic_0) AS mapping,+ arrayFilter((x,+ y) -> y,+ time,+ mapping) AS timings,+ arrayFilter((x,+ y) -> y,+ path_basic,+ mapping) AS compact_path,+ indexOf(compact_path,+ '/3') AS target_index,+ joined_path_tuple.4 AS final_uuid,+ joined_path_tuple.5 AS final_timestamp,+ joined_path_tuple.6 AS final_session_id,+ joined_path_tuple.7 AS final_window_id,+ arrayFilter((x,+ y) -> y,+ uuid_items,+ mapping) AS uuid,+ arrayFilter((x,+ y) -> y,+ timestamp_items,+ mapping) AS timestamp,+ arrayFilter((x,+ y) -> y,+ session_id_items,+ mapping) AS session_id,+ arrayFilter((x,+ y) -> y,+ window_id_items,+ mapping) AS window_id,+ indexOf(compact_path,+ '/1') AS start_target_index,+ if(ifNull(greater(start_target_index,+ 0), 0), arraySlice(compact_path,+ start_target_index), compact_path) AS start_filtered_path,+ indexOf(start_filtered_path,+ '/3') AS end_target_index,+ if(ifNull(greater(end_target_index,+ 0), 0), arrayResize(start_filtered_path,+ end_target_index), start_filtered_path) AS filtered_path,+ if(ifNull(greater(length(filtered_path), 5), 0), arrayConcat(arraySlice(filtered_path,+ 1,+ intDiv(5,+ 2)), ['...'],+ arraySlice(filtered_path,+ multiply(-1,+ intDiv(5,+ 2)), intDiv(5,+ 2))), filtered_path) AS limited_path,+ if(ifNull(greater(start_target_index,+ 0), 0), arraySlice(timings,+ start_target_index), timings) AS start_filtered_timings,+ if(ifNull(greater(end_target_index,+ 0), 0), arrayResize(start_filtered_timings,+ end_target_index), start_filtered_timings) AS filtered_timings,+ if(ifNull(greater(length(filtered_timings), 5), 0), arrayConcat(arraySlice(filtered_timings,+ 1,+ intDiv(5,+ 2)), [filtered_timings[plus(1,+ intDiv(5,+ 2))]], arraySlice(filtered_timings,+ multiply(-1,+ intDiv(5,+ 2)), intDiv(5,+ 2))), filtered_timings) AS limited_timings,+ if(ifNull(greater(start_target_index,+ 0), 0), arraySlice(uuid,+ start_target_index), uuid) AS start_filtered_uuid,+ if(ifNull(greater(end_target_index,+ 0), 0), arrayResize(start_filtered_uuid,+ end_target_index), start_filtered_uuid) AS filtered_uuid,+ if(ifNull(greater(length(filtered_uuid), 5), 0), arrayConcat(arraySlice(filtered_uuid,+ 1,+ intDiv(5,+ 2)), [filtered_uuid[plus(1,+ intDiv(5,+ 2))]], arraySlice(filtered_uuid,+ multiply(-1,+ intDiv(5,+ 2)), intDiv(5,+ 2))), filtered_uuid) AS limited_uuid,+ if(ifNull(greater(start_target_index,+ 0), 0), arraySlice(timestamp, start_target_index), timestamp) AS start_filtered_timestamp,+ if(ifNull(greater(end_target_index,+ 0), 0), arrayResize(start_filtered_timestamp,+ end_target_index), start_filtered_timestamp) AS filtered_timestamp,+ if(ifNull(greater(length(filtered_timestamp), 5), 0), arrayConcat(arraySlice(filtered_timestamp,+ 1,+ intDiv(5,+ 2)), [filtered_timestamp[plus(1,+ intDiv(5,+ 2))]], arraySlice(filtered_timestamp,+ multiply(-1,+ intDiv(5,+ 2)), intDiv(5,+ 2))), filtered_timestamp) AS limited_timestamp,+ if(ifNull(greater(start_target_index,+ 0), 0), arraySlice(session_id,+ start_target_index), session_id) AS start_filtered_session_id,+ if(ifNull(greater(end_target_index,+ 0), 0), arrayResize(start_filtered_session_id,+ end_target_index), start_filtered_session_id) AS filtered_session_id,+ if(ifNull(greater(length(filtered_session_id), 5), 0), arrayConcat(arraySlice(filtered_session_id,+ 1,+ intDiv(5,+ 2)), [filtered_session_id[plus(1,+ intDiv(5,+ 2))]], arraySlice(filtered_session_id,+ multiply(-1,+ intDiv(5,+ 2)), intDiv(5,+ 2))), filtered_session_id) AS limited_session_id,+ if(ifNull(greater(start_target_index,+ 0), 0), arraySlice(window_id,+ start_target_index), window_id) AS start_filtered_window_id,+ if(ifNull(greater(end_target_index,+ 0), 0), arrayResize(start_filtered_window_id,+ end_target_index), start_filtered_window_id) AS filtered_window_id,+ if(ifNull(greater(length(filtered_window_id), 5), 0), arrayConcat(arraySlice(filtered_window_id,+ 1,+ intDiv(5,+ 2)), [filtered_window_id[plus(1,+ intDiv(5,+ 2))]], arraySlice(filtered_window_id,+ multiply(-1,+ intDiv(5,+ 2)), intDiv(5,+ 2))), filtered_window_id) AS limited_window_id,+ arrayDifference(limited_timings) AS timings_diff,+ concat(ifNull(toString(length(limited_path)), ''), '_',+ ifNull(toString(limited_path[-1]), '')) AS path_dropoff_key,+ arrayZip(limited_path,+ timings_diff,+ arrayPopBack(arrayPushFront(limited_path,+ '')), limited_uuid,+ limited_timestamp,+ limited_session_id,+ limited_window_id) AS limited_path_timings+ FROM (+ SELECT person_id AS person_id,+ path_time_tuple.1 AS path_basic,+ path_time_tuple.2 AS time,+ session_index,+ arrayZip(path_list,+ timing_list,+ arrayDifference(timing_list), uuid_list,+ timestamp_list,+ session_id_list,+ window_id_list) AS paths_tuple,+ arraySplit(x -> if(ifNull(less(x.3,+ 1800), 0), 0,+ 1), paths_tuple) AS session_paths,+ path_time_tuple.4 AS uuid_items,+ path_time_tuple.5 AS timestamp_items,+ path_time_tuple.6 AS session_id_items,+ path_time_tuple.7 AS window_id_items+ FROM (+ SELECT person_id AS person_id,+ groupArray(timestamp) AS timing_list,+ groupArray(path_item) AS path_list,+ groupArray(uuid) AS uuid_list,+ groupArray(timestamp) AS timestamp_list,+ groupArray(session_id) AS session_id_list,+ groupArray(window_id) AS window_id_list+ FROM (+ SELECT toTimeZone(events.timestamp,+ 'UTC') AS timestamp,+ if(not(empty(events__override.distinct_id)), events__override.person_id,+ events.person_id) AS person_id,+ ifNull(if(equals(events.event,+ '$pageview'), replaceRegexpAll(ifNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties,+ '$current_url'), ''), 'null'), '^"|"$',+ ''), ''), '(.)/$',+ '\\1'), events.event), '') AS path_item_ungrouped,+ events.uuid AS uuid,+ toTimeZone(events.timestamp,+ 'UTC') AS timestamp,+ ifNull(nullIf(nullIf(events.`$session_id`,+ ''), 'null'), '') AS session_id,+ ifNull(nullIf(nullIf(events.`$window_id`,+ ''), 'null'), '') AS window_id,+ NULL AS groupings,+ multiMatchAnyIndex(path_item_ungrouped,+ NULL) AS group_index, (if(ifNull(greater(group_index,+ 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item+ FROM events+ LEFT OUTER JOIN (+ SELECT tupleElement(argMax(tuple(person_distinct_id_overrides.person_id), person_distinct_id_overrides.version), 1) AS person_id,+ person_distinct_id_overrides.distinct_id AS distinct_id+ FROM person_distinct_id_overrides+ WHERE equals(person_distinct_id_overrides.team_id,+ 99999)+ GROUP BY person_distinct_id_overrides.distinct_id+ HAVING equals(tupleElement(argMax(tuple(person_distinct_id_overrides.is_deleted), person_distinct_id_overrides.version), 1), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id,+ events__override.distinct_id)+ WHERE and(equals(events.team_id,+ 99999), and(greaterOrEquals(events.timestamp,+ toStartOfInterval(assumeNotNull(toDateTime('2012-01-01 00:00:00',+ 'UTC')), toIntervalDay(1))), lessOrEquals(events.timestamp,+ assumeNotNull(toDateTime('2012-01-02 23:59:59',+ 'UTC')))), equals(events.event,+ '$pageview'))+ ORDER BY if(not(empty(events__override.distinct_id)), events__override.person_id,+ events.person_id) ASC, toTimeZone(events.timestamp,+ 'UTC') ASC)+ GROUP BY person_id) ARRAY+ JOIN session_paths AS path_time_tuple,+ arrayEnumerate(session_paths) AS session_index) ARRAY+ JOIN limited_path_timings AS joined_path_tuple,+ arrayEnumerate(limited_path_timings) AS event_in_session_index+ WHERE and(ifNull(greater(start_target_index,+ 0), 0), ifNull(greater(end_target_index,+ 0), 0)))) WHERE equals(path_key,+ '2_/2')+ GROUP BY person_id) AS source+ INNER JOIN (+ SELECT tupleElement(argMax(tuple(toTimeZone(person.created_at,+ 'UTC')), person.version), 1) AS created_at,+ person.id AS id+ FROM person+ WHERE and(equals(person.team_id,+ 99999), in(id, (+ SELECT source.actor_id AS actor_id+ FROM (+ SELECT person_id AS actor_id,+ groupUniqArray(100)(tuple(timestamp, uuid,+ session_id,+ window_id)) AS matching_events,+ count(*) AS event_count+ FROM (+ SELECT person_id AS person_id,+ path AS path,+ conversion_time AS conversion_time,+ event_in_session_index AS event_in_session_index,+ concat(ifNull(toString(event_in_session_index), ''), '_',+ ifNull(toString(path), '')) AS path_key,+ if(ifNull(greater(event_in_session_index,+ 1), 0), concat(ifNull(toString(minus(event_in_session_index,+ 1)), ''), '_',+ ifNull(toString(prev_path), '')), NULL) AS last_path_key,+ path_dropoff_key AS path_dropoff_key,+ final_uuid AS uuid,+ final_timestamp AS timestamp,+ final_session_id AS session_id,+ final_window_id AS window_id+ FROM (+ SELECT person_id AS person_id,+ joined_path_tuple.1 AS path,+ joined_path_tuple.2 AS conversion_time,+ joined_path_tuple.3 AS prev_path,+ event_in_session_index,+ session_index AS session_index,+ arrayPopFront(arrayPushBack(path_basic,+ '')) AS path_basic_0,+ arrayMap((x,+ y) -> if(ifNull(equals(x,+ y), isNull(x)+ and isNull(y)), 0,+ 1), path_basic,+ path_basic_0) AS mapping,+ arrayFilter((x,+ y) -> y,+ time,+ mapping) AS timings,+ arrayFilter((x,+ y) -> y,+ path_basic,+ mapping) AS compact_path,+ indexOf(compact_path,+ '/3') AS target_index,+ joined_path_tuple.4 AS final_uuid,+ joined_path_tuple.5 AS final_timestamp,+ joined_path_tuple.6 AS final_session_id,+ joined_path_tuple.7 AS final_window_id,+ arrayFilter((x,+ y) -> y,+ uuid_items,+ mapping) AS uuid,+ arrayFilter((x,+ y) -> y,+ timestamp_items,+ mapping) AS timestamp,+ arrayFilter((x,+ y) -> y,+ session_id_items,+ mapping) AS session_id,+ arrayFilter((x,+ y) -> y,+ window_id_items,+ mapping) AS window_id,+ indexOf(compact_path,+ '/1') AS start_target_index,+ if(ifNull(greater(start_target_index,+ 0), 0), arraySlice(compact_path,+ start_target_index), compact_path) AS start_filtered_path,+ indexOf(start_filtered_path,+ '/3') AS end_target_index,+ if(ifNull(greater(end_target_index,+ 0), 0), arrayResize(start_filtered_path,+ end_target_index), start_filtered_path) AS filtered_path,+ if(ifNull(greater(length(filtered_path), 5), 0), arrayConcat(arraySlice(filtered_path,+ 1,+ intDiv(5,+ 2)), ['...'],+ arraySlice(filtered_path,+ multiply(-1,+ intDiv(5,+ 2)), intDiv(5,+ 2))), filtered_path) AS limited_path,+ if(ifNull(greater(start_target_index,+ 0), 0), arraySlice(timings,+ start_target_index), timings) AS start_filtered_timings,+ if(ifNull(greater(end_target_index,+ 0), 0), arrayResize(start_filtered_timings,+ end_target_index), start_filtered_timings) AS filtered_timings,+ if(ifNull(greater(length(filtered_timings), 5), 0), arrayConcat(arraySlice(filtered_timings,+ 1,+ intDiv(5,+ 2)), [filtered_timings[plus(1,+ intDiv(5,+ 2))]], arraySlice(filtered_timings,+ multiply(-1,+ intDiv(5,+ 2)), intDiv(5,+ 2))), filtered_timings) AS limited_timings,+ if(ifNull(greater(start_target_index,+ 0), 0), arraySlice(uuid,+ start_target_index), uuid) AS start_filtered_uuid,+ if(ifNull(greater(end_target_index,+ 0), 0), arrayResize(start_filtered_uuid,+ end_target_index), start_filtered_uuid) AS filtered_uuid,+ if(ifNull(greater(length(filtered_uuid), 5), 0), arrayConcat(arraySlice(filtered_uuid,+ 1,+ intDiv(5,+ 2)), [filtered_uuid[plus(1,+ intDiv(5,+ 2))]], arraySlice(filtered_uuid,+ multiply(-1,+ intDiv(5,+ 2)), intDiv(5,+ 2))), filtered_uuid) AS limited_uuid,+ if(ifNull(greater(start_target_index,+ 0), 0), arraySlice(timestamp, start_target_index), timestamp) AS start_filtered_timestamp,+ if(ifNull(greater(end_target_index,+ 0), 0), arrayResize(start_filtered_timestamp,+ end_target_index), start_filtered_timestamp) AS filtered_timestamp,+ if(ifNull(greater(length(filtered_timestamp), 5), 0), arrayConcat(arraySlice(filtered_timestamp,+ 1,+ intDiv(5,+ 2)), [filtered_timestamp[plus(1,+ intDiv(5,+ 2))]], arraySlice(filtered_timestamp,+ multiply(-1,+ intDiv(5,+ 2)), intDiv(5,+ 2))), filtered_timestamp) AS limited_timestamp,+ if(ifNull(greater(start_target_index,+ 0), 0), arraySlice(session_id,+ start_target_index), session_id) AS start_filtered_session_id,+ if(ifNull(greater(end_target_index,+ 0), 0), arrayResize(start_filtered_session_id,+ end_target_index), start_filtered_session_id) AS filtered_session_id,+ if(ifNull(greater(length(filtered_session_id), 5), 0), arrayConcat(arraySlice(filtered_session_id,+ 1,+ intDiv(5,+ 2)), [filtered_session_id[plus(1,+ intDiv(5,+ 2))]], arraySlice(filtered_session_id,+ multiply(-1,+ intDiv(5,+ 2)), intDiv(5,+ 2))), filtered_session_id) AS limited_session_id,+ if(ifNull(greater(start_target_index,+ 0), 0), arraySlice(window_id,+ start_target_index), window_id) AS start_filtered_window_id,+ if(ifNull(greater(end_target_index,+ 0), 0), arrayResize(start_filtered_window_id,+ end_target_index), start_filtered_window_id) AS filtered_window_id,+ if(ifNull(greater(length(filtered_window_id), 5), 0), arrayConcat(arraySlice(filtered_window_id,+ 1,+ intDiv(5,+ 2)), [filtered_window_id[plus(1,+ intDiv(5,+ 2))]], arraySlice(filtered_window_id,+ multiply(-1,+ intDiv(5,+ 2)), intDiv(5,+ 2))), filtered_window_id) AS limited_window_id,+ arrayDifference(limited_timings) AS timings_diff,+ concat(ifNull(toString(length(limited_path)), ''), '_',+ ifNull(toString(limited_path[-1]), '')) AS path_dropoff_key,+ arrayZip(limited_path,+ timings_diff,+ arrayPopBack(arrayPushFront(limited_path,+ '')), limited_uuid,+ limited_timestamp,+ limited_session_id,+ limited_window_id) AS limited_path_timings+ FROM (+ SELECT person_id AS person_id,+ path_time_tuple.1 AS path_basic,+ path_time_tuple.2 AS time,+ session_index,+ arrayZip(path_list,+ timing_list,+ arrayDifference(timing_list), uuid_list,+ timestamp_list,+ session_id_list,+ window_id_list) AS paths_tuple,+ arraySplit(x -> if(ifNull(less(x.3,+ 1800), 0), 0,+ 1), paths_tuple) AS session_paths,+ path_time_tuple.4 AS uuid_items,+ path_time_tuple.5 AS timestamp_items,+ path_time_tuple.6 AS session_id_items,+ path_time_tuple.7 AS window_id_items+ FROM (+ SELECT person_id AS person_id,+ groupArray(timestamp) AS timing_list,+ groupArray(path_item) AS path_list,+ groupArray(uuid) AS uuid_list,+ groupArray(timestamp) AS timestamp_list,+ groupArray(session_id) AS session_id_list,+ groupArray(window_id) AS window_id_list+ FROM (+ SELECT toTimeZone(events.timestamp,+ 'UTC') AS timestamp,+ if(not(empty(events__override.distinct_id)), events__override.person_id,+ events.person_id) AS person_id,+ ifNull(if(equals(events.event,+ '$pageview'), replaceRegexpAll(ifNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties,+ '$current_url'), ''), 'null'), '^"|"$',+ ''), ''), '(.)/$',+ '\\1'), events.event), '') AS path_item_ungrouped,+ events.uuid AS uuid,+ toTimeZone(events.timestamp,+ 'UTC') AS timestamp,+ ifNull(nullIf(nullIf(events.`$session_id`,+ ''), 'null'), '') AS session_id,+ ifNull(nullIf(nullIf(events.`$window_id`,+ ''), 'null'), '') AS window_id,+ NULL AS groupings,+ multiMatchAnyIndex(path_item_ungrouped,+ NULL) AS group_index, (if(ifNull(greater(group_index,+ 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item+ FROM events+ LEFT OUTER JOIN (+ SELECT tupleElement(argMax(tuple(person_distinct_id_overrides.person_id), person_distinct_id_overrides.version), 1) AS person_id,+ person_distinct_id_overrides.distinct_id AS distinct_id+ FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id,+ 99999)+ GROUP BY person_distinct_id_overrides.distinct_id+ HAVING equals(tupleElement(argMax(tuple(person_distinct_id_overrides.is_deleted), person_distinct_id_overrides.version), 1), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id,+ events__override.distinct_id)+ WHERE and(equals(events.team_id,+ 99999), and(greaterOrEquals(events.timestamp,+ toStartOfInterval(assumeNotNull(toDateTime('2012-01-01 00:00:00',+ 'UTC')), toIntervalDay(1))), lessOrEquals(events.timestamp,+ assumeNotNull(toDateTime('2012-01-02 23:59:59',+ 'UTC')))), equals(events.event,+ '$pageview'))+ ORDER BY if(not(empty(events__override.distinct_id)), events__override.person_id,+ events.person_id) ASC, toTimeZone(events.timestamp,+ 'UTC') ASC)+ GROUP BY person_id) ARRAY+ JOIN session_paths AS path_time_tuple,+ arrayEnumerate(session_paths) AS session_index) ARRAY+ JOIN limited_path_timings AS joined_path_tuple,+ arrayEnumerate(limited_path_timings) AS event_in_session_index+ WHERE and(ifNull(greater(start_target_index,+ 0), 0), ifNull(greater(end_target_index,+ 0), 0)))) WHERE equals(path_key,+ '2_/2')+ GROUP BY person_id) AS source)))+ GROUP BY person.id+ HAVING and(equals(tupleElement(argMax(tuple(person.is_deleted), person.version), 1), 0), less(tupleElement(argMax(tuple(toTimeZone(person.created_at,+ 'UTC')), person.version), 1), plus(now64(6,+ 'UTC'), toIntervalDay(1)))) SETTINGS optimize_aggregation_in_order=1) AS persons ON equals(persons.id,+ source.actor_id)+ ORDER BY persons.id ASC+ LIMIT 101+ OFFSET 0 SETTINGS optimize_aggregation_in_order=1,+ join_algorithm='auto',+ readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0+ '''+# ---+# name: TestClickhousePaths.test_recording_with_start_and_end.1+ '''+ SELECT session_replay_events.session_id AS session_id,+ min(toTimeZone(session_replay_events.min_first_timestamp, 'UTC')) AS start_time,+ max(session_replay_events.retention_period_days) AS retention_period_days,+ plus(dateTrunc('DAY', start_time), toIntervalDay(coalesce(retention_period_days, 30))) AS expiry_time+ FROM session_replay_events+ WHERE and(equals(session_replay_events.team_id, 99999), in(session_replay_events.session_id, ['s1']))+ GROUP BY session_replay_events.session_id+ HAVING and(greaterOrEquals(expiry_time, toDateTime64('2012-01-01 03:21:34.000000', 6, 'UTC')), equals(max(session_replay_events.is_deleted), 0))+ LIMIT 100 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0+ '''+# ---# name: TestClickhousePaths.test_respect_session_limits'''SELECT last_path_key AS source_event,