@devrev/meerkat-node 0.0.104 → 0.0.106

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1185,7 +1185,9 @@ const TEST_DATA = [
1185
1185
  [
1186
1186
  {
1187
1187
  testName: 'In',
1188
- expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, vendors AS orders__vendors, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__customer_id IN ('1', '2')) AND (orders__vendors && (ARRAY['myntra', 'amazon'])))`,
1188
+ // customer_id is string type -> uses optimized string_split
1189
+ // vendors is string_array type -> uses ARRAY overlap &&
1190
+ expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, vendors AS orders__vendors, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__customer_id = ANY(SELECT unnest(string_split('1§‡¶2', '§‡¶')))) AND (orders__vendors && (ARRAY['myntra', 'amazon'])))`,
1189
1191
  cubeInput: {
1190
1192
  measures: [
1191
1193
  '*'
@@ -1251,6 +1253,63 @@ const TEST_DATA = [
1251
1253
  }
1252
1254
  ]
1253
1255
  },
1256
+ {
1257
+ testName: 'In with numeric type (optimized with CAST)',
1258
+ // order_id is number type -> uses optimized string_split with CAST to DOUBLE
1259
+ expectedSQL: `SELECT orders.* FROM (SELECT order_id AS orders__order_id, * FROM (select * from orders) AS orders) AS orders WHERE (orders__order_id = ANY(SELECT CAST(unnest(string_split('1§‡¶2§‡¶3', '§‡¶')) AS DOUBLE)))`,
1260
+ cubeInput: {
1261
+ measures: [
1262
+ '*'
1263
+ ],
1264
+ filters: [
1265
+ {
1266
+ member: 'orders.order_id',
1267
+ operator: 'in',
1268
+ values: [
1269
+ 1,
1270
+ 2,
1271
+ 3
1272
+ ]
1273
+ }
1274
+ ],
1275
+ dimensions: []
1276
+ },
1277
+ expectedOutput: [
1278
+ {
1279
+ order_id: 1,
1280
+ customer_id: '1',
1281
+ product_id: '1',
1282
+ order_date: '2022-01-01',
1283
+ order_amount: 50.0,
1284
+ orders__order_id: 1,
1285
+ vendors: [
1286
+ 'myntra',
1287
+ 'amazon',
1288
+ 'flipkart'
1289
+ ]
1290
+ },
1291
+ {
1292
+ order_id: 2,
1293
+ customer_id: '1',
1294
+ product_id: '2',
1295
+ order_date: '2022-01-02',
1296
+ order_amount: 80.0,
1297
+ orders__order_id: 2,
1298
+ vendors: [
1299
+ 'myntra'
1300
+ ]
1301
+ },
1302
+ {
1303
+ order_id: 3,
1304
+ customer_id: '2',
1305
+ product_id: '3',
1306
+ order_date: '2022-02-01',
1307
+ order_amount: 25.0,
1308
+ orders__order_id: 3,
1309
+ vendors: []
1310
+ }
1311
+ ]
1312
+ },
1254
1313
  {
1255
1314
  testName: 'In with single quotes',
1256
1315
  expectedSQL: `SELECT orders.* FROM (SELECT vendors AS orders__vendors, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__vendors && (ARRAY['swiggy''s'])))`,
@@ -1289,12 +1348,101 @@ const TEST_DATA = [
1289
1348
  ]
1290
1349
  }
1291
1350
  ]
1351
+ },
1352
+ {
1353
+ testName: 'Multiple In filters combined (customer_id, product_id, order_id)',
1354
+ // Tests all three optimized filters working together
1355
+ // customer_id (string), product_id (string), order_id (number with CAST)
1356
+ expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, product_id AS orders__product_id, order_id AS orders__order_id, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__customer_id = ANY(SELECT unnest(string_split('1§‡¶2', '§‡¶')))) AND (orders__product_id = ANY(SELECT unnest(string_split('1§‡¶2', '§‡¶')))) AND (orders__order_id = ANY(SELECT CAST(unnest(string_split('1§‡¶2§‡¶3§‡¶4', '§‡¶')) AS DOUBLE))))`,
1357
+ cubeInput: {
1358
+ measures: [
1359
+ '*'
1360
+ ],
1361
+ filters: [
1362
+ {
1363
+ and: [
1364
+ {
1365
+ member: 'orders.customer_id',
1366
+ operator: 'in',
1367
+ values: [
1368
+ '1',
1369
+ '2'
1370
+ ]
1371
+ },
1372
+ {
1373
+ member: 'orders.product_id',
1374
+ operator: 'in',
1375
+ values: [
1376
+ '1',
1377
+ '2'
1378
+ ]
1379
+ },
1380
+ {
1381
+ member: 'orders.order_id',
1382
+ operator: 'in',
1383
+ values: [
1384
+ 1,
1385
+ 2,
1386
+ 3,
1387
+ 4
1388
+ ]
1389
+ }
1390
+ ]
1391
+ }
1392
+ ],
1393
+ dimensions: []
1394
+ },
1395
+ expectedOutput: [
1396
+ {
1397
+ order_id: 4,
1398
+ customer_id: '2',
1399
+ product_id: '1',
1400
+ order_date: '2022-03-01',
1401
+ order_amount: 75.0,
1402
+ orders__customer_id: '2',
1403
+ orders__product_id: '1',
1404
+ orders__order_id: 4,
1405
+ vendors: [
1406
+ 'flipkart'
1407
+ ]
1408
+ },
1409
+ {
1410
+ order_id: 2,
1411
+ customer_id: '1',
1412
+ product_id: '2',
1413
+ order_date: '2022-01-02',
1414
+ order_amount: 80.0,
1415
+ orders__customer_id: '1',
1416
+ orders__product_id: '2',
1417
+ orders__order_id: 2,
1418
+ vendors: [
1419
+ 'myntra'
1420
+ ]
1421
+ },
1422
+ {
1423
+ order_id: 1,
1424
+ customer_id: '1',
1425
+ product_id: '1',
1426
+ order_date: '2022-01-01',
1427
+ order_amount: 50.0,
1428
+ orders__customer_id: '1',
1429
+ orders__product_id: '1',
1430
+ orders__order_id: 1,
1431
+ vendors: [
1432
+ 'myntra',
1433
+ 'amazon',
1434
+ 'flipkart'
1435
+ ]
1436
+ }
1437
+ ]
1292
1438
  }
1293
1439
  ],
1294
1440
  [
1295
1441
  {
1296
1442
  testName: 'Not In',
1297
- expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, vendors AS orders__vendors, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__customer_id NOT IN ('1', '2')) AND (NOT (orders__vendors && (ARRAY['myntra', 'flipkart']))))`,
1443
+ // customer_id is string type -> uses optimized string_split with NOT
1444
+ // vendors is string_array type -> uses NOT with ARRAY overlap &&
1445
+ expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, vendors AS orders__vendors, * FROM (select * from orders) AS orders) AS orders WHERE ((NOT (orders__customer_id = ANY(SELECT unnest(string_split('1§‡¶2', '§‡¶'))))) AND (NOT (orders__vendors && (ARRAY['myntra', 'flipkart']))))`,
1298
1446
  cubeInput: {
1299
1447
  measures: [
1300
1448
  '*'
@@ -1377,6 +1525,249 @@ const TEST_DATA = [
1377
1525
  ]
1378
1526
  }
1379
1527
  ]
1528
+ },
1529
+ {
1530
+ testName: 'Not In with numeric type (optimized with CAST)',
1531
+ // order_id is number type -> uses optimized string_split with CAST and NOT
1532
+ expectedSQL: `SELECT orders.* FROM (SELECT order_id AS orders__order_id, * FROM (select * from orders) AS orders) AS orders WHERE (NOT (orders__order_id = ANY(SELECT CAST(unnest(string_split('1§‡¶2', '§‡¶')) AS DOUBLE))))`,
1533
+ cubeInput: {
1534
+ measures: [
1535
+ '*'
1536
+ ],
1537
+ filters: [
1538
+ {
1539
+ member: 'orders.order_id',
1540
+ operator: 'notIn',
1541
+ values: [
1542
+ 1,
1543
+ 2
1544
+ ]
1545
+ }
1546
+ ],
1547
+ dimensions: []
1548
+ },
1549
+ expectedOutput: [
1550
+ {
1551
+ order_id: 3,
1552
+ customer_id: '2',
1553
+ product_id: '3',
1554
+ order_date: '2022-02-01',
1555
+ order_amount: 25.0,
1556
+ orders__order_id: 3,
1557
+ vendors: []
1558
+ },
1559
+ {
1560
+ order_id: 4,
1561
+ customer_id: '2',
1562
+ product_id: '1',
1563
+ order_date: '2022-03-01',
1564
+ order_amount: 75.0,
1565
+ orders__order_id: 4,
1566
+ vendors: [
1567
+ 'flipkart'
1568
+ ]
1569
+ },
1570
+ {
1571
+ order_id: 5,
1572
+ customer_id: '3',
1573
+ product_id: '1',
1574
+ order_date: '2022-03-02',
1575
+ order_amount: 100.0,
1576
+ orders__order_id: 5,
1577
+ vendors: [
1578
+ 'myntra',
1579
+ 'amazon',
1580
+ 'flipkart'
1581
+ ]
1582
+ },
1583
+ {
1584
+ order_id: 6,
1585
+ customer_id: '4',
1586
+ product_id: '2',
1587
+ order_date: '2022-04-01',
1588
+ order_amount: 45.0,
1589
+ orders__order_id: 6,
1590
+ vendors: []
1591
+ },
1592
+ {
1593
+ order_id: 7,
1594
+ customer_id: '4',
1595
+ product_id: '3',
1596
+ order_date: '2022-05-01',
1597
+ order_amount: 90.0,
1598
+ orders__order_id: 7,
1599
+ vendors: [
1600
+ 'myntra',
1601
+ 'flipkart'
1602
+ ]
1603
+ },
1604
+ {
1605
+ order_id: 8,
1606
+ customer_id: '5',
1607
+ product_id: '1',
1608
+ order_date: '2022-05-02',
1609
+ order_amount: 65.0,
1610
+ orders__order_id: 8,
1611
+ vendors: [
1612
+ 'amazon',
1613
+ 'flipkart'
1614
+ ]
1615
+ },
1616
+ {
1617
+ order_id: 9,
1618
+ customer_id: '5',
1619
+ product_id: '2',
1620
+ order_date: '2022-05-05',
1621
+ order_amount: 85.0,
1622
+ orders__order_id: 9,
1623
+ vendors: []
1624
+ },
1625
+ {
1626
+ order_id: 10,
1627
+ customer_id: '6',
1628
+ product_id: '3',
1629
+ order_date: '2022-06-01',
1630
+ order_amount: 120.0,
1631
+ orders__order_id: 10,
1632
+ vendors: [
1633
+ 'myntra',
1634
+ 'amazon'
1635
+ ]
1636
+ },
1637
+ {
1638
+ order_id: 11,
1639
+ customer_id: '6aa6',
1640
+ product_id: '3',
1641
+ order_date: '2024-06-01',
1642
+ order_amount: 0.0,
1643
+ orders__order_id: 11,
1644
+ vendors: [
1645
+ 'amazon'
1646
+ ]
1647
+ },
1648
+ {
1649
+ order_id: 12,
1650
+ customer_id: null,
1651
+ product_id: '3',
1652
+ order_date: '2024-07-01T00:00:00.000Z',
1653
+ order_amount: 100.0,
1654
+ orders__order_id: 12,
1655
+ orders__order_date: undefined,
1656
+ vendors: [
1657
+ 'flipkart'
1658
+ ]
1659
+ },
1660
+ {
1661
+ order_id: 13,
1662
+ customer_id: '7',
1663
+ product_id: '6',
1664
+ order_date: '2024-08-01T00:00:00.000Z',
1665
+ order_amount: 100.0,
1666
+ orders__order_id: 13,
1667
+ orders__order_date: undefined,
1668
+ vendors: [
1669
+ "swiggy's"
1670
+ ]
1671
+ }
1672
+ ]
1673
+ },
1674
+ {
1675
+ testName: 'Multiple NotIn filters combined (customer_id, product_id, order_id)',
1676
+ // Tests all three optimized NOT IN filters working together
1677
+ expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, product_id AS orders__product_id, order_id AS orders__order_id, * FROM (select * from orders) AS orders) AS orders WHERE ((NOT (orders__customer_id = ANY(SELECT unnest(string_split('1§‡¶2', '§‡¶'))))) AND (NOT (orders__product_id = ANY(SELECT unnest(string_split('1§‡¶2', '§‡¶'))))) AND (NOT (orders__order_id = ANY(SELECT CAST(unnest(string_split('1§‡¶2', '§‡¶')) AS DOUBLE)))))`,
1678
+ cubeInput: {
1679
+ measures: [
1680
+ '*'
1681
+ ],
1682
+ filters: [
1683
+ {
1684
+ and: [
1685
+ {
1686
+ member: 'orders.customer_id',
1687
+ operator: 'notIn',
1688
+ values: [
1689
+ '1',
1690
+ '2'
1691
+ ]
1692
+ },
1693
+ {
1694
+ member: 'orders.product_id',
1695
+ operator: 'notIn',
1696
+ values: [
1697
+ '1',
1698
+ '2'
1699
+ ]
1700
+ },
1701
+ {
1702
+ member: 'orders.order_id',
1703
+ operator: 'notIn',
1704
+ values: [
1705
+ 1,
1706
+ 2
1707
+ ]
1708
+ }
1709
+ ]
1710
+ }
1711
+ ],
1712
+ dimensions: []
1713
+ },
1714
+ expectedOutput: [
1715
+ {
1716
+ order_id: 7,
1717
+ customer_id: '4',
1718
+ product_id: '3',
1719
+ order_date: '2022-05-01',
1720
+ order_amount: 90.0,
1721
+ orders__customer_id: '4',
1722
+ orders__product_id: '3',
1723
+ orders__order_id: 7,
1724
+ vendors: [
1725
+ 'myntra',
1726
+ 'flipkart'
1727
+ ]
1728
+ },
1729
+ {
1730
+ order_id: 10,
1731
+ customer_id: '6',
1732
+ product_id: '3',
1733
+ order_date: '2022-06-01',
1734
+ order_amount: 120.0,
1735
+ orders__customer_id: '6',
1736
+ orders__product_id: '3',
1737
+ orders__order_id: 10,
1738
+ vendors: [
1739
+ 'myntra',
1740
+ 'amazon'
1741
+ ]
1742
+ },
1743
+ {
1744
+ order_id: 11,
1745
+ customer_id: '6aa6',
1746
+ product_id: '3',
1747
+ order_date: '2024-06-01',
1748
+ order_amount: 0.0,
1749
+ orders__customer_id: '6aa6',
1750
+ orders__product_id: '3',
1751
+ orders__order_id: 11,
1752
+ vendors: [
1753
+ 'amazon'
1754
+ ]
1755
+ },
1756
+ {
1757
+ order_id: 13,
1758
+ customer_id: '7',
1759
+ product_id: '6',
1760
+ order_date: '2024-08-01T00:00:00.000Z',
1761
+ order_amount: 100.0,
1762
+ orders__customer_id: '7',
1763
+ orders__product_id: '6',
1764
+ orders__order_id: 13,
1765
+ orders__order_date: undefined,
1766
+ vendors: [
1767
+ "swiggy's"
1768
+ ]
1769
+ }
1770
+ ]
1380
1771
  }
