├── .gitignore ├── LICENSE ├── README.md ├── bootstrap.sh ├── docker-compose.yml ├── docker ├── .env ├── README.md ├── docker-entrypoint.sh ├── docker-init.sh ├── frontend-mem-nag.sh ├── pinot-dashboard.json ├── pinot-database.yml └── pythonpath_dev │ ├── .gitignore │ ├── superset_config.py │ └── superset_config_local.example └── import ├── import-russian-troll-tweets.sh ├── russian-troll-tweets-job-spec.yml ├── russian-troll-tweets-schema.json ├── russian-troll-tweets-table-config.json ├── tweet-text-entities-job-spec.yml ├── tweet-text-entities-schema.json └── tweet-text-entities-table-config.json /.gitignore: -------------------------------------------------------------------------------- 1 | rawdata 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Time Series Analysis of Russian IRA Tweets 2 | 3 | This repository contains a recipe for bootstrapping a project that does time series analysis on tweets from the [Internet Research Agency (IRA) open sourced by FiveThirtyEight](https://github.com/fivethirtyeight/russian-troll-tweets). The analysis in this project is bootstrapped using Apache Pinot and Superset. 4 | 5 | #### Warning! 6 | 7 | This dataset contains some of the most offensive and toxic text I've ever seen. The tweets contained within the original dataset attempted to hide or obscure the ideological nature of text that the trolls intended to bleed into mainstream media. 8 | 9 | The raw text of tweets contained within the dataset will elicit an emotional response, as it was designed to do, and as such, I do not recommend exposing the raw text to any reader without providing this warning. 10 | 11 | ## Usage 12 | 13 | The example application in this repository bootstraps an Apache Pinot recipe for importing tweets by fake IRA Twitter accounts for analysis with Apache Superset. 14 | 15 | To start the cluster, run the following commands. 16 | 17 | ```bash 18 | $ docker network create PinotNetwork 19 | $ docker-compose up -d 20 | $ docker-compose logs -f --tail=100 21 | ``` 22 | 23 | After the Docker containers have started and are running, you'll need to bootstrap the cluster with the Twitter data and charts. The following command will download the raw CSV data from [this repository](https://github.com/kbastani/russian-troll-tweets) and start the Pinot ingestion job. 24 | 25 | ```bash 26 | $ sh ./bootstrap.sh 27 | ``` 28 | 29 | After the bootstrap script has completed, you should be able to see data in Apache Pinot and be able to login to the Superset website. After logging into Superset, navigate to the dashboards to view the time series analysis of the IRA tweets. 30 | 31 | ## Example Dashboard 32 | 33 | The screenshot below is the default dashboard that comes with the example project. 34 | 35 | ![Superset Russian Troll Dashboard](https://imgur.com/RBCiOKq.png) 36 | -------------------------------------------------------------------------------- /bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker exec -ti pinot_app_ira bash -c "apt-get update" 4 | 5 | docker exec -ti pinot_app_ira bash -c "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" 6 | 7 | docker exec -ti pinot_app_ira bash -c "apt-get install git-lfs" 8 | 9 | docker exec -ti pinot_app_ira bash -c "git clone https://github.com/kbastani/russian-troll-tweets.git" 10 | 11 | # Imports data into Apache Pinot 12 | docker exec -ti pinot_app_ira bash -c "sh ./import/import-russian-troll-tweets.sh" 13 | 14 | # Initializes the Superset application and imports datasources and dashboards 15 | docker exec -ti -u root superset_app_ira bash -c "sh ./docker-init.sh" 16 | 17 | # Open the browser for Pinot and Superset 18 | open http://localhost:9000 19 | open http://localhost:8088 20 | 21 | echo "Success! Login to Superset using the credentials admin/admin" 22 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | x-superset-depends-on: &superset-depends-on 18 | - db 19 | - redis 20 | x-pinot-depends-on: &pinot-depends-on 21 | - db 22 | - redis 23 | - superset 24 | x-superset-volumes: &superset-volumes 25 | - ./docker/docker-init.sh:/app/docker-init.sh 26 | - ./docker/pinot-dashboard.json:/app/pinot-dashboard.json 27 | - ./docker/pinot-database.yml:/app/pinot-database.yml 28 | - ./docker/pythonpath_dev:/app/pythonpath 29 | - superset_home:/app/superset_home 30 | x-pinot-volumes: &pinot-volumes 31 | - ./import:/opt/pinot/import 32 | 33 | version: "3.7" 34 | 35 | services: 36 | redis: 37 | image: kbastani2/noaa-pinot-superset-cache 38 | container_name: superset_cache_ira 39 | restart: unless-stopped 40 | ports: 41 | - "127.0.0.1:6379:6379" 42 | volumes: 43 | - redis:/data 44 | networks: 45 | - PinotNetwork 46 | 47 | db: 48 | env_file: docker/.env 49 | image: kbastani2/noaa-pinot-superset-db 50 | container_name: superset_db_ira 51 | restart: unless-stopped 52 | ports: 53 | - "127.0.0.1:5432:5432" 54 | volumes: 55 | - db_home:/var/lib/postgresql/data 56 | networks: 57 | - PinotNetwork 58 | 59 | superset: 60 | env_file: docker/.env 61 | image: kbastani2/noaa-pinot-superset-app 62 | container_name: superset_app_ira 63 | command: ["flask", "run", "-p", "8088", "--with-threads", "--reload", "--debugger", "--host=0.0.0.0"] 64 | restart: unless-stopped 65 | ports: 66 | - 8088:8088 67 | depends_on: *superset-depends-on 68 | volumes: *superset-volumes 69 | networks: 70 | - PinotNetwork 71 | 72 | pinot: 73 | image: apachepinot/pinot:0.5.0 74 | container_name: pinot_app_ira 75 | command: ["QuickStart", "-type", "BATCH"] 76 | restart: unless-stopped 77 | ports: 78 | - 8000:8000 79 | - 9000:9000 80 | depends_on: *pinot-depends-on 81 | volumes: *pinot-volumes 82 | networks: 83 | - PinotNetwork 84 | 85 | networks: 86 | PinotNetwork: 87 | external: 88 | name: PinotNetwork 89 | 90 | volumes: 91 | superset_home: 92 | external: false 93 | db_home: 94 | external: false 95 | redis: 96 | external: false 97 | -------------------------------------------------------------------------------- /docker/.env: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | COMPOSE_PROJECT_NAME=superset 18 | 19 | # database configurations (do not modify) 20 | DATABASE_DB=superset 21 | DATABASE_HOST=db 22 | DATABASE_PASSWORD=superset 23 | DATABASE_USER=superset 24 | MAPBOX_API_KEY=pk.eyJ1Ijoia2Jhc3RhbmkiLCJhIjoiY2tlajU5eHN5MW41ZjJ6cHF4bHM5bGc3cyJ9.UM3lQOo7NkgCnTdn8nMQuw 25 | 26 | # database engine specific environment variables 27 | # change the below if you prefers another database engine 28 | DATABASE_PORT=5432 29 | DATABASE_DIALECT=postgresql 30 | POSTGRES_DB=superset 31 | POSTGRES_USER=superset 32 | POSTGRES_PASSWORD=superset 33 | #MYSQL_DATABASE=superset 34 | #MYSQL_USER=superset 35 | #MYSQL_PASSWORD=superset 36 | #MYSQL_RANDOM_ROOT_PASSWORD=yes 37 | 38 | # Add the mapped in /app/pythonpath_docker which allows devs to override stuff 39 | PYTHONPATH=/app/pythonpath:/app/pythonpath_docker 40 | REDIS_HOST=redis 41 | REDIS_PORT=6379 42 | 43 | FLASK_ENV=development 44 | SUPERSET_ENV=development 45 | SUPERSET_LOAD_EXAMPLES=yes 46 | -------------------------------------------------------------------------------- /docker/README.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # Getting Started with Superset using Docker 21 | 22 | Docker is an easy way to get started with Superset. 23 | 24 | ## Prerequisites 25 | 26 | 1. Docker! [link](https://www.docker.com/get-started) 27 | 1. Docker-compose [link](https://docs.docker.com/compose/install/) 28 | 29 | ## Configuration 30 | 31 | The `/app/pythonpath` folder is mounted from [./docker/pythonpath_dev](./docker/pythonpath_dev) 32 | which contains a base configuration [./docker/pythonpath/superset_config.py](./docker/pythonpath/superset_config.py) 33 | intended for use with local development. 34 | 35 | ### Local overrides 36 | 37 | In order to override configuration settings locally, simply make a copy of [./docker/pythonpath/superset_config_local.example](./docker/pythonpath/superset_config_local.example) 38 | into [./docker/pythonpath/superset_config_docker.py](./docker/pythonpath/superset_config_docker.py) (git ignored) and fill in your overrides. 39 | 40 | ### Local packages 41 | 42 | If you want to add python packages in order to test things like DBs locally, you can simply add a local requirements.txt (./docker/requirements-local.txt) 43 | and rebuild your docker stack. 44 | 45 | Steps: 46 | 1. Create ./docker/requirements-local.txt 47 | 2. Add your new packages 48 | 3. Rebuild docker-compose 49 | a. `docker-compose down -v` 50 | b. `docker-compose up` 51 | 52 | ## Initializing Database 53 | 54 | The DB will initialize itself upon startup via the init container (superset-init) 55 | (This may take a minute.) 56 | 57 | ## Normal Operation 58 | 59 | To run the container, simply run: 60 | 61 | ```bash 62 | docker-compose up 63 | ``` 64 | 65 | After several minutes for superset initialization to finish, you can open a browser and view [`http://localhost:8088`](http://localhost:8088) 66 | to start your journey. 67 | 68 | ## Developing 69 | 70 | While running, the container server will reload on modification of the superset python and javascript source code. 71 | Don't forget to reload the page to take the new frontend into account though. 72 | 73 | ## Production 74 | 75 | It is also possible to run Superset in non-development mode: in the `docker-compose.yml` file remove 76 | the volumes needed for development and change the variable `SUPERSET_ENV` to `production`. 77 | 78 | ## Resource Constraints 79 | 80 | If you are attempting to build on a Mac and it exits with 137 you need to increase your docker resources. 81 | OSX instructions: https://docs.docker.com/docker-for-mac/#advanced (Search for memory) 82 | -------------------------------------------------------------------------------- /docker/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | set -eo pipefail 19 | 20 | if [ "${#}" -ne 0 ]; then 21 | exec "${@}" 22 | else 23 | gunicorn \ 24 | --bind "0.0.0.0:${SUPERSET_PORT}" \ 25 | --access-logfile '-' \ 26 | --error-logfile '-' \ 27 | --workers 1 \ 28 | --worker-class gthread \ 29 | --threads 20 \ 30 | --timeout 60 \ 31 | --limit-request-line 0 \ 32 | --limit-request-field_size 0 \ 33 | "${FLASK_APP}" 34 | fi 35 | -------------------------------------------------------------------------------- /docker/docker-init.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | set -e 19 | 20 | STEP_CNT=6 21 | 22 | echo_step() { 23 | cat <", 1354 | "created_by_fk": null, 1355 | "created_on": { 1356 | "__datetime__": "2020-10-13T15:49:39" 1357 | }, 1358 | "description": null, 1359 | "expression": "DATETIMECONVERT(epoch_timestamp, '1:MILLISECONDS:EPOCH', '1:MILLISECONDS:EPOCH', '30:DAYS')", 1360 | "filterable": true, 1361 | "groupby": true, 1362 | "id": 1, 1363 | "is_active": null, 1364 | "is_dttm": true, 1365 | "python_date_format": "epoch_ms", 1366 | "table_id": 1, 1367 | "type": null, 1368 | "verbose_name": "published_day" 1369 | } 1370 | } 1371 | ], 1372 | "database_id": 1, 1373 | "default_endpoint": null, 1374 | "description": null, 1375 | "fetch_values_predicate": null, 1376 | "filter_select_enabled": false, 1377 | "main_dttm_col": null, 1378 | "metrics": [ 1379 | { 1380 | "__SqlMetric__": { 1381 | "changed_by_fk": null, 1382 | "changed_on": { 1383 | "__datetime__": "2020-10-13T15:49:39" 1384 | }, 1385 | "created_by_fk": null, 1386 | "created_on": { 1387 | "__datetime__": "2020-10-13T15:49:39" 1388 | }, 1389 | "d3format": null, 1390 | "description": null, 1391 | "expression": "COUNT(*)", 1392 | "id": 1, 1393 | "metric_name": "count", 1394 | "metric_type": null, 1395 | "table_id": 1, 1396 | "verbose_name": "COUNT(*)", 1397 | "warning_text": null 1398 | } 1399 | } 1400 | ], 1401 | "offset": 0, 1402 | "params": "{\"remote_id\": 1, \"database_name\": \"pinot\", \"import_time\": 1602604183}", 1403 | "schema": null, 1404 | "sql": null, 1405 | "table_name": "russianTrollTweets", 1406 | "template_params": null 1407 | } 1408 | } 1409 | ] 1410 | } 1411 | -------------------------------------------------------------------------------- /docker/pinot-database.yml: -------------------------------------------------------------------------------- 1 | databases: 2 | - database_name: pinot 3 | extra: "{\r\n \"metadata_params\": {},\r\n \"engine_params\": {},\r\n \"\ 4 | metadata_cache_timeout\": {},\r\n \"schemas_allowed_for_csv_upload\": []\r\n\ 5 | }" 6 | sqlalchemy_uri: pinot+http://pinot:8000/query?server=http%3A%2F%2Fpinot%3A9000%2F 7 | tables: 8 | - columns: 9 | - column_name: 10 | expression: DATETIMECONVERT(epoch_timestamp, '1:MILLISECONDS:EPOCH', '1:MILLISECONDS:EPOCH', 11 | '30:DAYS') 12 | is_dttm: true 13 | python_date_format: epoch_ms 14 | verbose_name: published_day 15 | - column_name: epoch_timestamp 16 | is_dttm: true 17 | python_date_format: epoch_ms 18 | type: LONG 19 | - column_name: new_june_2018 20 | type: LONG 21 | - column_name: tco1_step1 22 | type: STRING 23 | - column_name: tco2_step1 24 | type: STRING 25 | - column_name: tco3_step1 26 | type: STRING 27 | - column_name: external_author_id 28 | type: STRING 29 | - column_name: alt_external_id 30 | type: STRING 31 | - column_name: account_category 32 | type: STRING 33 | - column_name: harvested_date 34 | type: STRING 35 | - column_name: publish_date 36 | type: STRING 37 | - column_name: account_type 38 | type: STRING 39 | - column_name: article_url 40 | type: STRING 41 | - column_name: tweet_id 42 | type: STRING 43 | - column_name: post_type 44 | type: STRING 45 | - column_name: language 46 | type: STRING 47 | - column_name: author 48 | type: STRING 49 | - column_name: content 50 | type: STRING 51 | - column_name: region 52 | type: STRING 53 | - column_name: updates 54 | type: LONG 55 | - column_name: retweet 56 | type: LONG 57 | - column_name: followers 58 | type: LONG 59 | - column_name: following 60 | type: LONG 61 | metrics: 62 | - expression: COUNT(*) 63 | metric_name: count 64 | verbose_name: COUNT(*) 65 | params: '{"remote_id": 1, "database_name": "pinot", "import_time": 1600905429}' 66 | table_name: russianTrollTweets 67 | - columns: 68 | - column_name: epoch_timestamp 69 | is_dttm: true 70 | python_date_format: epoch_ms 71 | type: LONG 72 | - column_name: new_june_2018 73 | type: LONG 74 | - column_name: tco1_step1 75 | type: STRING 76 | - column_name: tco2_step1 77 | type: STRING 78 | - column_name: tco3_step1 79 | type: STRING 80 | - column_name: external_author_id 81 | type: STRING 82 | - column_name: alt_external_id 83 | type: STRING 84 | - column_name: account_category 85 | type: STRING 86 | - column_name: harvested_date 87 | type: STRING 88 | - column_name: publish_date 89 | type: STRING 90 | - column_name: account_type 91 | type: STRING 92 | - column_name: entity_category 93 | type: STRING 94 | - column_name: article_url 95 | type: STRING 96 | - column_name: entity_name 97 | type: STRING 98 | - column_name: tweet_id 99 | type: STRING 100 | - column_name: post_type 101 | type: STRING 102 | - column_name: language 103 | type: STRING 104 | - column_name: author 105 | type: STRING 106 | - column_name: content 107 | type: STRING 108 | - column_name: region 109 | type: STRING 110 | - column_name: updates 111 | type: LONG 112 | - column_name: retweet 113 | type: LONG 114 | - column_name: followers 115 | type: LONG 116 | - column_name: following 117 | type: LONG 118 | metrics: 119 | - expression: COUNT(*) 120 | metric_name: count 121 | verbose_name: COUNT(*) 122 | table_name: tweetTextEntities 123 | -------------------------------------------------------------------------------- /docker/pythonpath_dev/.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # Ignore everything 19 | * 20 | # DON'T ignore the .gitignore 21 | !.gitignore 22 | !superset_config.py 23 | !superset_config_local.example 24 | -------------------------------------------------------------------------------- /docker/pythonpath_dev/superset_config.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # 19 | # This file is included in the final Docker image and SHOULD be overridden when 20 | # deploying the image to prod. Settings configured here are intended for use in local 21 | # development environments. Also note that superset_config_docker.py is imported 22 | # as a final step as a means to override "defaults" configured here 23 | # 24 | 25 | import logging 26 | import os 27 | 28 | from cachelib.file import FileSystemCache 29 | 30 | logger = logging.getLogger() 31 | 32 | 33 | def get_env_variable(var_name, default=None): 34 | """Get the environment variable or raise exception.""" 35 | try: 36 | return os.environ[var_name] 37 | except KeyError: 38 | if default is not None: 39 | return default 40 | else: 41 | error_msg = "The environment variable {} was missing, abort...".format( 42 | var_name 43 | ) 44 | raise EnvironmentError(error_msg) 45 | 46 | 47 | DATABASE_DIALECT = get_env_variable("DATABASE_DIALECT") 48 | DATABASE_USER = get_env_variable("DATABASE_USER") 49 | DATABASE_PASSWORD = get_env_variable("DATABASE_PASSWORD") 50 | DATABASE_HOST = get_env_variable("DATABASE_HOST") 51 | DATABASE_PORT = get_env_variable("DATABASE_PORT") 52 | DATABASE_DB = get_env_variable("DATABASE_DB") 53 | 54 | # The SQLAlchemy connection string. 55 | SQLALCHEMY_DATABASE_URI = "%s://%s:%s@%s:%s/%s" % ( 56 | DATABASE_DIALECT, 57 | DATABASE_USER, 58 | DATABASE_PASSWORD, 59 | DATABASE_HOST, 60 | DATABASE_PORT, 61 | DATABASE_DB, 62 | ) 63 | 64 | REDIS_HOST = get_env_variable("REDIS_HOST") 65 | REDIS_PORT = get_env_variable("REDIS_PORT") 66 | REDIS_CELERY_DB = get_env_variable("REDIS_CELERY_DB", 0) 67 | REDIS_RESULTS_DB = get_env_variable("REDIS_CELERY_DB", 1) 68 | 69 | 70 | RESULTS_BACKEND = FileSystemCache("/app/superset_home/sqllab") 71 | 72 | 73 | class CeleryConfig(object): 74 | BROKER_URL = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_CELERY_DB}" 75 | CELERY_IMPORTS = ("superset.sql_lab",) 76 | CELERY_RESULT_BACKEND = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_RESULTS_DB}" 77 | CELERY_ANNOTATIONS = {"tasks.add": {"rate_limit": "10/s"}} 78 | CELERY_TASK_PROTOCOL = 1 79 | 80 | 81 | CELERY_CONFIG = CeleryConfig 82 | SQLLAB_CTAS_NO_LIMIT = True 83 | 84 | # 85 | # Optionally import superset_config_docker.py (which will have been included on 86 | # the PYTHONPATH) in order to allow for local settings to be overridden 87 | # 88 | try: 89 | import superset_config_docker 90 | from superset_config_docker import * # noqa 91 | 92 | logger.info( 93 | f"Loaded your Docker configuration at " f"[{superset_config_docker.__file__}]" 94 | ) 95 | except ImportError: 96 | logger.info("Using default Docker config...") 97 | -------------------------------------------------------------------------------- /docker/pythonpath_dev/superset_config_local.example: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # 19 | # This is an example "local" configuration file. In order to set/override config 20 | # options that ONLY apply to your local environment, simply copy/rename this file 21 | # to docker/pythonpath/superset_config_docker.py 22 | # It ends up being imported by docker/superset_config.py which is loaded by 23 | # superset/config.py 24 | # 25 | 26 | SQLALCHEMY_DATABASE_URI = "postgresql+psycopg2://pguser:pgpwd@some.host/superset" 27 | SQLALCHEMY_ECHO = True 28 | -------------------------------------------------------------------------------- /import/import-russian-troll-tweets.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Adding 'russianTrollTweets' table to Pinot..." 4 | 5 | # Adds a new Pinot table for the NOAA storm event data 6 | /opt/pinot/bin/pinot-admin.sh AddTable -tableConfigFile /opt/pinot/import/russian-troll-tweets-table-config.json -schemaFile /opt/pinot/import/russian-troll-tweets-schema.json -exec 7 | /opt/pinot/bin/pinot-admin.sh AddTable -tableConfigFile /opt/pinot/import/tweet-text-entities-table-config.json -schemaFile /opt/pinot/import/tweet-text-entities-schema.json -exec 8 | 9 | FILES=./russian-troll-tweets/*.csv 10 | 11 | # Move downloaded CSV files to subdirectory 12 | mkdir /opt/pinot/import/rawdata 13 | mv $FILES /opt/pinot/import/rawdata 14 | 15 | echo "Russian troll tweets downloaded!" 16 | echo "Launching Pinot data ingestion job from raw CSV files..." 17 | 18 | # Launch batch ingestion job from raw CSV files into Pinot 19 | /opt/pinot/bin/pinot-admin.sh LaunchDataIngestionJob -jobSpecFile /opt/pinot/import/russian-troll-tweets-job-spec.yml 20 | /opt/pinot/bin/pinot-admin.sh LaunchDataIngestionJob -jobSpecFile /opt/pinot/import/tweet-text-entities-job-spec.yml 21 | -------------------------------------------------------------------------------- /import/russian-troll-tweets-job-spec.yml: -------------------------------------------------------------------------------- 1 | executionFrameworkSpec: 2 | name: 'standalone' 3 | segmentGenerationJobRunnerClassName: 'org.apache.pinot.plugin.ingestion.batch.standalone.SegmentGenerationJobRunner' 4 | segmentTarPushJobRunnerClassName: 'org.apache.pinot.plugin.ingestion.batch.standalone.SegmentTarPushJobRunner' 5 | segmentUriPushJobRunnerClassName: 'org.apache.pinot.plugin.ingestion.batch.standalone.SegmentUriPushJobRunner' 6 | jobType: SegmentCreationAndTarPush 7 | inputDirURI: '/opt/pinot/import/rawdata/' 8 | includeFileNamePattern: 'glob:**/IRA*.csv' 9 | outputDirURI: '/tmp/pinot-storm-analytics/segments/' 10 | overwriteOutput: true 11 | pinotFSSpecs: 12 | - scheme: file 13 | className: org.apache.pinot.spi.filesystem.LocalPinotFS 14 | recordReaderSpec: 15 | dataFormat: 'csv' 16 | className: 'org.apache.pinot.plugin.inputformat.csv.CSVRecordReader' 17 | configClassName: 'org.apache.pinot.plugin.inputformat.csv.CSVRecordReaderConfig' 18 | configs: 19 | multiValueDelimiter: '' 20 | tableSpec: 21 | tableName: 'russianTrollTweets' 22 | schemaURI: 'http://localhost:9000/tables/russianTrollTweets/schema' 23 | tableConfigURI: 'http://localhost:9000/tables/russianTrollTweets' 24 | pinotClusterSpecs: 25 | - controllerURI: 'http://localhost:9000' 26 | -------------------------------------------------------------------------------- /import/russian-troll-tweets-schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaName":"russianTrollTweets", 3 | "dimensionFieldSpecs":[ 4 | { 5 | "name":"external_author_id", 6 | "dataType":"STRING" 7 | }, 8 | { 9 | "name":"author", 10 | "dataType":"STRING" 11 | }, 12 | { 13 | "name":"content", 14 | "dataType":"STRING" 15 | }, 16 | { 17 | "name":"region", 18 | "dataType":"STRING" 19 | }, 20 | { 21 | "name":"language", 22 | "dataType":"STRING" 23 | }, 24 | { 25 | "name":"following", 26 | "dataType":"INT" 27 | }, 28 | { 29 | "name":"followers", 30 | "dataType":"INT" 31 | }, 32 | { 33 | "name":"updates", 34 | "dataType":"INT" 35 | }, 36 | { 37 | "name":"post_type", 38 | "dataType":"STRING" 39 | }, 40 | { 41 | "name":"account_type", 42 | "dataType":"STRING" 43 | }, 44 | { 45 | "name":"retweet", 46 | "dataType":"INT" 47 | }, 48 | { 49 | "name":"account_category", 50 | "dataType":"STRING" 51 | }, 52 | { 53 | "name":"new_june_2018", 54 | "dataType":"INT" 55 | }, 56 | { 57 | "name":"alt_external_id", 58 | "dataType":"STRING" 59 | }, 60 | { 61 | "name":"tweet_id", 62 | "dataType":"STRING" 63 | }, 64 | { 65 | "name":"article_url", 66 | "dataType":"STRING" 67 | }, 68 | { 69 | "name":"tco1_step1", 70 | "dataType":"STRING" 71 | }, 72 | { 73 | "name":"tco2_step1", 74 | "dataType":"STRING" 75 | }, 76 | { 77 | "name":"tco3_step1", 78 | "dataType":"STRING" 79 | } 80 | ], 81 | "dateTimeFieldSpecs":[ 82 | { 83 | "name":"epoch_timestamp", 84 | "dataType":"LONG", 85 | "format":"1:MINUTES:EPOCH", 86 | "granularity":"1:MINUTES" 87 | }, 88 | { 89 | "name":"publish_date", 90 | "dataType":"STRING", 91 | "format":"1:MINUTES:SIMPLE_DATE_FORMAT:MM/dd/yyyy HH:mm", 92 | "granularity":"1:MINUTES" 93 | }, 94 | { 95 | "name":"harvested_date", 96 | "dataType":"STRING", 97 | "format":"1:MINUTES:SIMPLE_DATE_FORMAT:MM/dd/yyyy HH:mm", 98 | "granularity":"1:MINUTES" 99 | } 100 | ] 101 | } 102 | -------------------------------------------------------------------------------- /import/russian-troll-tweets-table-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "tableName":"russianTrollTweets", 3 | "segmentsConfig":{ 4 | "segmentAssignmentStrategy":"BalanceNumSegmentAssignmentStrategy", 5 | "segmentPushType":"APPEND", 6 | "schemaName":"russianTrollTweets", 7 | "replication":1 8 | }, 9 | "fieldConfigList":[ 10 | { 11 | "name":"content", 12 | "encodingType":"RAW", 13 | "indexType":"TEXT" 14 | }, 15 | { 16 | "name":"article_url", 17 | "encodingType":"RAW", 18 | "indexType":"TEXT" 19 | }, 20 | { 21 | "name":"tco1_step1", 22 | "encodingType":"RAW", 23 | "indexType":"TEXT" 24 | } 25 | ], 26 | "tableIndexConfig":{ 27 | "noDictionaryColumns":[ 28 | "content", 29 | "article_url", 30 | "tco1_step1" 31 | ], 32 | "loadMode":"MMAP" 33 | }, 34 | "tenants":{ 35 | "broker":"DefaultTenant", 36 | "server":"DefaultTenant" 37 | }, 38 | "tableType":"OFFLINE", 39 | "metadata":{ 40 | "customConfigs":{ 41 | 42 | } 43 | }, 44 | "ingestionConfig":{ 45 | "transformConfigs":[ 46 | { 47 | "columnName":"epoch_timestamp", 48 | "transformFunction":"fromDateTime(publish_date, 'MM/dd/yyyy HH:mm')" 49 | } 50 | ] 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /import/tweet-text-entities-job-spec.yml: -------------------------------------------------------------------------------- 1 | executionFrameworkSpec: 2 | name: 'standalone' 3 | segmentGenerationJobRunnerClassName: 'org.apache.pinot.plugin.ingestion.batch.standalone.SegmentGenerationJobRunner' 4 | segmentTarPushJobRunnerClassName: 'org.apache.pinot.plugin.ingestion.batch.standalone.SegmentTarPushJobRunner' 5 | segmentUriPushJobRunnerClassName: 'org.apache.pinot.plugin.ingestion.batch.standalone.SegmentUriPushJobRunner' 6 | jobType: SegmentCreationAndTarPush 7 | inputDirURI: '/opt/pinot/import/rawdata/' 8 | includeFileNamePattern: 'glob:**/NER_*.csv' 9 | outputDirURI: '/tmp/tweet-text-entities/segments/' 10 | overwriteOutput: true 11 | pinotFSSpecs: 12 | - scheme: file 13 | className: org.apache.pinot.spi.filesystem.LocalPinotFS 14 | recordReaderSpec: 15 | dataFormat: 'csv' 16 | className: 'org.apache.pinot.plugin.inputformat.csv.CSVRecordReader' 17 | configClassName: 'org.apache.pinot.plugin.inputformat.csv.CSVRecordReaderConfig' 18 | configs: 19 | multiValueDelimiter: '' 20 | tableSpec: 21 | tableName: 'tweetTextEntities' 22 | schemaURI: 'http://localhost:9000/tables/tweetTextEntities/schema' 23 | tableConfigURI: 'http://localhost:9000/tables/tweetTextEntities' 24 | pinotClusterSpecs: 25 | - controllerURI: 'http://localhost:9000' 26 | -------------------------------------------------------------------------------- /import/tweet-text-entities-schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaName":"tweetTextEntities", 3 | "dimensionFieldSpecs":[ 4 | { 5 | "name":"external_author_id", 6 | "dataType":"STRING" 7 | }, 8 | { 9 | "name":"author", 10 | "dataType":"STRING" 11 | }, 12 | { 13 | "name":"content", 14 | "dataType":"STRING" 15 | }, 16 | { 17 | "name":"region", 18 | "dataType":"STRING" 19 | }, 20 | { 21 | "name":"language", 22 | "dataType":"STRING" 23 | }, 24 | { 25 | "name":"following", 26 | "dataType":"INT" 27 | }, 28 | { 29 | "name":"followers", 30 | "dataType":"INT" 31 | }, 32 | { 33 | "name":"updates", 34 | "dataType":"INT" 35 | }, 36 | { 37 | "name":"post_type", 38 | "dataType":"STRING" 39 | }, 40 | { 41 | "name":"account_type", 42 | "dataType":"STRING" 43 | }, 44 | { 45 | "name":"retweet", 46 | "dataType":"INT" 47 | }, 48 | { 49 | "name":"account_category", 50 | "dataType":"STRING" 51 | }, 52 | { 53 | "name":"new_june_2018", 54 | "dataType":"INT" 55 | }, 56 | { 57 | "name":"alt_external_id", 58 | "dataType":"STRING" 59 | }, 60 | { 61 | "name":"tweet_id", 62 | "dataType":"STRING" 63 | }, 64 | { 65 | "name":"article_url", 66 | "dataType":"STRING" 67 | }, 68 | { 69 | "name":"tco1_step1", 70 | "dataType":"STRING" 71 | }, 72 | { 73 | "name":"tco2_step1", 74 | "dataType":"STRING" 75 | }, 76 | { 77 | "name":"tco3_step1", 78 | "dataType":"STRING" 79 | }, 80 | { 81 | "name":"entity_category", 82 | "dataType":"STRING" 83 | }, 84 | { 85 | "name":"entity_name", 86 | "dataType":"STRING" 87 | } 88 | ], 89 | "dateTimeFieldSpecs":[ 90 | { 91 | "name":"epoch_timestamp", 92 | "dataType":"LONG", 93 | "format":"1:MINUTES:EPOCH", 94 | "granularity":"1:MINUTES" 95 | }, 96 | { 97 | "name":"publish_date", 98 | "dataType":"STRING", 99 | "format":"1:MINUTES:SIMPLE_DATE_FORMAT:MM/dd/yyyy HH:mm", 100 | "granularity":"1:MINUTES" 101 | }, 102 | { 103 | "name":"harvested_date", 104 | "dataType":"STRING", 105 | "format":"1:MINUTES:SIMPLE_DATE_FORMAT:MM/dd/yyyy HH:mm", 106 | "granularity":"1:MINUTES" 107 | } 108 | ] 109 | } 110 | -------------------------------------------------------------------------------- /import/tweet-text-entities-table-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "tableName":"tweetTextEntities", 3 | "segmentsConfig":{ 4 | "segmentAssignmentStrategy":"BalanceNumSegmentAssignmentStrategy", 5 | "segmentPushType":"APPEND", 6 | "schemaName":"tweetTextEntities", 7 | "replication":1 8 | }, 9 | "fieldConfigList":[ 10 | { 11 | "name":"content", 12 | "encodingType":"RAW", 13 | "indexType":"TEXT" 14 | }, 15 | { 16 | "name":"entity_category", 17 | "encodingType":"RAW", 18 | "indexType":"TEXT" 19 | }, 20 | { 21 | "name":"article_url", 22 | "encodingType":"RAW", 23 | "indexType":"TEXT" 24 | }, 25 | { 26 | "name":"tco1_step1", 27 | "encodingType":"RAW", 28 | "indexType":"TEXT" 29 | }, 30 | { 31 | "name":"entity_name", 32 | "encodingType":"RAW", 33 | "indexType":"TEXT" 34 | } 35 | ], 36 | "tableIndexConfig":{ 37 | "noDictionaryColumns":[ 38 | "entity_name", 39 | "entity_category", 40 | "content", 41 | "article_url", 42 | "tco1_step1" 43 | ], 44 | "loadMode":"MMAP" 45 | }, 46 | "tenants":{ 47 | "broker":"DefaultTenant", 48 | "server":"DefaultTenant" 49 | }, 50 | "tableType":"OFFLINE", 51 | "metadata":{ 52 | "customConfigs":{ 53 | 54 | } 55 | }, 56 | "ingestionConfig":{ 57 | "transformConfigs":[ 58 | { 59 | "columnName":"epoch_timestamp", 60 | "transformFunction":"fromDateTime(publish_date, 'MM/dd/yyyy HH:mm')" 61 | } 62 | ] 63 | } 64 | } 65 | --------------------------------------------------------------------------------