This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PUT courses-02 | |
| { | |
| "settings": { | |
| "analysis": { | |
| "char_filter": { | |
| "email_dot_replacer": { | |
| "type": "mapping", | |
| "mappings": [ | |
| ". => -" | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PUT courses-01/_doc/A123?pipeline=test_p2 | |
| { | |
| "instructors": "donna.karen@uni.gov,jojo.star.crusade@uni.gov", | |
| "course": { | |
| "name": "Introduction to Economics", | |
| "medium": "zoom" | |
| } | |
| } | |
| /* search */ | |
| GET courses-01/_search |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PUT _ingest/pipeline/test_p2 | |
| { | |
| "processors": [ | |
| { | |
| "gsub": { | |
| "field": "instructors", | |
| "pattern": "\\.", | |
| "replacement": "-" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| POST _analyze | |
| { | |
| "analyzer": "standard", | |
| "text": ["jojo.star.crusade@uni.gov"] | |
| } | |
| ... | |
| /* results */ | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PUT courses-00/_doc/A123 | |
| { | |
| "instructors": "donna.karen@uni.gov,jojo.star.crusade@uni.gov", | |
| "course": { | |
| "name": "Introduction to Economics", | |
| "medium": "zoom" | |
| } | |
| } | |
| /* somehow no results return by supplying a partial email address like "jojo" */ | |
| GET courses-00/_search |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # add another column... to test the confusing | |
| ALTER TABLE test_summing_tree | |
| ADD COLUMN `country` String; | |
| # empty the table | |
| ALTER TABLE test_summing_tree | |
| DELETE WHERE 1 = 1; | |
| # add records again with some confusions of the country value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE test_summing_tree | |
| ( | |
| `brand` String, | |
| `sold_at` DateTime, | |
| `qty` UInt32, | |
| `price` Float | |
| ) | |
| ENGINE = SummingMergeTree((qty, price)) | |
| PARTITION BY toYYYYMM(sold_at) | |
| ORDER BY (sold_at, brand); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE MATERIALIZED VIEW mv_transactions_2 TO transactions4report2 AS | |
| SELECT | |
| customerID, | |
| p.name as paymentName, | |
| qty, | |
| price, | |
| ts | |
| FROM transactions AS t, paymentMethod AS p | |
| WHERE t.paymentMethod = p.id; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # create the helper tables | |
| CREATE TABLE IF NOT EXISTS paymentMethod | |
| ( | |
| `id` Int, | |
| `name` String | |
| ) | |
| ENGINE = MergeTree | |
| ORDER BY id; | |
| insert into paymentMethod values (0, 'cash'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # create a target table | |
| CREATE TABLE IF NOT EXISTS transactions4report | |
| ( | |
| `customerID` String, | |
| `paymentMethod` Int, | |
| `qty` Int, | |
| `price` Float, | |
| `ts` dateTime | |
| ) | |
| ENGINE = MergeTree |