1381
1772
  ]
1382
1773
  ];
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../meerkat-node/src/__tests__/test-data.ts"],"sourcesContent":["export const CREATE_TEST_TABLE = `\nCREATE TABLE orders (\n order_id INTEGER,\n customer_id VARCHAR,\n product_id VARCHAR,\n order_date DATE,\n order_amount FLOAT,\n vendors VARCHAR[]\n);\n`;\n\nexport const INPUT_DATA_QUERY = `\nINSERT INTO orders VALUES\n(1, '1', '1', '2022-01-01', 50, ['myntra', 'amazon', 'flipkart']),\n(2, '1', '2', '2022-01-02', 80, ['myntra']),\n(3, '2', '3', '2022-02-01', 25, []),\n(4, '2', '1', '2022-03-01', 75, ['flipkart']),\n(5, '3', '1', '2022-03-02', 100, ['myntra', 'amazon', 'flipkart']),\n(6, '4', '2', '2022-04-01', 45, []),\n(7, '4', '3', '2022-05-01', 90, ['myntra', 'flipkart']),\n(8, '5', '1', '2022-05-02', 65, ['amazon', 'flipkart']),\n(9, '5', '2', '2022-05-05', 85, []),\n(10, '6', '3', '2022-06-01', 120, ['myntra', 'amazon']),\n(11, '6aa6', '3', '2024-06-01', 0, ['amazon']),\n(12, NULL, '3', '2024-07-01', 100, ['flipkart']),\n(13, '7', '6', '2024-08-01', 100, ['swiggy''s']);\n`;\n\nexport const TABLE_SCHEMA = {\n name: 'orders',\n sql: 'select * from orders',\n measures: [\n {\n name: 'order_amount',\n sql: 'order_amount',\n type: 'number',\n },\n {\n name: 'total_order_amount',\n sql: 'SUM(order_amount)',\n type: 'number',\n },\n ],\n dimensions: [\n {\n name: 'order_date',\n sql: 'order_date',\n type: 'time',\n },\n {\n name: 'order_id',\n sql: 'order_id',\n type: 'number',\n },\n {\n name: 'customer_id',\n sql: 'customer_id',\n type: 'string',\n },\n {\n name: 'product_id',\n sql: 'product_id',\n type: 'string',\n },\n {\n name: 'order_month',\n sql: `DATE_TRUNC('month', order_date)`,\n type: 'string',\n },\n {\n name: 'vendors',\n sql: 'vendors',\n type: 'string_array',\n },\n ],\n};\n\nexport const TEST_DATA = [\n [\n {\n testName: 'GroupBySQLInnerQuery',\n expectedSQL: `SELECT SUM(order_amount) AS orders__total_order_amount , orders__order_month FROM (SELECT DATE_TRUNC('month', order_date) AS orders__order_month, * FROM (select * from orders) AS orders) AS orders GROUP BY orders__order_month LIMIT 1`,\n cubeInput: {\n measures: ['orders.total_order_amount'],\n filters: [],\n dimensions: ['orders.order_month'],\n limit: 1,\n },\n expectedOutput: [\n {\n orders__order_month: '2022-01-01T00:00:00.000Z',\n orders__total_order_amount: 130,\n },\n ],\n },\n ],\n [\n {\n testName: 'GroupBy',\n expectedSQL: `SELECT SUM(order_amount) AS orders__total_order_amount , orders__customer_id FROM (SELECT customer_id AS orders__customer_id, * FROM (select * from orders) AS orders) AS orders GROUP BY orders__customer_id ORDER BY orders__total_order_amount ASC, orders__customer_id ASC`,\n cubeInput: {\n measures: ['orders.total_order_amount'],\n filters: [],\n dimensions: ['orders.customer_id'],\n order: {\n 'orders.total_order_amount': 'asc',\n 'orders.customer_id': 'asc',\n },\n },\n expectedOutput: [\n {\n orders__customer_id: '6aa6',\n orders__total_order_amount: 0,\n },\n {\n orders__customer_id: '2',\n orders__total_order_amount: 100,\n },\n {\n orders__customer_id: '3',\n orders__total_order_amount: 100,\n },\n {\n orders__customer_id: '7',\n orders__total_order_amount: 100,\n },\n {\n orders__customer_id: null,\n orders__total_order_amount: 100,\n },\n {\n orders__customer_id: '6',\n orders__total_order_amount: 120,\n },\n {\n orders__customer_id: '1',\n orders__total_order_amount: 130,\n },\n {\n orders__customer_id: '4',\n orders__total_order_amount: 135,\n },\n {\n orders__customer_id: '5',\n orders__total_order_amount: 150,\n },\n ],\n },\n ],\n [\n {\n testName: 'Equals',\n expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, * FROM (select * from orders) AS orders) AS orders WHERE (orders__customer_id = '1')`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n member: 'orders.customer_id',\n operator: 'equals',\n values: ['1'],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n order_id: 1,\n customer_id: '1',\n orders__customer_id: '1',\n product_id: '1',\n order_date: '2022-01-01',\n order_amount: 50.0,\n vendors: ['myntra', 'amazon', 'flipkart'],\n },\n {\n order_id: 2,\n customer_id: '1',\n orders__customer_id: '1',\n product_id: '2',\n order_date: '2022-01-02',\n order_amount: 80.0,\n vendors: ['myntra'],\n },\n ],\n },\n {\n testName: 'Equals for multiple values',\n expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__customer_id = '1') AND (orders__customer_id = '2'))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n member: 'orders.customer_id',\n operator: 'equals',\n values: ['1', '2'],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [],\n },\n ],\n [\n {\n testName: 'NotEquals',\n expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, * FROM (select * from orders) AS orders) AS orders WHERE (orders__customer_id != '1')`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n member: 'orders.customer_id',\n operator: 'notEquals',\n values: ['1'],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n order_id: 3,\n customer_id: '2',\n orders__customer_id: '2',\n product_id: '3',\n order_date: '2022-02-01',\n order_amount: 25.0,\n vendors: [],\n },\n {\n order_id: 4,\n customer_id: '2',\n orders__customer_id: '2',\n product_id: '1',\n order_date: '2022-03-01',\n order_amount: 75.0,\n vendors: ['flipkart'],\n },\n {\n order_id: 5,\n customer_id: '3',\n orders__customer_id: '3',\n product_id: '1',\n order_date: '2022-03-02',\n order_amount: 100.0,\n vendors: ['myntra', 'amazon', 'flipkart'],\n },\n {\n order_id: 6,\n customer_id: '4',\n orders__customer_id: '4',\n product_id: '2',\n order_date: '2022-04-01',\n order_amount: 45.0,\n vendors: [],\n },\n {\n order_id: 7,\n customer_id: '4',\n orders__customer_id: '4',\n product_id: '3',\n order_date: '2022-05-01',\n order_amount: 90.0,\n vendors: ['myntra', 'flipkart'],\n },\n {\n order_id: 8,\n customer_id: '5',\n orders__customer_id: '5',\n product_id: '1',\n order_date: '2022-05-02',\n order_amount: 65.0,\n vendors: ['amazon', 'flipkart'],\n },\n {\n order_id: 9,\n customer_id: '5',\n orders__customer_id: '5',\n product_id: '2',\n order_date: '2022-05-05',\n order_amount: 85.0,\n vendors: [],\n },\n {\n order_id: 10,\n customer_id: '6',\n orders__customer_id: '6',\n product_id: '3',\n order_date: '2022-06-01',\n order_amount: 120.0,\n vendors: ['myntra', 'amazon'],\n },\n {\n order_id: 11,\n customer_id: '6aa6',\n orders__customer_id: '6aa6',\n product_id: '3',\n order_date: '2024-06-01',\n order_amount: 0.0,\n vendors: ['amazon'],\n },\n {\n order_id: 13,\n customer_id: '7',\n orders__customer_id: '7',\n product_id: '6',\n order_date: '2024-08-01',\n order_amount: 100.0,\n vendors: [\"swiggy's\"],\n },\n ],\n },\n ],\n [\n {\n testName: 'Contains',\n expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, * FROM (select * from orders) AS orders) AS orders WHERE (orders__customer_id ~~* '%aa%')`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n member: 'orders.customer_id',\n operator: 'contains',\n values: ['aa'],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n order_id: 11,\n customer_id: '6aa6',\n orders__customer_id: '6aa6',\n product_id: '3',\n order_date: '2024-06-01',\n order_amount: 0.0,\n vendors: ['amazon'],\n },\n ],\n },\n ],\n [\n {\n testName: 'NotContains',\n expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__customer_id !~~ '%1%') AND (orders__customer_id !~~ '%2%') AND (orders__customer_id !~~ '%3%') AND (orders__customer_id !~~ '%4%') AND (orders__customer_id !~~ '%5%') AND (orders__customer_id !~~ '%aa%'))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n and: [\n {\n member: 'orders.customer_id',\n operator: 'notContains',\n values: ['1'],\n },\n {\n member: 'orders.customer_id',\n operator: 'notContains',\n values: ['2'],\n },\n {\n member: 'orders.customer_id',\n operator: 'notContains',\n values: ['3'],\n },\n {\n member: 'orders.customer_id',\n operator: 'notContains',\n values: ['4'],\n },\n {\n member: 'orders.customer_id',\n operator: 'notContains',\n values: ['5'],\n },\n {\n member: 'orders.customer_id',\n operator: 'notContains',\n values: ['aa'],\n },\n ],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n order_id: 10,\n customer_id: '6',\n orders__customer_id: '6',\n product_id: '3',\n order_date: '2022-06-01',\n order_amount: 120,\n vendors: ['myntra', 'amazon'],\n },\n {\n customer_id: '7',\n order_amount: 100,\n order_date: '2024-08-01T00:00:00.000Z',\n order_id: 13,\n orders__customer_id: '7',\n orders__order_date: undefined,\n product_id: '6',\n vendors: [\"swiggy's\"],\n },\n ],\n },\n ],\n [\n {\n testName: 'GreaterThan',\n expectedSQL: `SELECT orders.* FROM (SELECT orders.order_amount AS orders__order_amount, * FROM (select * from orders) AS orders) AS orders WHERE (orders__order_amount > 50)`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n member: 'orders.order_amount',\n operator: 'gt',\n values: ['50'],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n order_id: 2,\n customer_id: '1',\n product_id: '2',\n order_date: '2022-01-02',\n order_amount: 80.0,\n orders__order_amount: 80.0,\n vendors: ['myntra'],\n },\n {\n order_id: 4,\n customer_id: '2',\n product_id: '1',\n order_date: '2022-03-01',\n order_amount: 75.0,\n orders__order_amount: 75.0,\n vendors: ['flipkart'],\n },\n {\n order_id: 5,\n customer_id: '3',\n product_id: '1',\n order_date: '2022-03-02',\n order_amount: 100.0,\n orders__order_amount: 100.0,\n vendors: ['myntra', 'amazon', 'flipkart'],\n },\n {\n order_id: 7,\n customer_id: '4',\n product_id: '3',\n order_date: '2022-05-01',\n order_amount: 90.0,\n orders__order_amount: 90.0,\n vendors: ['myntra', 'flipkart'],\n },\n {\n order_id: 8,\n customer_id: '5',\n product_id: '1',\n order_date: '2022-05-02',\n order_amount: 65.0,\n orders__order_amount: 65.0,\n vendors: ['amazon', 'flipkart'],\n },\n {\n order_id: 9,\n customer_id: '5',\n product_id: '2',\n order_date: '2022-05-05',\n order_amount: 85.0,\n orders__order_amount: 85.0,\n vendors: [],\n },\n {\n order_id: 10,\n customer_id: '6',\n product_id: '3',\n order_date: '2022-06-01',\n order_amount: 120.0,\n orders__order_amount: 120.0,\n vendors: ['myntra', 'amazon'],\n },\n {\n customer_id: null,\n order_amount: 100,\n order_date: '2024-07-01T00:00:00.000Z',\n order_id: 12,\n orders__order_amount: 100,\n orders__order_date: undefined,\n product_id: '3',\n vendors: ['flipkart'],\n },\n {\n customer_id: '7',\n order_amount: 100,\n order_date: '2024-08-01T00:00:00.000Z',\n order_id: 13,\n orders__order_amount: 100,\n orders__order_date: undefined,\n product_id: '6',\n vendors: [\"swiggy's\"],\n },\n ],\n },\n ],\n [\n {\n testName: 'LessThan',\n expectedSQL: `SELECT orders.* FROM (SELECT orders.order_amount AS orders__order_amount, * FROM (select * from orders) AS orders) AS orders WHERE (orders__order_amount < 50)`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n member: 'orders.order_amount',\n operator: 'lt',\n values: ['50'],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n order_id: 3,\n customer_id: '2',\n product_id: '3',\n order_date: '2022-02-01',\n order_amount: 25.0,\n orders__order_amount: 25.0,\n vendors: [],\n },\n {\n order_id: 6,\n customer_id: '4',\n product_id: '2',\n order_date: '2022-04-01',\n order_amount: 45.0,\n orders__order_amount: 45.0,\n vendors: [],\n },\n {\n order_id: 11,\n customer_id: '6aa6',\n product_id: '3',\n order_date: '2024-06-01',\n order_amount: 0.0,\n orders__order_amount: 0.0,\n vendors: ['amazon'],\n },\n ],\n },\n ],\n [\n {\n testName: 'InDateRange',\n expectedSQL: `SELECT orders.* FROM (SELECT order_date AS orders__order_date, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__order_date >= '2022-02-01') AND (orders__order_date <= '2022-03-31'))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n member: 'orders.order_date',\n operator: 'inDateRange',\n values: ['2022-02-01', '2022-03-31'],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n order_id: 3,\n customer_id: '2',\n product_id: '3',\n order_date: '2022-02-01',\n orders__order_date: '2022-02-01',\n order_amount: 25.0,\n vendors: [],\n },\n {\n order_id: 4,\n customer_id: '2',\n product_id: '1',\n order_date: '2022-03-01',\n orders__order_date: '2022-03-01',\n order_amount: 75.0,\n vendors: ['flipkart'],\n },\n {\n order_id: 5,\n customer_id: '3',\n product_id: '1',\n order_date: '2022-03-02',\n orders__order_date: '2022-03-02',\n order_amount: 100.0,\n vendors: ['myntra', 'amazon', 'flipkart'],\n },\n ],\n },\n ],\n [\n {\n testName: 'NotInDateRange',\n expectedSQL: `SELECT orders.* FROM (SELECT order_date AS orders__order_date, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__order_date < '2022-02-01') OR (orders__order_date > '2022-03-31'))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n member: 'orders.order_date',\n operator: 'notInDateRange',\n values: ['2022-02-01', '2022-03-31'],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n order_id: 1,\n customer_id: '1',\n product_id: '1',\n order_date: '2022-01-01',\n order_amount: 50.0,\n orders__order_date: '2022-01-01',\n vendors: ['myntra', 'amazon', 'flipkart'],\n },\n {\n order_id: 2,\n customer_id: '1',\n product_id: '2',\n order_date: '2022-01-02',\n order_amount: 80.0,\n orders__order_date: '2022-01-02',\n vendors: ['myntra'],\n },\n {\n order_id: 6,\n customer_id: '4',\n product_id: '2',\n order_date: '2022-04-01',\n orders__order_date: '2022-04-01',\n order_amount: 45.0,\n vendors: [],\n },\n {\n order_id: 7,\n customer_id: '4',\n product_id: '3',\n order_date: '2022-05-01',\n orders__order_date: '2022-05-01',\n order_amount: 90.0,\n vendors: ['myntra', 'flipkart'],\n },\n {\n order_id: 8,\n customer_id: '5',\n product_id: '1',\n order_date: '2022-05-02',\n orders__order_date: '2022-05-02',\n order_amount: 65.0,\n vendors: ['amazon', 'flipkart'],\n },\n {\n order_id: 9,\n customer_id: '5',\n product_id: '2',\n order_date: '2022-05-05',\n orders__order_date: '2022-05-05',\n order_amount: 85.0,\n vendors: [],\n },\n {\n order_id: 10,\n customer_id: '6',\n product_id: '3',\n order_date: '2022-06-01',\n orders__order_date: '2022-06-01',\n order_amount: 120.0,\n vendors: ['myntra', 'amazon'],\n },\n {\n order_id: 11,\n customer_id: '6aa6',\n product_id: '3',\n order_date: '2024-06-01',\n orders__order_date: '2024-06-01',\n order_amount: 0.0,\n vendors: ['amazon'],\n },\n {\n customer_id: null,\n order_amount: 100,\n order_date: '2024-07-01T00:00:00.000Z',\n order_id: 12,\n orders__order_date: '2024-07-01T00:00:00.000Z',\n product_id: '3',\n vendors: ['flipkart'],\n },\n {\n customer_id: '7',\n order_amount: 100,\n order_date: '2024-08-01T00:00:00.000Z',\n order_id: 13,\n orders__order_date: '2024-08-01T00:00:00.000Z',\n product_id: '6',\n vendors: [\"swiggy's\"],\n },\n ],\n },\n ],\n // {\n // testName: 'Or',\n // expectedSQL: `SELECT orders.* FROM (select * from orders) AS orders WHERE ((orders.order_amount > 80) OR ((orders.order_date >= '2022-02-01') AND (orders.order_date <= '2022-03-01')))`,\n // cubeInput: {\n // measures: ['*'],\n // filters: [\n // {\n // or: [\n // {\n // member: 'orders.order_amount',\n // operator: 'gt',\n // values: ['80'],\n // },\n // {\n // member: 'orders.order_date',\n // operator: 'inDateRange',\n // values: ['2022-02-01', '2022-03-01'],\n // },\n // ],\n // },\n // ],\n // dimensions: [],\n // },\n // expectedOutput: [\n // {\n // order_id: 3,\n // customer_id: '2',\n // product_id: '3',\n // order_date: '2022-02-01',\n // order_amount: 25.0,\n // },\n // {\n // order_id: 4,\n // customer_id: '2',\n // product_id: '1',\n // order_date: '2022-03-01',\n // order_amount: 75.0,\n // },\n // {\n // order_id: 5,\n // customer_id: '3',\n // product_id: '1',\n // order_date: '2022-03-02',\n // order_amount: 100.0,\n // },\n // {\n // order_id: 7,\n // customer_id: '4',\n // product_id: '3',\n // order_date: '2022-05-01',\n // order_amount: 90.0,\n // },\n // {\n // order_id: 9,\n // customer_id: '5',\n // product_id: '2',\n // order_date: '2022-05-05',\n // order_amount: 85.0,\n // },\n // {\n // order_id: 10,\n // customer_id: '6',\n // product_id: '3',\n // order_date: '2022-06-01',\n // order_amount: 120.0,\n // },\n // ],\n // },\n [\n {\n testName: 'And',\n expectedSQL: `SELECT orders.* FROM (SELECT orders.order_amount AS orders__order_amount, order_date AS orders__order_date, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__order_amount > 50) AND ((orders__order_date >= '2022-02-01') AND (orders__order_date <= '2022-06-01')))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n and: [\n {\n member: 'orders.order_amount',\n operator: 'gt',\n values: ['50'],\n },\n {\n member: 'orders.order_date',\n operator: 'inDateRange',\n values: ['2022-02-01', '2022-06-01'],\n },\n ],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n order_id: 4,\n customer_id: '2',\n product_id: '1',\n order_date: '2022-03-01',\n order_amount: 75.0,\n orders__order_amount: 75.0,\n orders__order_date: '2022-03-01',\n vendors: ['flipkart'],\n },\n {\n order_id: 5,\n customer_id: '3',\n product_id: '1',\n order_date: '2022-03-02',\n orders__order_date: '2022-03-02',\n order_amount: 100.0,\n orders__order_amount: 100.0,\n vendors: ['myntra', 'amazon', 'flipkart'],\n },\n {\n order_id: 7,\n customer_id: '4',\n product_id: '3',\n order_date: '2022-05-01',\n orders__order_date: '2022-05-01',\n order_amount: 90.0,\n orders__order_amount: 90.0,\n vendors: ['myntra', 'flipkart'],\n },\n {\n order_id: 8,\n customer_id: '5',\n product_id: '1',\n order_date: '2022-05-02',\n orders__order_date: '2022-05-02',\n order_amount: 65,\n orders__order_amount: 65,\n vendors: ['amazon', 'flipkart'],\n },\n {\n order_id: 9,\n customer_id: '5',\n product_id: '2',\n order_date: '2022-05-05',\n orders__order_date: '2022-05-05',\n order_amount: 85.0,\n orders__order_amount: 85.0,\n vendors: [],\n },\n {\n order_id: 10,\n customer_id: '6',\n product_id: '3',\n order_date: '2022-06-01',\n orders__order_date: '2022-06-01',\n order_amount: 120.0,\n orders__order_amount: 120.0,\n vendors: ['myntra', 'amazon'],\n },\n ],\n },\n ],\n [\n {\n testName: 'Set',\n expectedSQL: `SELECT orders.* FROM (SELECT orders.order_amount AS orders__order_amount, product_id AS orders__product_id, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__order_amount IS NOT NULL) AND (orders__product_id = '3'))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n and: [\n {\n member: 'orders.order_amount',\n operator: 'set',\n },\n {\n member: 'orders.product_id',\n operator: 'equals',\n values: ['3'],\n },\n ],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n customer_id: '2',\n order_amount: 25,\n order_date: '2022-02-01T00:00:00.000Z',\n order_id: 3,\n orders__order_amount: 25,\n orders__order_date: undefined,\n orders__product_id: '3',\n product_id: '3',\n vendors: [],\n },\n {\n customer_id: '4',\n order_amount: 90,\n order_date: '2022-05-01T00:00:00.000Z',\n order_id: 7,\n orders__order_amount: 90,\n orders__order_date: undefined,\n orders__product_id: '3',\n product_id: '3',\n vendors: ['myntra', 'flipkart'],\n },\n {\n customer_id: '6',\n order_amount: 120,\n order_date: '2022-06-01T00:00:00.000Z',\n order_id: 10,\n orders__order_amount: 120,\n orders__order_date: undefined,\n orders__product_id: '3',\n product_id: '3',\n vendors: ['myntra', 'amazon'],\n },\n {\n customer_id: '6aa6',\n order_amount: 0,\n order_date: '2024-06-01T00:00:00.000Z',\n order_id: 11,\n orders__order_amount: 0,\n orders__order_date: undefined,\n orders__product_id: '3',\n product_id: '3',\n vendors: ['amazon'],\n },\n {\n customer_id: null,\n order_amount: 100,\n order_date: '2024-07-01T00:00:00.000Z',\n order_id: 12,\n orders__order_amount: 100,\n orders__order_date: undefined,\n orders__product_id: '3',\n product_id: '3',\n vendors: ['flipkart'],\n },\n ],\n },\n ],\n [\n {\n testName: 'Not Set',\n expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, product_id AS orders__product_id, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__customer_id IS NULL) AND (orders__product_id = '3'))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n and: [\n {\n member: 'orders.customer_id',\n operator: 'notSet',\n },\n {\n member: 'orders.product_id',\n operator: 'equals',\n values: ['3'],\n },\n ],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n orders__customer_id: null,\n customer_id: null,\n order_amount: 100,\n order_date: '2024-07-01T00:00:00.000Z',\n order_id: 12,\n orders__order_date: undefined,\n orders__product_id: '3',\n product_id: '3',\n vendors: ['flipkart'],\n },\n ],\n },\n ],\n [\n {\n testName: 'In',\n expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, vendors AS orders__vendors, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__customer_id IN ('1', '2')) AND (orders__vendors && (ARRAY['myntra', 'amazon'])))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n and: [\n {\n member: 'orders.customer_id',\n operator: 'in',\n values: ['1', '2'],\n },\n {\n member: 'orders.vendors',\n operator: 'in',\n values: ['myntra', 'amazon'],\n },\n ],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n customer_id: '1',\n order_amount: 50,\n order_date: '2022-01-01T00:00:00.000Z',\n order_id: 1,\n orders__customer_id: '1',\n orders__order_date: undefined,\n orders__vendors: ['myntra', 'amazon', 'flipkart'],\n product_id: '1',\n vendors: ['myntra', 'amazon', 'flipkart'],\n },\n {\n customer_id: '1',\n order_amount: 80,\n order_date: '2022-01-02T00:00:00.000Z',\n order_id: 2,\n orders__customer_id: '1',\n orders__order_date: undefined,\n orders__vendors: ['myntra'],\n product_id: '2',\n vendors: ['myntra'],\n },\n ],\n },\n {\n testName: 'In with single quotes',\n expectedSQL: `SELECT orders.* FROM (SELECT vendors AS orders__vendors, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__vendors && (ARRAY['swiggy''s'])))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n and: [\n {\n member: 'orders.vendors',\n operator: 'in',\n values: [\"swiggy's\"],\n },\n ],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n customer_id: '7',\n order_amount: 100,\n order_date: '2024-08-01T00:00:00.000Z',\n order_id: 13,\n orders__order_date: undefined,\n orders__vendors: [\"swiggy's\"],\n product_id: '6',\n vendors: [\"swiggy's\"],\n },\n ],\n },\n ],\n [\n {\n testName: 'Not In',\n expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, vendors AS orders__vendors, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__customer_id NOT IN ('1', '2')) AND (NOT (orders__vendors && (ARRAY['myntra', 'flipkart']))))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n and: [\n {\n member: 'orders.customer_id',\n operator: 'notIn',\n values: ['1', '2'],\n },\n {\n member: 'orders.vendors',\n operator: 'notIn',\n values: ['myntra', 'flipkart'],\n },\n ],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n customer_id: '4',\n order_amount: 45,\n order_date: '2022-04-01T00:00:00.000Z',\n order_id: 6,\n orders__customer_id: '4',\n orders__order_date: undefined,\n orders__vendors: [],\n product_id: '2',\n vendors: [],\n },\n {\n customer_id: '5',\n order_amount: 85,\n order_date: '2022-05-05T00:00:00.000Z',\n order_id: 9,\n orders__customer_id: '5',\n orders__order_date: undefined,\n orders__vendors: [],\n product_id: '2',\n vendors: [],\n },\n {\n customer_id: '6aa6',\n order_amount: 0,\n order_date: '2024-06-01T00:00:00.000Z',\n order_id: 11,\n orders__customer_id: '6aa6',\n orders__order_date: undefined,\n orders__vendors: ['amazon'],\n product_id: '3',\n vendors: ['amazon'],\n },\n {\n customer_id: '7',\n order_amount: 100,\n order_date: '2024-08-01T00:00:00.000Z',\n order_id: 13,\n orders__customer_id: '7',\n orders__order_date: undefined,\n orders__vendors: [\"swiggy's\"],\n product_id: '6',\n vendors: [\"swiggy's\"],\n },\n ],\n },\n ],\n];\n"],"names":["CREATE_TEST_TABLE","INPUT_DATA_QUERY","TABLE_SCHEMA","TEST_DATA","name","sql","measures","type","dimensions","testName","expectedSQL","cubeInput","filters","limit","expectedOutput","orders__order_month","orders__total_order_amount","order","orders__customer_id","member","operator","values","order_id","customer_id","product_id","order_date","order_amount","vendors","and","orders__order_date","undefined","orders__order_amount","orders__product_id","orders__vendors"],"mappings":";;;;;;;;IAAaA,iBAAiB;eAAjBA;;IAWAC,gBAAgB;eAAhBA;;IAiBAC,YAAY;eA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AqB;oBACrBW,oBAAoBC;oBACpBG,iBAAiB;wBAAC;qBAAS;oBAC3BT,YAAY;oBACZG,SAAS;wBAAC;qBAAS;gBACrB;gBACA;oBACEJ,aAAa;oBACbG,cAAc;oBACdD,YAAY;oBACZH,UAAU;oBACVJ,qBAAqB;oBACrBW,oBAAoBC;oBACpBG,iBAAiB;wBAAC;qBAAW;oBAC7BT,YAAY;oBACZG,SAAS;wBAAC;qBAAW;gBACvB;aACD;QACH;KACD;CACF"}
1
+ {"version":3,"sources":["../../../meerkat-node/src/__tests__/test-data.ts"],"sourcesContent":["export const CREATE_TEST_TABLE = `\nCREATE TABLE orders (\n order_id INTEGER,\n customer_id VARCHAR,\n product_id VARCHAR,\n order_date DATE,\n order_amount FLOAT,\n vendors VARCHAR[]\n);\n`;\n\nexport const INPUT_DATA_QUERY = `\nINSERT INTO orders VALUES\n(1, '1', '1', '2022-01-01', 50, ['myntra', 'amazon', 'flipkart']),\n(2, '1', '2', '2022-01-02', 80, ['myntra']),\n(3, '2', '3', '2022-02-01', 25, []),\n(4, '2', '1', '2022-03-01', 75, ['flipkart']),\n(5, '3', '1', '2022-03-02', 100, ['myntra', 'amazon', 'flipkart']),\n(6, '4', '2', '2022-04-01', 45, []),\n(7, '4', '3', '2022-05-01', 90, ['myntra', 'flipkart']),\n(8, '5', '1', '2022-05-02', 65, ['amazon', 'flipkart']),\n(9, '5', '2', '2022-05-05', 85, []),\n(10, '6', '3', '2022-06-01', 120, ['myntra', 'amazon']),\n(11, '6aa6', '3', '2024-06-01', 0, ['amazon']),\n(12, NULL, '3', '2024-07-01', 100, ['flipkart']),\n(13, '7', '6', '2024-08-01', 100, ['swiggy''s']);\n`;\n\nexport const TABLE_SCHEMA = {\n name: 'orders',\n sql: 'select * from orders',\n measures: [\n {\n name: 'order_amount',\n sql: 'order_amount',\n type: 'number',\n },\n {\n name: 'total_order_amount',\n sql: 'SUM(order_amount)',\n type: 'number',\n },\n ],\n dimensions: [\n {\n name: 'order_date',\n sql: 'order_date',\n type: 'time',\n },\n {\n name: 'order_id',\n sql: 'order_id',\n type: 'number',\n },\n {\n name: 'customer_id',\n sql: 'customer_id',\n type: 'string',\n },\n {\n name: 'product_id',\n sql: 'product_id',\n type: 'string',\n },\n {\n name: 'order_month',\n sql: `DATE_TRUNC('month', order_date)`,\n type: 'string',\n },\n {\n name: 'vendors',\n sql: 'vendors',\n type: 'string_array',\n },\n ],\n};\n\nexport const TEST_DATA = [\n [\n {\n testName: 'GroupBySQLInnerQuery',\n expectedSQL: `SELECT SUM(order_amount) AS orders__total_order_amount , orders__order_month FROM (SELECT DATE_TRUNC('month', order_date) AS orders__order_month, * FROM (select * from orders) AS orders) AS orders GROUP BY orders__order_month LIMIT 1`,\n cubeInput: {\n measures: ['orders.total_order_amount'],\n filters: [],\n dimensions: ['orders.order_month'],\n limit: 1,\n },\n expectedOutput: [\n {\n orders__order_month: '2022-01-01T00:00:00.000Z',\n orders__total_order_amount: 130,\n },\n ],\n },\n ],\n [\n {\n testName: 'GroupBy',\n expectedSQL: `SELECT SUM(order_amount) AS orders__total_order_amount , orders__customer_id FROM (SELECT customer_id AS orders__customer_id, * FROM (select * from orders) AS orders) AS orders GROUP BY orders__customer_id ORDER BY orders__total_order_amount ASC, orders__customer_id ASC`,\n cubeInput: {\n measures: ['orders.total_order_amount'],\n filters: [],\n dimensions: ['orders.customer_id'],\n order: {\n 'orders.total_order_amount': 'asc',\n 'orders.customer_id': 'asc',\n },\n },\n expectedOutput: [\n {\n orders__customer_id: '6aa6',\n orders__total_order_amount: 0,\n },\n {\n orders__customer_id: '2',\n orders__total_order_amount: 100,\n },\n {\n orders__customer_id: '3',\n orders__total_order_amount: 100,\n },\n {\n orders__customer_id: '7',\n orders__total_order_amount: 100,\n },\n {\n orders__customer_id: null,\n orders__total_order_amount: 100,\n },\n {\n orders__customer_id: '6',\n orders__total_order_amount: 120,\n },\n {\n orders__customer_id: '1',\n orders__total_order_amount: 130,\n },\n {\n orders__customer_id: '4',\n orders__total_order_amount: 135,\n },\n {\n orders__customer_id: '5',\n orders__total_order_amount: 150,\n },\n ],\n },\n ],\n [\n {\n testName: 'Equals',\n expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, * FROM (select * from orders) AS orders) AS orders WHERE (orders__customer_id = '1')`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n member: 'orders.customer_id',\n operator: 'equals',\n values: ['1'],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n order_id: 1,\n customer_id: '1',\n orders__customer_id: '1',\n product_id: '1',\n order_date: '2022-01-01',\n order_amount: 50.0,\n vendors: ['myntra', 'amazon', 'flipkart'],\n },\n {\n order_id: 2,\n customer_id: '1',\n orders__customer_id: '1',\n product_id: '2',\n order_date: '2022-01-02',\n order_amount: 80.0,\n vendors: ['myntra'],\n },\n ],\n },\n {\n testName: 'Equals for multiple values',\n expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__customer_id = '1') AND (orders__customer_id = '2'))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n member: 'orders.customer_id',\n operator: 'equals',\n values: ['1', '2'],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [],\n },\n ],\n [\n {\n testName: 'NotEquals',\n expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, * FROM (select * from orders) AS orders) AS orders WHERE (orders__customer_id != '1')`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n member: 'orders.customer_id',\n operator: 'notEquals',\n values: ['1'],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n order_id: 3,\n customer_id: '2',\n orders__customer_id: '2',\n product_id: '3',\n order_date: '2022-02-01',\n order_amount: 25.0,\n vendors: [],\n },\n {\n order_id: 4,\n customer_id: '2',\n orders__customer_id: '2',\n product_id: '1',\n order_date: '2022-03-01',\n order_amount: 75.0,\n vendors: ['flipkart'],\n },\n {\n order_id: 5,\n customer_id: '3',\n orders__customer_id: '3',\n product_id: '1',\n order_date: '2022-03-02',\n order_amount: 100.0,\n vendors: ['myntra', 'amazon', 'flipkart'],\n },\n {\n order_id: 6,\n customer_id: '4',\n orders__customer_id: '4',\n product_id: '2',\n order_date: '2022-04-01',\n order_amount: 45.0,\n vendors: [],\n },\n {\n order_id: 7,\n customer_id: '4',\n orders__customer_id: '4',\n product_id: '3',\n order_date: '2022-05-01',\n order_amount: 90.0,\n vendors: ['myntra', 'flipkart'],\n },\n {\n order_id: 8,\n customer_id: '5',\n orders__customer_id: '5',\n product_id: '1',\n order_date: '2022-05-02',\n order_amount: 65.0,\n vendors: ['amazon', 'flipkart'],\n },\n {\n order_id: 9,\n customer_id: '5',\n orders__customer_id: '5',\n product_id: '2',\n order_date: '2022-05-05',\n order_amount: 85.0,\n vendors: [],\n },\n {\n order_id: 10,\n customer_id: '6',\n orders__customer_id: '6',\n product_id: '3',\n order_date: '2022-06-01',\n order_amount: 120.0,\n vendors: ['myntra', 'amazon'],\n },\n {\n order_id: 11,\n customer_id: '6aa6',\n orders__customer_id: '6aa6',\n product_id: '3',\n order_date: '2024-06-01',\n order_amount: 0.0,\n vendors: ['amazon'],\n },\n {\n order_id: 13,\n customer_id: '7',\n orders__customer_id: '7',\n product_id: '6',\n order_date: '2024-08-01',\n order_amount: 100.0,\n vendors: [\"swiggy's\"],\n },\n ],\n },\n ],\n [\n {\n testName: 'Contains',\n expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, * FROM (select * from orders) AS orders) AS orders WHERE (orders__customer_id ~~* '%aa%')`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n member: 'orders.customer_id',\n operator: 'contains',\n values: ['aa'],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n order_id: 11,\n customer_id: '6aa6',\n orders__customer_id: '6aa6',\n product_id: '3',\n order_date: '2024-06-01',\n order_amount: 0.0,\n vendors: ['amazon'],\n },\n ],\n },\n ],\n [\n {\n testName: 'NotContains',\n expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__customer_id !~~ '%1%') AND (orders__customer_id !~~ '%2%') AND (orders__customer_id !~~ '%3%') AND (orders__customer_id !~~ '%4%') AND (orders__customer_id !~~ '%5%') AND (orders__customer_id !~~ '%aa%'))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n and: [\n {\n member: 'orders.customer_id',\n operator: 'notContains',\n values: ['1'],\n },\n {\n member: 'orders.customer_id',\n operator: 'notContains',\n values: ['2'],\n },\n {\n member: 'orders.customer_id',\n operator: 'notContains',\n values: ['3'],\n },\n {\n member: 'orders.customer_id',\n operator: 'notContains',\n values: ['4'],\n },\n {\n member: 'orders.customer_id',\n operator: 'notContains',\n values: ['5'],\n },\n {\n member: 'orders.customer_id',\n operator: 'notContains',\n values: ['aa'],\n },\n ],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n order_id: 10,\n customer_id: '6',\n orders__customer_id: '6',\n product_id: '3',\n order_date: '2022-06-01',\n order_amount: 120,\n vendors: ['myntra', 'amazon'],\n },\n {\n customer_id: '7',\n order_amount: 100,\n order_date: '2024-08-01T00:00:00.000Z',\n order_id: 13,\n orders__customer_id: '7',\n orders__order_date: undefined,\n product_id: '6',\n vendors: [\"swiggy's\"],\n },\n ],\n },\n ],\n [\n {\n testName: 'GreaterThan',\n expectedSQL: `SELECT orders.* FROM (SELECT orders.order_amount AS orders__order_amount, * FROM (select * from orders) AS orders) AS orders WHERE (orders__order_amount > 50)`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n member: 'orders.order_amount',\n operator: 'gt',\n values: ['50'],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n order_id: 2,\n customer_id: '1',\n product_id: '2',\n order_date: '2022-01-02',\n order_amount: 80.0,\n orders__order_amount: 80.0,\n vendors: ['myntra'],\n },\n {\n order_id: 4,\n customer_id: '2',\n product_id: '1',\n order_date: '2022-03-01',\n order_amount: 75.0,\n orders__order_amount: 75.0,\n vendors: ['flipkart'],\n },\n {\n order_id: 5,\n customer_id: '3',\n product_id: '1',\n order_date: '2022-03-02',\n order_amount: 100.0,\n orders__order_amount: 100.0,\n vendors: ['myntra', 'amazon', 'flipkart'],\n },\n {\n order_id: 7,\n customer_id: '4',\n product_id: '3',\n order_date: '2022-05-01',\n order_amount: 90.0,\n orders__order_amount: 90.0,\n vendors: ['myntra', 'flipkart'],\n },\n {\n order_id: 8,\n customer_id: '5',\n product_id: '1',\n order_date: '2022-05-02',\n order_amount: 65.0,\n orders__order_amount: 65.0,\n vendors: ['amazon', 'flipkart'],\n },\n {\n order_id: 9,\n customer_id: '5',\n product_id: '2',\n order_date: '2022-05-05',\n order_amount: 85.0,\n orders__order_amount: 85.0,\n vendors: [],\n },\n {\n order_id: 10,\n customer_id: '6',\n product_id: '3',\n order_date: '2022-06-01',\n order_amount: 120.0,\n orders__order_amount: 120.0,\n vendors: ['myntra', 'amazon'],\n },\n {\n customer_id: null,\n order_amount: 100,\n order_date: '2024-07-01T00:00:00.000Z',\n order_id: 12,\n orders__order_amount: 100,\n orders__order_date: undefined,\n product_id: '3',\n vendors: ['flipkart'],\n },\n {\n customer_id: '7',\n order_amount: 100,\n order_date: '2024-08-01T00:00:00.000Z',\n order_id: 13,\n orders__order_amount: 100,\n orders__order_date: undefined,\n product_id: '6',\n vendors: [\"swiggy's\"],\n },\n ],\n },\n ],\n [\n {\n testName: 'LessThan',\n expectedSQL: `SELECT orders.* FROM (SELECT orders.order_amount AS orders__order_amount, * FROM (select * from orders) AS orders) AS orders WHERE (orders__order_amount < 50)`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n member: 'orders.order_amount',\n operator: 'lt',\n values: ['50'],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n order_id: 3,\n customer_id: '2',\n product_id: '3',\n order_date: '2022-02-01',\n order_amount: 25.0,\n orders__order_amount: 25.0,\n vendors: [],\n },\n {\n order_id: 6,\n customer_id: '4',\n product_id: '2',\n order_date: '2022-04-01',\n order_amount: 45.0,\n orders__order_amount: 45.0,\n vendors: [],\n },\n {\n order_id: 11,\n customer_id: '6aa6',\n product_id: '3',\n order_date: '2024-06-01',\n order_amount: 0.0,\n orders__order_amount: 0.0,\n vendors: ['amazon'],\n },\n ],\n },\n ],\n [\n {\n testName: 'InDateRange',\n expectedSQL: `SELECT orders.* FROM (SELECT order_date AS orders__order_date, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__order_date >= '2022-02-01') AND (orders__order_date <= '2022-03-31'))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n member: 'orders.order_date',\n operator: 'inDateRange',\n values: ['2022-02-01', '2022-03-31'],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n order_id: 3,\n customer_id: '2',\n product_id: '3',\n order_date: '2022-02-01',\n orders__order_date: '2022-02-01',\n order_amount: 25.0,\n vendors: [],\n },\n {\n order_id: 4,\n customer_id: '2',\n product_id: '1',\n order_date: '2022-03-01',\n orders__order_date: '2022-03-01',\n order_amount: 75.0,\n vendors: ['flipkart'],\n },\n {\n order_id: 5,\n customer_id: '3',\n product_id: '1',\n order_date: '2022-03-02',\n orders__order_date: '2022-03-02',\n order_amount: 100.0,\n vendors: ['myntra', 'amazon', 'flipkart'],\n },\n ],\n },\n ],\n [\n {\n testName: 'NotInDateRange',\n expectedSQL: `SELECT orders.* FROM (SELECT order_date AS orders__order_date, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__order_date < '2022-02-01') OR (orders__order_date > '2022-03-31'))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n member: 'orders.order_date',\n operator: 'notInDateRange',\n values: ['2022-02-01', '2022-03-31'],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n order_id: 1,\n customer_id: '1',\n product_id: '1',\n order_date: '2022-01-01',\n order_amount: 50.0,\n orders__order_date: '2022-01-01',\n vendors: ['myntra', 'amazon', 'flipkart'],\n },\n {\n order_id: 2,\n customer_id: '1',\n product_id: '2',\n order_date: '2022-01-02',\n order_amount: 80.0,\n orders__order_date: '2022-01-02',\n vendors: ['myntra'],\n },\n {\n order_id: 6,\n customer_id: '4',\n product_id: '2',\n order_date: '2022-04-01',\n orders__order_date: '2022-04-01',\n order_amount: 45.0,\n vendors: [],\n },\n {\n order_id: 7,\n customer_id: '4',\n product_id: '3',\n order_date: '2022-05-01',\n orders__order_date: '2022-05-01',\n order_amount: 90.0,\n vendors: ['myntra', 'flipkart'],\n },\n {\n order_id: 8,\n customer_id: '5',\n product_id: '1',\n order_date: '2022-05-02',\n orders__order_date: '2022-05-02',\n order_amount: 65.0,\n vendors: ['amazon', 'flipkart'],\n },\n {\n order_id: 9,\n customer_id: '5',\n product_id: '2',\n order_date: '2022-05-05',\n orders__order_date: '2022-05-05',\n order_amount: 85.0,\n vendors: [],\n },\n {\n order_id: 10,\n customer_id: '6',\n product_id: '3',\n order_date: '2022-06-01',\n orders__order_date: '2022-06-01',\n order_amount: 120.0,\n vendors: ['myntra', 'amazon'],\n },\n {\n order_id: 11,\n customer_id: '6aa6',\n product_id: '3',\n order_date: '2024-06-01',\n orders__order_date: '2024-06-01',\n order_amount: 0.0,\n vendors: ['amazon'],\n },\n {\n customer_id: null,\n order_amount: 100,\n order_date: '2024-07-01T00:00:00.000Z',\n order_id: 12,\n orders__order_date: '2024-07-01T00:00:00.000Z',\n product_id: '3',\n vendors: ['flipkart'],\n },\n {\n customer_id: '7',\n order_amount: 100,\n order_date: '2024-08-01T00:00:00.000Z',\n order_id: 13,\n orders__order_date: '2024-08-01T00:00:00.000Z',\n product_id: '6',\n vendors: [\"swiggy's\"],\n },\n ],\n },\n ],\n // {\n // testName: 'Or',\n // expectedSQL: `SELECT orders.* FROM (select * from orders) AS orders WHERE ((orders.order_amount > 80) OR ((orders.order_date >= '2022-02-01') AND (orders.order_date <= '2022-03-01')))`,\n // cubeInput: {\n // measures: ['*'],\n // filters: [\n // {\n // or: [\n // {\n // member: 'orders.order_amount',\n // operator: 'gt',\n // values: ['80'],\n // },\n // {\n // member: 'orders.order_date',\n // operator: 'inDateRange',\n // values: ['2022-02-01', '2022-03-01'],\n // },\n // ],\n // },\n // ],\n // dimensions: [],\n // },\n // expectedOutput: [\n // {\n // order_id: 3,\n // customer_id: '2',\n // product_id: '3',\n // order_date: '2022-02-01',\n // order_amount: 25.0,\n // },\n // {\n // order_id: 4,\n // customer_id: '2',\n // product_id: '1',\n // order_date: '2022-03-01',\n // order_amount: 75.0,\n // },\n // {\n // order_id: 5,\n // customer_id: '3',\n // product_id: '1',\n // order_date: '2022-03-02',\n // order_amount: 100.0,\n // },\n // {\n // order_id: 7,\n // customer_id: '4',\n // product_id: '3',\n // order_date: '2022-05-01',\n // order_amount: 90.0,\n // },\n // {\n // order_id: 9,\n // customer_id: '5',\n // product_id: '2',\n // order_date: '2022-05-05',\n // order_amount: 85.0,\n // },\n // {\n // order_id: 10,\n // customer_id: '6',\n // product_id: '3',\n // order_date: '2022-06-01',\n // order_amount: 120.0,\n // },\n // ],\n // },\n [\n {\n testName: 'And',\n expectedSQL: `SELECT orders.* FROM (SELECT orders.order_amount AS orders__order_amount, order_date AS orders__order_date, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__order_amount > 50) AND ((orders__order_date >= '2022-02-01') AND (orders__order_date <= '2022-06-01')))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n and: [\n {\n member: 'orders.order_amount',\n operator: 'gt',\n values: ['50'],\n },\n {\n member: 'orders.order_date',\n operator: 'inDateRange',\n values: ['2022-02-01', '2022-06-01'],\n },\n ],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n order_id: 4,\n customer_id: '2',\n product_id: '1',\n order_date: '2022-03-01',\n order_amount: 75.0,\n orders__order_amount: 75.0,\n orders__order_date: '2022-03-01',\n vendors: ['flipkart'],\n },\n {\n order_id: 5,\n customer_id: '3',\n product_id: '1',\n order_date: '2022-03-02',\n orders__order_date: '2022-03-02',\n order_amount: 100.0,\n orders__order_amount: 100.0,\n vendors: ['myntra', 'amazon', 'flipkart'],\n },\n {\n order_id: 7,\n customer_id: '4',\n product_id: '3',\n order_date: '2022-05-01',\n orders__order_date: '2022-05-01',\n order_amount: 90.0,\n orders__order_amount: 90.0,\n vendors: ['myntra', 'flipkart'],\n },\n {\n order_id: 8,\n customer_id: '5',\n product_id: '1',\n order_date: '2022-05-02',\n orders__order_date: '2022-05-02',\n order_amount: 65,\n orders__order_amount: 65,\n vendors: ['amazon', 'flipkart'],\n },\n {\n order_id: 9,\n customer_id: '5',\n product_id: '2',\n order_date: '2022-05-05',\n orders__order_date: '2022-05-05',\n order_amount: 85.0,\n orders__order_amount: 85.0,\n vendors: [],\n },\n {\n order_id: 10,\n customer_id: '6',\n product_id: '3',\n order_date: '2022-06-01',\n orders__order_date: '2022-06-01',\n order_amount: 120.0,\n orders__order_amount: 120.0,\n vendors: ['myntra', 'amazon'],\n },\n ],\n },\n ],\n [\n {\n testName: 'Set',\n expectedSQL: `SELECT orders.* FROM (SELECT orders.order_amount AS orders__order_amount, product_id AS orders__product_id, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__order_amount IS NOT NULL) AND (orders__product_id = '3'))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n and: [\n {\n member: 'orders.order_amount',\n operator: 'set',\n },\n {\n member: 'orders.product_id',\n operator: 'equals',\n values: ['3'],\n },\n ],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n customer_id: '2',\n order_amount: 25,\n order_date: '2022-02-01T00:00:00.000Z',\n order_id: 3,\n orders__order_amount: 25,\n orders__order_date: undefined,\n orders__product_id: '3',\n product_id: '3',\n vendors: [],\n },\n {\n customer_id: '4',\n order_amount: 90,\n order_date: '2022-05-01T00:00:00.000Z',\n order_id: 7,\n orders__order_amount: 90,\n orders__order_date: undefined,\n orders__product_id: '3',\n product_id: '3',\n vendors: ['myntra', 'flipkart'],\n },\n {\n customer_id: '6',\n order_amount: 120,\n order_date: '2022-06-01T00:00:00.000Z',\n order_id: 10,\n orders__order_amount: 120,\n orders__order_date: undefined,\n orders__product_id: '3',\n product_id: '3',\n vendors: ['myntra', 'amazon'],\n },\n {\n customer_id: '6aa6',\n order_amount: 0,\n order_date: '2024-06-01T00:00:00.000Z',\n order_id: 11,\n orders__order_amount: 0,\n orders__order_date: undefined,\n orders__product_id: '3',\n product_id: '3',\n vendors: ['amazon'],\n },\n {\n customer_id: null,\n order_amount: 100,\n order_date: '2024-07-01T00:00:00.000Z',\n order_id: 12,\n orders__order_amount: 100,\n orders__order_date: undefined,\n orders__product_id: '3',\n product_id: '3',\n vendors: ['flipkart'],\n },\n ],\n },\n ],\n [\n {\n testName: 'Not Set',\n expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, product_id AS orders__product_id, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__customer_id IS NULL) AND (orders__product_id = '3'))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n and: [\n {\n member: 'orders.customer_id',\n operator: 'notSet',\n },\n {\n member: 'orders.product_id',\n operator: 'equals',\n values: ['3'],\n },\n ],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n orders__customer_id: null,\n customer_id: null,\n order_amount: 100,\n order_date: '2024-07-01T00:00:00.000Z',\n order_id: 12,\n orders__order_date: undefined,\n orders__product_id: '3',\n product_id: '3',\n vendors: ['flipkart'],\n },\n ],\n },\n ],\n [\n {\n testName: 'In',\n // customer_id is string type -> uses optimized string_split\n // vendors is string_array type -> uses ARRAY overlap &&\n expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, vendors AS orders__vendors, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__customer_id = ANY(SELECT unnest(string_split('1§‡¶2', '§‡¶')))) AND (orders__vendors && (ARRAY['myntra', 'amazon'])))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n and: [\n {\n member: 'orders.customer_id',\n operator: 'in',\n values: ['1', '2'],\n },\n {\n member: 'orders.vendors',\n operator: 'in',\n values: ['myntra', 'amazon'],\n },\n ],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n customer_id: '1',\n order_amount: 50,\n order_date: '2022-01-01T00:00:00.000Z',\n order_id: 1,\n orders__customer_id: '1',\n orders__order_date: undefined,\n orders__vendors: ['myntra', 'amazon', 'flipkart'],\n product_id: '1',\n vendors: ['myntra', 'amazon', 'flipkart'],\n },\n {\n customer_id: '1',\n order_amount: 80,\n order_date: '2022-01-02T00:00:00.000Z',\n order_id: 2,\n orders__customer_id: '1',\n orders__order_date: undefined,\n orders__vendors: ['myntra'],\n product_id: '2',\n vendors: ['myntra'],\n },\n ],\n },\n {\n testName: 'In with numeric type (optimized with CAST)',\n // order_id is number type -> uses optimized string_split with CAST to DOUBLE\n expectedSQL: `SELECT orders.* FROM (SELECT order_id AS orders__order_id, * FROM (select * from orders) AS orders) AS orders WHERE (orders__order_id = ANY(SELECT CAST(unnest(string_split('1§‡¶2§‡¶3', '§‡¶')) AS DOUBLE)))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n member: 'orders.order_id',\n operator: 'in',\n values: [1, 2, 3],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n order_id: 1,\n customer_id: '1',\n product_id: '1',\n order_date: '2022-01-01',\n order_amount: 50.0,\n orders__order_id: 1,\n vendors: ['myntra', 'amazon', 'flipkart'],\n },\n {\n order_id: 2,\n customer_id: '1',\n product_id: '2',\n order_date: '2022-01-02',\n order_amount: 80.0,\n orders__order_id: 2,\n vendors: ['myntra'],\n },\n {\n order_id: 3,\n customer_id: '2',\n product_id: '3',\n order_date: '2022-02-01',\n order_amount: 25.0,\n orders__order_id: 3,\n vendors: [],\n },\n ],\n },\n {\n testName: 'In with single quotes',\n expectedSQL: `SELECT orders.* FROM (SELECT vendors AS orders__vendors, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__vendors && (ARRAY['swiggy''s'])))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n and: [\n {\n member: 'orders.vendors',\n operator: 'in',\n values: [\"swiggy's\"],\n },\n ],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n customer_id: '7',\n order_amount: 100,\n order_date: '2024-08-01T00:00:00.000Z',\n order_id: 13,\n orders__order_date: undefined,\n orders__vendors: [\"swiggy's\"],\n product_id: '6',\n vendors: [\"swiggy's\"],\n },\n ],\n },\n {\n testName:\n 'Multiple In filters combined (customer_id, product_id, order_id)',\n // Tests all three optimized filters working together\n // customer_id (string), product_id (string), order_id (number with CAST)\n expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, product_id AS orders__product_id, order_id AS orders__order_id, * FROM (select * from orders) AS orders) AS orders WHERE ((orders__customer_id = ANY(SELECT unnest(string_split('1§‡¶2', '§‡¶')))) AND (orders__product_id = ANY(SELECT unnest(string_split('1§‡¶2', '§‡¶')))) AND (orders__order_id = ANY(SELECT CAST(unnest(string_split('1§‡¶2§‡¶3§‡¶4', '§‡¶')) AS DOUBLE))))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n and: [\n {\n member: 'orders.customer_id',\n operator: 'in',\n values: ['1', '2'],\n },\n {\n member: 'orders.product_id',\n operator: 'in',\n values: ['1', '2'],\n },\n {\n member: 'orders.order_id',\n operator: 'in',\n values: [1, 2, 3, 4],\n },\n ],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n order_id: 4,\n customer_id: '2',\n product_id: '1',\n order_date: '2022-03-01',\n order_amount: 75.0,\n orders__customer_id: '2',\n orders__product_id: '1',\n orders__order_id: 4,\n vendors: ['flipkart'],\n },\n {\n order_id: 2,\n customer_id: '1',\n product_id: '2',\n order_date: '2022-01-02',\n order_amount: 80.0,\n orders__customer_id: '1',\n orders__product_id: '2',\n orders__order_id: 2,\n vendors: ['myntra'],\n },\n {\n order_id: 1,\n customer_id: '1',\n product_id: '1',\n order_date: '2022-01-01',\n order_amount: 50.0,\n orders__customer_id: '1',\n orders__product_id: '1',\n orders__order_id: 1,\n vendors: ['myntra', 'amazon', 'flipkart'],\n },\n ],\n },\n ],\n [\n {\n testName: 'Not In',\n // customer_id is string type -> uses optimized string_split with NOT\n // vendors is string_array type -> uses NOT with ARRAY overlap &&\n expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, vendors AS orders__vendors, * FROM (select * from orders) AS orders) AS orders WHERE ((NOT (orders__customer_id = ANY(SELECT unnest(string_split('1§‡¶2', '§‡¶'))))) AND (NOT (orders__vendors && (ARRAY['myntra', 'flipkart']))))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n and: [\n {\n member: 'orders.customer_id',\n operator: 'notIn',\n values: ['1', '2'],\n },\n {\n member: 'orders.vendors',\n operator: 'notIn',\n values: ['myntra', 'flipkart'],\n },\n ],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n customer_id: '4',\n order_amount: 45,\n order_date: '2022-04-01T00:00:00.000Z',\n order_id: 6,\n orders__customer_id: '4',\n orders__order_date: undefined,\n orders__vendors: [],\n product_id: '2',\n vendors: [],\n },\n {\n customer_id: '5',\n order_amount: 85,\n order_date: '2022-05-05T00:00:00.000Z',\n order_id: 9,\n orders__customer_id: '5',\n orders__order_date: undefined,\n orders__vendors: [],\n product_id: '2',\n vendors: [],\n },\n {\n customer_id: '6aa6',\n order_amount: 0,\n order_date: '2024-06-01T00:00:00.000Z',\n order_id: 11,\n orders__customer_id: '6aa6',\n orders__order_date: undefined,\n orders__vendors: ['amazon'],\n product_id: '3',\n vendors: ['amazon'],\n },\n {\n customer_id: '7',\n order_amount: 100,\n order_date: '2024-08-01T00:00:00.000Z',\n order_id: 13,\n orders__customer_id: '7',\n orders__order_date: undefined,\n orders__vendors: [\"swiggy's\"],\n product_id: '6',\n vendors: [\"swiggy's\"],\n },\n ],\n },\n {\n testName: 'Not In with numeric type (optimized with CAST)',\n // order_id is number type -> uses optimized string_split with CAST and NOT\n expectedSQL: `SELECT orders.* FROM (SELECT order_id AS orders__order_id, * FROM (select * from orders) AS orders) AS orders WHERE (NOT (orders__order_id = ANY(SELECT CAST(unnest(string_split('1§‡¶2', '§‡¶')) AS DOUBLE))))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n member: 'orders.order_id',\n operator: 'notIn',\n values: [1, 2],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n order_id: 3,\n customer_id: '2',\n product_id: '3',\n order_date: '2022-02-01',\n order_amount: 25.0,\n orders__order_id: 3,\n vendors: [],\n },\n {\n order_id: 4,\n customer_id: '2',\n product_id: '1',\n order_date: '2022-03-01',\n order_amount: 75.0,\n orders__order_id: 4,\n vendors: ['flipkart'],\n },\n {\n order_id: 5,\n customer_id: '3',\n product_id: '1',\n order_date: '2022-03-02',\n order_amount: 100.0,\n orders__order_id: 5,\n vendors: ['myntra', 'amazon', 'flipkart'],\n },\n {\n order_id: 6,\n customer_id: '4',\n product_id: '2',\n order_date: '2022-04-01',\n order_amount: 45.0,\n orders__order_id: 6,\n vendors: [],\n },\n {\n order_id: 7,\n customer_id: '4',\n product_id: '3',\n order_date: '2022-05-01',\n order_amount: 90.0,\n orders__order_id: 7,\n vendors: ['myntra', 'flipkart'],\n },\n {\n order_id: 8,\n customer_id: '5',\n product_id: '1',\n order_date: '2022-05-02',\n order_amount: 65.0,\n orders__order_id: 8,\n vendors: ['amazon', 'flipkart'],\n },\n {\n order_id: 9,\n customer_id: '5',\n product_id: '2',\n order_date: '2022-05-05',\n order_amount: 85.0,\n orders__order_id: 9,\n vendors: [],\n },\n {\n order_id: 10,\n customer_id: '6',\n product_id: '3',\n order_date: '2022-06-01',\n order_amount: 120.0,\n orders__order_id: 10,\n vendors: ['myntra', 'amazon'],\n },\n {\n order_id: 11,\n customer_id: '6aa6',\n product_id: '3',\n order_date: '2024-06-01',\n order_amount: 0.0,\n orders__order_id: 11,\n vendors: ['amazon'],\n },\n {\n order_id: 12,\n customer_id: null,\n product_id: '3',\n order_date: '2024-07-01T00:00:00.000Z',\n order_amount: 100.0,\n orders__order_id: 12,\n orders__order_date: undefined,\n vendors: ['flipkart'],\n },\n {\n order_id: 13,\n customer_id: '7',\n product_id: '6',\n order_date: '2024-08-01T00:00:00.000Z',\n order_amount: 100.0,\n orders__order_id: 13,\n orders__order_date: undefined,\n vendors: [\"swiggy's\"],\n },\n ],\n },\n {\n testName:\n 'Multiple NotIn filters combined (customer_id, product_id, order_id)',\n // Tests all three optimized NOT IN filters working together\n expectedSQL: `SELECT orders.* FROM (SELECT customer_id AS orders__customer_id, product_id AS orders__product_id, order_id AS orders__order_id, * FROM (select * from orders) AS orders) AS orders WHERE ((NOT (orders__customer_id = ANY(SELECT unnest(string_split('1§‡¶2', '§‡¶'))))) AND (NOT (orders__product_id = ANY(SELECT unnest(string_split('1§‡¶2', '§‡¶'))))) AND (NOT (orders__order_id = ANY(SELECT CAST(unnest(string_split('1§‡¶2', '§‡¶')) AS DOUBLE)))))`,\n cubeInput: {\n measures: ['*'],\n filters: [\n {\n and: [\n {\n member: 'orders.customer_id',\n operator: 'notIn',\n values: ['1', '2'],\n },\n {\n member: 'orders.product_id',\n operator: 'notIn',\n values: ['1', '2'],\n },\n {\n member: 'orders.order_id',\n operator: 'notIn',\n values: [1, 2],\n },\n ],\n },\n ],\n dimensions: [],\n },\n expectedOutput: [\n {\n order_id: 7,\n customer_id: '4',\n product_id: '3',\n order_date: '2022-05-01',\n order_amount: 90.0,\n orders__customer_id: '4',\n orders__product_id: '3',\n orders__order_id: 7,\n vendors: ['myntra', 'flipkart'],\n },\n {\n order_id: 10,\n customer_id: '6',\n product_id: '3',\n order_date: '2022-06-01',\n order_amount: 120.0,\n orders__customer_id: '6',\n orders__product_id: '3',\n orders__order_id: 10,\n vendors: ['myntra', 'amazon'],\n },\n {\n order_id: 11,\n customer_id: '6aa6',\n product_id: '3',\n order_date: '2024-06-01',\n order_amount: 0.0,\n orders__customer_id: '6aa6',\n orders__product_id: '3',\n orders__order_id: 11,\n vendors: ['amazon'],\n },\n {\n order_id: 13,\n customer_id: '7',\n product_id: '6',\n order_date: '2024-08-01T00:00:00.000Z',\n order_amount: 100.0,\n orders__customer_id: '7',\n orders__product_id: '6',\n orders__order_id: 13,\n orders__order_date: undefined,\n vendors: [\"swiggy's\"],\n },\n ],\n },\n ],\n];\n"],"names":["CREATE_TEST_TABLE","INPUT_DATA_QUERY","TABLE_SCHEMA","TEST_DATA","name","sql","measures","type","dimensions","testName","expectedSQL","cubeInput","filters","limit","expectedOutput","orders__order_month","orders__total_order_amount","order","orders__customer_id","member","operator","values","order_id","customer_id","product_id","order_date","order_amount","vendors","and","orders__order_date","undefined","orders__order_amount","orders__product_id","orders__vendors","orders__order_id"],"mappings":";;;;;;;;IAAaA,iBAAiB;eAAjBA;;IAWAC,gBAAgB;eAAhBA;;IAiBAC,YAAY;eAAZA;;IAiDAC,SAAS;eAATA;;;AA7EN,MAAMH,oBAAoB,CAAC;;;;;;;;;AASlC,CAAC;AAEM,MAAMC,mBAAmB,CAAC;;;;;;;;;;;;;;;AAejC,CAAC;AAEM,MAAMC,eAAe;IAC1BE,MAAM;IACNC,KAAK;IACLC,UAAU;QACR;YACEF,MAAM;YACNC,KAAK;YACLE,MAAM;QACR;QACA;YACEH,MAAM;YACNC,KAAK;YACLE,MAAM;QACR;KACD;IACDC,YAAY;QACV;YACEJ,MAAM;YACNC,KAAK;YACLE,MAAM;QACR;QACA;YACEH,MAAM;YACNC,KAAK;YACLE,MAAM;QACR;QACA;YACEH,MAAM;YACNC,KAAK;YACLE,MAAM;QACR;QACA;YACEH,MAAM;YACNC,KAAK;YACLE,MAAM;QACR;QACA;YACEH,MAAM;YACNC,KAAK,CAAC,+BAA+B,CAAC;YACtCE,MAAM;QACR;QACA;YACEH,MAAM;YACNC,KAAK;YACLE,MAAM;QACR;KACD;AACH;AAEO,MAAMJ,YAAY;IACvB;QACE;YACEM,UAAU;YACVC,aAAa,CAAC,2OAA2O,CAAC;YAC1PC,WAAW;gBACTL,UAAU;oBAAC;iBAA4B;gB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ACZC,YAAY;oBACZC,cAAc;oBACdR,qBAAqB;oBACrBc,oBAAoB;oBACpBE,kBAAkB;oBAClBP,SAAS;wBAAC;qBAAS;gBACrB;gBACA;oBACEL,UAAU;oBACVC,aAAa;oBACbC,YAAY;oBACZC,YAAY;oBACZC,cAAc;oBACdR,qBAAqB;oBACrBc,oBAAoB;oBACpBE,kBAAkB;oBAClBL,oBAAoBC;oBACpBH,SAAS;wBAAC;qBAAW;gBACvB;aACD;QACH;KACD;CACF"}
@@ -13,26 +13,57 @@ const cubeQueryToSQLWithResolution = async ({ query, tableSchemas, resolutionCon
13
13
  tableSchemas,
14
14
  contextParams
15
15
  });
16
- if (resolutionConfig.columnConfigs.length === 0) {
17
- // If no resolution is needed, return the base SQL.
16
+ // Check if resolution should be skipped
17
+ if ((0, _meerkatcore.shouldSkipResolution)(resolutionConfig, query, columnProjections)) {
18
18
  return baseSql;
19
19
  }
20
- // Create a table schema for the base query.
21
- const baseTable = (0, _meerkatcore.createBaseTableSchema)(baseSql, tableSchemas, resolutionConfig, query.measures, query.dimensions);
22
- const resolutionSchemas = (0, _meerkatcore.generateResolutionSchemas)(resolutionConfig, tableSchemas);
23
- const resolveParams = {
24
- query: {
25
- measures: [],
26
- dimensions: (0, _meerkatcore.generateResolvedDimensions)(query, resolutionConfig, columnProjections),
27
- joinPaths: (0, _meerkatcore.generateResolutionJoinPaths)(resolutionConfig, tableSchemas)
28
- },
29
- tableSchemas: [
30
- baseTable,
31
- ...resolutionSchemas
32
- ]
20
+ if (!columnProjections) {
21
+ columnProjections = [
22
+ ...query.dimensions || [],
23
+ ...query.measures
24
+ ];
25
+ }
26
+ // This is to ensure that, only the column projection columns
27
+ // are being resolved and other definitions are ignored.
28
+ resolutionConfig.columnConfigs = resolutionConfig.columnConfigs.filter((config)=>{
29
+ return columnProjections == null ? void 0 : columnProjections.includes(config.name);
30
+ });
31
+ const baseSchema = (0, _meerkatcore.createBaseTableSchema)(baseSql, tableSchemas, resolutionConfig, [], columnProjections);
32
+ const rowIdDimension = {
33
+ name: _meerkatcore.ROW_ID_DIMENSION_NAME,
34
+ sql: (0, _meerkatcore.generateRowNumberSql)(query, baseSchema.dimensions, _meerkatcore.BASE_DATA_SOURCE_NAME),
35
+ type: 'number',
36
+ alias: _meerkatcore.ROW_ID_DIMENSION_NAME
33
37
  };
34
- const sql = await (0, _cubetosql.cubeQueryToSQL)(resolveParams);
35
- return sql;
38
+ baseSchema.dimensions.push(rowIdDimension);
39
+ columnProjections.push(_meerkatcore.ROW_ID_DIMENSION_NAME);
40
+ // Doing this because we need to use the original name of the column in the base table schema.
41
+ resolutionConfig.columnConfigs.forEach((config)=>{
42
+ config.name = (0, _meerkatcore.memberKeyToSafeKey)(config.name);
43
+ });
44
+ // Generate SQL with row_id and unnested arrays
45
+ const unnestTableSchema = await (0, _meerkatcore.getUnnestTableSchema)({
46
+ baseTableSchema: baseSchema,
47
+ resolutionConfig,
48
+ contextParams,
49
+ cubeQueryToSQL: async (params)=>(0, _cubetosql.cubeQueryToSQL)(params)
50
+ });
51
+ // Apply resolution (join with lookup tables)
52
+ const resolvedTableSchema = await (0, _meerkatcore.getResolvedTableSchema)({
53
+ baseTableSchema: unnestTableSchema,
54
+ resolutionConfig,
55
+ contextParams,
56
+ columnProjections,
57
+ cubeQueryToSQL: async (params)=>(0, _cubetosql.cubeQueryToSQL)(params)
58
+ });
59
+ // Re-aggregate to reverse the unnest
60
+ const aggregatedSql = await (0, _meerkatcore.getAggregatedSql)({
61
+ resolvedTableSchema,
62
+ resolutionConfig,
63
+ contextParams,
64
+ cubeQueryToSQL: async (params)=>(0, _cubetosql.cubeQueryToSQL)(params)
65
+ });
66
+ return aggregatedSql;
36
67
  };
37
68
 
38
69
  //# sourceMappingURL=cube-to-sql-with-resolution.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../meerkat-node/src/cube-to-sql-with-resolution/cube-to-sql-with-resolution.ts"],"sourcesContent":["import {\n ContextParams,\n createBaseTableSchema,\n generateResolutionJoinPaths,\n generateResolutionSchemas,\n generateResolvedDimensions,\n Query,\n ResolutionConfig,\n TableSchema,\n} from '@devrev/meerkat-core';\nimport {\n cubeQueryToSQL,\n CubeQueryToSQLParams,\n} from '../cube-to-sql/cube-to-sql';\n\nexport interface CubeQueryToSQLWithResolutionParams {\n query: Query;\n tableSchemas: TableSchema[];\n resolutionConfig: ResolutionConfig;\n columnProjections?: string[];\n contextParams?: ContextParams;\n}\n\nexport const cubeQueryToSQLWithResolution = async ({\n query,\n tableSchemas,\n resolutionConfig,\n columnProjections,\n contextParams,\n}: CubeQueryToSQLWithResolutionParams) => {\n const baseSql = await cubeQueryToSQL({\n query,\n tableSchemas,\n contextParams,\n });\n\n if (resolutionConfig.columnConfigs.length === 0) {\n // If no resolution is needed, return the base SQL.\n return baseSql;\n }\n\n // Create a table schema for the base query.\n const baseTable: TableSchema = createBaseTableSchema(\n baseSql,\n tableSchemas,\n resolutionConfig,\n query.measures,\n query.dimensions\n );\n\n const resolutionSchemas: TableSchema[] = generateResolutionSchemas(\n resolutionConfig,\n tableSchemas\n );\n\n const resolveParams: CubeQueryToSQLParams = {\n query: {\n measures: [],\n dimensions: generateResolvedDimensions(\n query,\n resolutionConfig,\n columnProjections\n ),\n joinPaths: generateResolutionJoinPaths(resolutionConfig, tableSchemas),\n },\n tableSchemas: [baseTable, ...resolutionSchemas],\n };\n const sql = await cubeQueryToSQL(resolveParams);\n\n return sql;\n};\n"],"names":["cubeQueryToSQLWithResolution","query","tableSchemas","resolutionConfig","columnProjections","contextParams","baseSql","cubeQueryToSQL","columnConfigs","length","baseTable","createBaseTableSchema","measures","dimensions","resolutionSchemas","generateResolutionSchemas","resolveParams","generateResolvedDimensions","joinPaths","generateResolutionJoinPaths","sql"],"mappings":";+BAuBaA;;;eAAAA;;;6BAdN;2BAIA;AAUA,MAAMA,+BAA+B,OAAO,EACjDC,KAAK,EACLC,YAAY,EACZC,gBAAgB,EAChBC,iBAAiB,EACjBC,aAAa,EACsB;IACnC,MAAMC,UAAU,MAAMC,IAAAA,yBAAc,EAAC;QACnCN;QACAC;QACAG;IACF;IAEA,IAAIF,iBAAiBK,aAAa,CAACC,MAAM,KAAK,GAAG;QAC/C,mDAAmD;QACnD,OAAOH;IACT;IAEA,4CAA4C;IAC5C,MAAMI,YAAyBC,IAAAA,kCAAqB,EAClDL,SACAJ,cACAC,kBACAF,MAAMW,QAAQ,EACdX,MAAMY,UAAU;IAGlB,MAAMC,oBAAmCC,IAAAA,sCAAyB,EAChEZ,kBACAD;IAGF,MAAMc,gBAAsC;QAC1Cf,OAAO;YACLW,UAAU,EAAE;YACZC,YAAYI,IAAAA,uCAA0B,EACpChB,OACAE,kBACAC;YAEFc,WAAWC,IAAAA,wCAA2B,EAAChB,kBAAkBD;QAC3D;QACAA,cAAc;YAACQ;eAAcI;SAAkB;IACjD;IACA,MAAMM,MAAM,MAAMb,IAAAA,yBAAc,EAACS;IAEjC,OAAOI;AACT"}
1
+ {"version":3,"sources":["../../../meerkat-node/src/cube-to-sql-with-resolution/cube-to-sql-with-resolution.ts"],"sourcesContent":["import {\n BASE_DATA_SOURCE_NAME,\n ContextParams,\n getAggregatedSql as coreGetAggregatedSql,\n getResolvedTableSchema as coreGetResolvedTableSchema,\n getUnnestTableSchema as coreGetUnnestTableSchema,\n createBaseTableSchema,\n Dimension,\n generateRowNumberSql,\n memberKeyToSafeKey,\n Query,\n ResolutionConfig,\n ROW_ID_DIMENSION_NAME,\n shouldSkipResolution,\n TableSchema,\n} from '@devrev/meerkat-core';\nimport { cubeQueryToSQL } from '../cube-to-sql/cube-to-sql';\n\nexport interface CubeQueryToSQLWithResolutionParams {\n query: Query;\n tableSchemas: TableSchema[];\n resolutionConfig: ResolutionConfig;\n columnProjections?: string[];\n contextParams?: ContextParams;\n}\n\nexport const cubeQueryToSQLWithResolution = async ({\n query,\n tableSchemas,\n resolutionConfig,\n columnProjections,\n contextParams,\n}: CubeQueryToSQLWithResolutionParams) => {\n const baseSql = await cubeQueryToSQL({\n query,\n tableSchemas,\n contextParams,\n });\n\n // Check if resolution should be skipped\n if (shouldSkipResolution(resolutionConfig, query, columnProjections)) {\n return baseSql;\n }\n\n if (!columnProjections) {\n columnProjections = [...(query.dimensions || []), ...query.measures];\n }\n // This is to ensure that, only the column projection columns\n // are being resolved and other definitions are ignored.\n resolutionConfig.columnConfigs = resolutionConfig.columnConfigs.filter(\n (config) => {\n return columnProjections?.includes(config.name);\n }\n );\n\n const baseSchema: TableSchema = createBaseTableSchema(\n baseSql,\n tableSchemas,\n resolutionConfig,\n [],\n columnProjections\n );\n const rowIdDimension: Dimension = {\n name: ROW_ID_DIMENSION_NAME,\n sql: generateRowNumberSql(\n query,\n baseSchema.dimensions,\n BASE_DATA_SOURCE_NAME\n ),\n type: 'number',\n alias: ROW_ID_DIMENSION_NAME,\n };\n baseSchema.dimensions.push(rowIdDimension);\n columnProjections.push(ROW_ID_DIMENSION_NAME);\n\n // Doing this because we need to use the original name of the column in the base table schema.\n resolutionConfig.columnConfigs.forEach((config) => {\n config.name = memberKeyToSafeKey(config.name);\n });\n\n // Generate SQL with row_id and unnested arrays\n const unnestTableSchema = await coreGetUnnestTableSchema({\n baseTableSchema: baseSchema,\n resolutionConfig,\n contextParams,\n cubeQueryToSQL: async (params) => cubeQueryToSQL(params),\n });\n\n // Apply resolution (join with lookup tables)\n const resolvedTableSchema = await coreGetResolvedTableSchema({\n baseTableSchema: unnestTableSchema,\n resolutionConfig,\n contextParams,\n columnProjections,\n cubeQueryToSQL: async (params) => cubeQueryToSQL(params),\n });\n\n // Re-aggregate to reverse the unnest\n const aggregatedSql = await coreGetAggregatedSql({\n resolvedTableSchema,\n resolutionConfig,\n contextParams,\n cubeQueryToSQL: async (params) => cubeQueryToSQL(params),\n });\n\n return aggregatedSql;\n};\n"],"names":["cubeQueryToSQLWithResolution","query","tableSchemas","resolutionConfig","columnProjections","contextParams","baseSql","cubeQueryToSQL","shouldSkipResolution","dimensions","measures","columnConfigs","filter","config","includes","name","baseSchema","createBaseTableSchema","rowIdDimension","ROW_ID_DIMENSION_NAME","sql","generateRowNumberSql","BASE_DATA_SOURCE_NAME","type","alias","push","forEach","memberKeyToSafeKey","unnestTableSchema","coreGetUnnestTableSchema","baseTableSchema","params","resolvedTableSchema","coreGetResolvedTableSchema","aggregatedSql","coreGetAggregatedSql"],"mappings":";+BA0BaA;;;eAAAA;;;6BAXN;2BACwB;AAUxB,MAAMA,+BAA+B,OAAO,EACjDC,KAAK,EACLC,YAAY,EACZC,gBAAgB,EAChBC,iBAAiB,EACjBC,aAAa,EACsB;IACnC,MAAMC,UAAU,MAAMC,IAAAA,yBAAc,EAAC;QACnCN;QACAC;QACAG;IACF;IAEA,wCAAwC;IACxC,IAAIG,IAAAA,iCAAoB,EAACL,kBAAkBF,OAAOG,oBAAoB;QACpE,OAAOE;IACT;IAEA,IAAI,CAACF,mBAAmB;QACtBA,oBAAoB;eAAKH,MAAMQ,UAAU,IAAI,EAAE;eAAMR,MAAMS,QAAQ;SAAC;IACtE;IACA,6DAA6D;IAC7D,wDAAwD;IACxDP,iBAAiBQ,aAAa,GAAGR,iBAAiBQ,aAAa,CAACC,MAAM,CACpE,CAACC;QACC,OAAOT,qCAAAA,kBAAmBU,QAAQ,CAACD,OAAOE,IAAI;IAChD;IAGF,MAAMC,aAA0BC,IAAAA,kCAAqB,EACnDX,SACAJ,cACAC,kBACA,EAAE,EACFC;IAEF,MAAMc,iBAA4B;QAChCH,MAAMI,kCAAqB;QAC3BC,KAAKC,IAAAA,iCAAoB,EACvBpB,OACAe,WAAWP,UAAU,EACrBa,kCAAqB;QAEvBC,MAAM;QACNC,OAAOL,kCAAqB;IAC9B;IACAH,WAAWP,UAAU,CAACgB,IAAI,CAACP;IAC3Bd,kBAAkBqB,IAAI,CAACN,kCAAqB;IAE5C,8FAA8F;IAC9FhB,iBAAiBQ,aAAa,CAACe,OAAO,CAAC,CAACb;QACtCA,OAAOE,IAAI,GAAGY,IAAAA,+BAAkB,EAACd,OAAOE,IAAI;IAC9C;IAEA,+CAA+C;IAC/C,MAAMa,oBAAoB,MAAMC,IAAAA,iCAAwB,EAAC;QACvDC,iBAAiBd;QACjBb;QACAE;QACAE,gBAAgB,OAAOwB,SAAWxB,IAAAA,yBAAc,EAACwB;IACnD;IAEA,8CAA8C;IAC9C,MAAMC,sBAAsB,MAAMC,IAAAA,mCAA0B,EAAC;QAC3DH,iBAAiBF;QACjBzB;QACAE;QACAD;QACAG,gBAAgB,OAAOwB,SAAWxB,IAAAA,yBAAc,EAACwB;IACnD;IAEA,qCAAqC;IACrC,MAAMG,gBAAgB,MAAMC,IAAAA,6BAAoB,EAAC;QAC/CH;QACA7B;QACAE;QACAE,gBAAgB,OAAOwB,SAAWxB,IAAAA,yBAAc,EAACwB;IACnD;IAEA,OAAOG;AACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devrev/meerkat-node",
3
- "version": "0.0.104",
3
+ "version": "0.0.106",
4
4
  "dependencies": {
5
5
  "@swc/helpers": "~0.5.0",
6
6
  "@devrev/meerkat-core": "*",
@@ -287,6 +287,80 @@ export declare const TEST_DATA: ({
287
287
  vendors: string[];
288
288
  }[];
289
289
  } | {
290
+ testName: string;
291
+ expectedSQL: string;
292
+ cubeInput: {
293
+ measures: string[];
294
+ filters: {
295
+ member: string;
296
+ operator: string;
297
+ values: number[];
298
+ }[];
299
+ dimensions: never[];
300
+ };
301
+ expectedOutput: {
302
+ order_id: number;
303
+ customer_id: string;
304
+ product_id: string;
305
+ order_date: string;
306
+ order_amount: number;
307
+ orders__order_id: number;
308
+ vendors: string[];
309
+ }[];
310
+ } | {
311
+ testName: string;
312
+ expectedSQL: string;
313
+ cubeInput: {
314
+ measures: string[];
315
+ filters: {
316
+ and: {
317
+ member: string;
318
+ operator: string;
319
+ values: string[];
320
+ }[];
321
+ }[];
322
+ dimensions: never[];
323
+ };
324
+ expectedOutput: {
325
+ customer_id: string;
326
+ order_amount: number;
327
+ order_date: string;
328
+ order_id: number;
329
+ orders__order_date: undefined;
330
+ orders__vendors: string[];
331
+ product_id: string;
332
+ vendors: string[];
333
+ }[];
334
+ } | {
335
+ testName: string;
336
+ expectedSQL: string;
337
+ cubeInput: {
338
+ measures: string[];
339
+ filters: {
340
+ and: ({
341
+ member: string;
342
+ operator: string;
343
+ values: string[];
344
+ } | {
345
+ member: string;
346
+ operator: string;
347
+ values: number[];
348
+ })[];
349
+ }[];
350
+ dimensions: never[];
351
+ };
352
+ expectedOutput: {
353
+ order_id: number;
354
+ customer_id: string;
355
+ product_id: string;
356
+ order_date: string;
357
+ order_amount: number;
358
+ orders__customer_id: string;
359
+ orders__product_id: string;
360
+ orders__order_id: number;
361
+ vendors: string[];
362
+ }[];
363
+ })[] | ({
290
364
  testName: string;
291
365
  expectedSQL: string;
292
366
  cubeInput: {
@@ -305,9 +379,91 @@ export declare const TEST_DATA: ({
305
379
  order_amount: number;
306
380
  order_date: string;
307
381
  order_id: number;
382
+ orders__customer_id: string;
308
383
  orders__order_date: undefined;
309
384
  orders__vendors: string[];
310
385
  product_id: string;
311
386
  vendors: string[];
312
387
  }[];
388
+ } | {
389
+ testName: string;
390
+ expectedSQL: string;
391
+ cubeInput: {
392
+ measures: string[];
393
+ filters: {
394
+ member: string;
395
+ operator: string;
396
+ values: number[];
397
+ }[];
398
+ dimensions: never[];
399
+ };
400
+ expectedOutput: ({
401
+ order_id: number;
402
+ customer_id: string;
403
+ product_id: string;
404
+ order_date: string;
405
+ order_amount: number;
406
+ orders__order_id: number;
407
+ vendors: string[];
408
+ orders__order_date?: undefined;
409
+ } | {
410
+ order_id: number;
411
+ customer_id: null;
412
+ product_id: string;
413
+ order_date: string;
414
+ order_amount: number;
415
+ orders__order_id: number;
416
+ orders__order_date: undefined;
417
+ vendors: string[];
418
+ } | {
419
+ order_id: number;
420
+ customer_id: string;
421
+ product_id: string;
422
+ order_date: string;
423
+ order_amount: number;
424
+ orders__order_id: number;
425
+ orders__order_date: undefined;
426
+ vendors: string[];
427
+ })[];
428
+ } | {
429
+ testName: string;
430
+ expectedSQL: string;
431
+ cubeInput: {
432
+ measures: string[];
433
+ filters: {
434
+ and: ({
435
+ member: string;
436
+ operator: string;
437
+ values: string[];
438
+ } | {
439
+ member: string;
440
+ operator: string;
441
+ values: number[];
442
+ })[];
443
+ }[];
444
+ dimensions: never[];
445
+ };
446
+ expectedOutput: ({
447
+ order_id: number;
448
+ customer_id: string;
449
+ product_id: string;
450
+ order_date: string;
451
+ order_amount: number;
452
+ orders__customer_id: string;
453
+ orders__product_id: string;
454
+ orders__order_id: number;
455
+ vendors: string[];
456
+ orders__order_date?: undefined;
457
+ } | {
458
+ order_id: number;
459
+ customer_id: string;
460
+ product_id: string;
461
+ order_date: string;
462
+ order_amount: number;
463
+ orders__customer_id: string;
464
+ orders__product_id: string;
465
+ orders__order_id: number;
466
+ orders__order_date: undefined;
467
+ vendors: string[];
468
+ })[];
313
469
  })[])[];