-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dfbffbe
commit 8b9a350
Showing
8 changed files
with
150 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Use the Trino base image | ||
FROM trinodb/trino:452 | ||
|
||
# Create the plugin directory | ||
RUN mkdir -p /usr/lib/trino/plugin/trino-event-logger | ||
|
||
# Copy the plugin JAR files | ||
COPY /target/dependency/*.jar /usr/lib/trino/plugin/trino-event-logger/ | ||
COPY /target/trino-event-logger*.jar /usr/lib/trino/plugin/trino-event-logger/ | ||
|
||
# Create event-listener.properties file | ||
RUN echo "event-listener.name=telogger" > /etc/trino/event-listener.properties && \ | ||
echo "telogger.url=jdbc:postgresql://postgres:5432/trino_db_event_listener" >> /etc/trino/event-listener.properties && \ | ||
echo "telogger.user=trino_user" >> /etc/trino/event-listener.properties && \ | ||
echo "telogger.password=trino_password" >> /etc/trino/event-listener.properties | ||
|
||
# Create PostgreSQL catalog properties file | ||
RUN mkdir -p /etc/trino/catalog && \ | ||
echo "connector.name=postgresql" > /etc/trino/catalog/postgresql.properties && \ | ||
echo "connection-url=jdbc:postgresql://postgres:5432/trino_db_event_listener" >> /etc/trino/catalog/postgresql.properties && \ | ||
echo "connection-user=trino_user" >> /etc/trino/catalog/postgresql.properties && \ | ||
echo "connection-password=trino_password" >> /etc/trino/catalog/postgresql.properties | ||
|
||
# Start Trino | ||
CMD ["/usr/lib/trino/bin/run-trino"] |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
version: '3.8' | ||
|
||
services: | ||
trino: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
ports: | ||
- "8081:8080" | ||
depends_on: | ||
- postgres | ||
networks: | ||
- trino-network | ||
|
||
postgres: | ||
image: postgres:13 | ||
environment: | ||
POSTGRES_DB: trino_db_event_listener | ||
POSTGRES_USER: trino_user | ||
POSTGRES_PASSWORD: trino_password | ||
ports: | ||
- "5455:5432" | ||
volumes: | ||
- postgres-data:/var/lib/postgresql/data | ||
networks: | ||
- trino-network | ||
|
||
networks: | ||
trino-network: | ||
driver: bridge | ||
|
||
volumes: | ||
postgres-data: |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
ALTER TABLE queries | ||
ADD COLUMN user_name VARCHAR(256); | ||
|
||
ALTER TABLE queries | ||
ADD COLUMN user_original VARCHAR(256); | ||
|
||
ALTER TABLE queries | ||
ADD COLUMN server_version VARCHAR(256); | ||
|
||
ALTER TABLE queries | ||
ADD COLUMN enabled_roles LONGTEXT; | ||
|
||
ALTER TABLE queries | ||
ADD COLUMN groups LONGTEXT; | ||
|
||
ALTER TABLE queries | ||
ADD COLUMN principal VARCHAR(256); | ||
|
||
CREATE INDEX idx_queries_user_name ON queries (user_name); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
ALTER TABLE queries | ||
ADD COLUMN user_name VARCHAR(256); | ||
|
||
ALTER TABLE queries | ||
ADD COLUMN user_original VARCHAR(256); | ||
|
||
ALTER TABLE queries | ||
ADD COLUMN server_version VARCHAR(256); | ||
|
||
ALTER TABLE queries | ||
ADD COLUMN enabled_roles TEXT; | ||
|
||
ALTER TABLE queries | ||
ADD COLUMN groups TEXT; | ||
|
||
ALTER TABLE queries | ||
ADD COLUMN principal VARCHAR(256); | ||
|
||
CREATE INDEX idx_queries_user_name ON queries (user_name); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
ALTER TABLE queries | ||
ADD user_name VARCHAR(256); | ||
|
||
ALTER TABLE queries | ||
ADD user_original VARCHAR(256); | ||
|
||
ALTER TABLE queries | ||
ADD server_version VARCHAR(256); | ||
|
||
ALTER TABLE queries | ||
ADD enabled_roles NVARCHAR(MAX); | ||
|
||
ALTER TABLE queries | ||
ADD groups NVARCHAR(MAX); | ||
|
||
ALTER TABLE queries | ||
ADD principal VARCHAR(256); | ||
|
||
CREATE INDEX idx_queries_user_name ON queries (user_name); |