Skip to content

Instantly share code, notes, and snippets.

View boonhapus's full-sized avatar

SN boonhapus

View GitHub Profile
@boonhapus
boonhapus / 00_query_concepts.md
Last active January 8, 2026 15:55
Pendo Data Sync - SQL Query Walkthrough

Understanding Pendo Data Sync - SQL Query Walkthrough

This SQL query serves as an educational example for understanding how Pendo's Data Sync works and how to replicate some simple metrics you see in the Pendo UI using raw event data.

What is Pendo Data Sync?

Pendo Data Sync exports raw event data to your data warehouse (in this case, Snowflake). Unlike the Pendo UI, which automatically applies filters and transformations, Data Sync gives you the unprocessed event stream, meaning you need to understand how to transform it yourself.

At minumum, in order to match the Pendo UI, you need to implement..

@boonhapus
boonhapus / 1_README.md
Last active November 26, 2024 18:17
TS_CUSTOM_CALENDAR_EXPLAINED

ThoughtSpot Custom Calendar

The [Custom Calendar][ccal-docs] feature in ThoughtSpot powers the date keywords. The concepts "yearly", "quarterly", or "weekly" may be skewed (or offset) based on what day determines the start and end boundaries for each of those periods.

This is the ONLY purpose the Custom Calendar feature serves - to provide semantic meaning to DATE and DATE_TIME columns. You cannot use Custom Calendars to encode custom date keywords (eg. Is Holiday = TRUE|FALSE).

When creating a Custom Calendar from a SQL query, the [table DDL must exactly match the names][ccal-schema] and types that ThoughtSpot expects. For this reason, it is advised to create a separate database Table or View in order to isolate these columns.


@boonhapus
boonhapus / PY_UDF_SNOWFLAKE_PARSE_TS_COMMENT_TAG.sql
Last active October 30, 2024 17:58
Parse ThoughtSpot Query comment tag
CREATE OR REPLACE FUNCTION ts_query_tag_comment_json(query STRING)
returns variant not null
language python
runtime_version = '3.8'
handler = 'extract_query_tag_as_json'
AS
$$
from __future__ import annotations
import re