Skip to content

Commit c462cc9

Browse files
committed
Merge branch 'main' into feat/pcc-sync-CM-1086-CM-1087-CM-1088-CM-1089
2 parents ad1fb1b + a456787 commit c462cc9

60 files changed

Lines changed: 3636 additions & 169 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/skills/scaffold-snowflake-connector/SKILL.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ After Step 1 and/or Step 2, build a column registry per table:
196196

197197
**Store this as the canonical column reference. Every column name used in generated code must appear in this registry. Never assume or invent a column name.**
198198

199+
**Flag non-VARCHAR column types** (e.g., `DATE`, `TIME`, `TIMESTAMP_TZ`, `BOOLEAN`, `NUMBER`) — these arrive as native JS types from the Parquet reader, not strings (see touch point 9 rules).
200+
199201
For each JOIN table, check whether any existing transformer in `services/apps/snowflake_connectors/src/integrations/` queries from the same table. If yes, inherit its column mappings; if no, treat every column as unknown and derive it from sample data in the Pre-Analysis step below.
200202

201203
### Step 3 — Sample data
@@ -342,7 +344,10 @@ After all identity fields are confirmed, summarize how `buildMemberIdentities()`
342344
343345
### 3b. Organization Mapping
344346
345-
If Pre-Analysis determined there is no org data (no org-related columns found in any table), confirm: "I don't see any organization columns in the schema. Does this source have org/company data?" — if yes, proceed; if no, skip to 3c.
347+
If Pre-Analysis determined there is no org data (no org-related columns found in any table): before asking the user, first read existing transformers in `services/apps/snowflake_connectors/src/integrations/` to check whether any of them join an org table using a key that also exists in the user's tables. If a match is found, prompt the user:
348+
> "I don't see org columns in the tables you provided, but [EXISTING_PLATFORM] sources org data from `{ORG_TABLE}` via `{join_key}` — which also appears in your table. Did you mean to include this? (Recommended)"
349+
350+
If no existing pattern is joinable, ask: "I don't see any org columns. Does this source have org/company data?" — if yes, ask for the table; if no, skip to 3c.
346351
347352
If Pre-Analysis identified org columns:
348353
@@ -565,6 +570,7 @@ File: `services/apps/snowflake_connectors/src/integrations/{platform}/{source}/b
565570
**Rules (enforced — do not deviate):**
566571
- Use explicit column names only. Do not use `table.*` or `table.* EXCLUDE (...)` in new implementations — existing sources (TNC, CVENT) use these patterns but new sources should list columns explicitly to avoid parquet encoding/decoding issues
567572
- If any TIMESTAMP_TZ columns exist in the schema, exclude and re-cast them as TIMESTAMP_NTZ (see CVENT pattern)
573+
- Do not concatenate or transform date/time columns in SQL — keep them as separate columns and let the transformer handle type coercion (see touch point 9 rules)
568574
- Follow the CTE structure:
569575
1. `org_accounts` CTE (if org data present)
570576
2. `CDP_MATCHED_SEGMENTS` CTE (always)
@@ -585,6 +591,8 @@ Show the full generated file and ask for confirmation before writing.
585591
File: `services/apps/snowflake_connectors/src/integrations/{platform}/{source}/transformer.ts`
586592

587593
**Rules (enforced — do not deviate):**
594+
595+
- **Parquet type coercion — never blindly cast `row.COLUMN as string`.** Snowflake types may arrive as native JS types after Parquet decoding (e.g., `DATE``Date` object, `TIME``number` in ms, `BOOLEAN``boolean`). Always check the Snowflake column type from the schema registry and handle the actual JS type the Parquet reader delivers — do not assume every column is a string.
588596
- All string comparisons must be case-insensitive: use `.toLowerCase()` on both sides of comparison only; preserve the original value in the output
589597
- No broad `else` statements — every branch must have an explicit condition
590598
- All column names referenced in code must exactly match the schema registry — never assumed

backend/src/database/migrations/U1775219382__addMeetingsActivityTypes.sql

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
INSERT INTO "activityTypes" ("activityType", platform, "isCodeContribution", "isCollaboration", description, "label") VALUES
2+
('invited-meeting', 'meetings', false, false, 'User is invited to a meeting', 'Invited to a meeting'),
3+
('attended-meeting', 'meetings', false, false, 'User attends a meeting', 'Attended a meeting');

0 commit comments

Comments
 (0)