Skip to content

Commit e64bbbd

Browse files
author
Julien Ruaux
committed
docs: Added documentation
1 parent e7b58a5 commit e64bbbd

File tree

7 files changed

+468
-256
lines changed

7 files changed

+468
-256
lines changed

.github/workflows/early-access.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Java
1919
uses: actions/setup-java@v1
2020
with:
21-
java-version: 18
21+
java-version: 17
2222

2323
- uses: actions/cache@v2
2424
with:
@@ -63,7 +63,6 @@ jobs:
6363
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
6464
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
6565
JRELEASER_SLACK_WEBHOOK: ${{ secrets.JRELEASER_SLACK_WEBHOOK }}
66-
JRELEASER_ANNOUNCE_ACTIVE: NEVER
6766

6867
- name: JReleaser output
6968
if: always()
@@ -74,7 +73,7 @@ jobs:
7473
out/jreleaser/trace.log
7574
out/jreleaser/output.properties
7675
out/jreleaser/release/CHANGELOG.md
77-
76+
7877
- name: Set up QEMU
7978
uses: docker/setup-qemu-action@v2
8079

@@ -91,4 +90,4 @@ jobs:
9190
uses: docker/build-push-action@v3
9291
with:
9392
push: ${{ github.event_name != 'pull_request' }}
94-
tags: jruaux/trino-redisearch:early-access
93+
tags: jruaux/trino-redisearch:early-access

.github/workflows/publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Publish
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Release version"
8+
required: true
9+
jobs:
10+
release:
11+
name: Release
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Set up Java
19+
uses: actions/setup-java@v1
20+
with:
21+
java-version: 17
22+
23+
- uses: actions/cache@v2
24+
with:
25+
path: ~/.m2/repository
26+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
27+
restore-keys: |
28+
${{ runner.os }}-maven-
29+
30+
- name: Set release version
31+
run: |
32+
VERSION=${{ github.event.inputs.version }}
33+
./mvnw versions:set -DnewVersion=$VERSION
34+
35+
- name: Build
36+
run: ./mvnw --no-transfer-progress -B --file pom.xml process-resources
37+
38+
- name: Deploy
39+
uses: peaceiris/actions-gh-pages@v3
40+
with:
41+
github_token: ${{ secrets.GIT_ACCESS_TOKEN }}
42+
publish_dir: ./target/generated-docs

.github/workflows/release.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Set up Java
2525
uses: actions/setup-java@v1
2626
with:
27-
java-version: 18
27+
java-version: 17
2828

2929
- uses: actions/cache@v2
3030
with:
@@ -57,11 +57,12 @@ jobs:
5757
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY}}
5858
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
5959
JRELEASER_SLACK_WEBHOOK: ${{ secrets.JRELEASER_SLACK_WEBHOOK }}
60-
60+
6161
- name: Commit release version
6262
run: |
6363
VERSION=${{ github.event.inputs.version }}
6464
sed -i -e "s/^\:project-version\:\ .*/:project-version: $VERSION/g" README.adoc
65+
git add pom.xml
6566
git add README.adoc
6667
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
6768
git config --global user.name "GitHub Action"
@@ -93,4 +94,10 @@ jobs:
9394
uses: docker/build-push-action@v3
9495
with:
9596
push: ${{ github.event_name != 'pull_request' }}
96-
tags: jruaux/trino-redisearch:latest,jruaux/trino-redisearch:${{ github.event.inputs.version }}
97+
tags: jruaux/trino-redisearch:latest,jruaux/trino-redisearch:${{ github.event.inputs.version }}
98+
99+
- name: Deploy
100+
uses: peaceiris/actions-gh-pages@v3
101+
with:
102+
github_token: ${{ secrets.GIT_ACCESS_TOKEN }}
103+
publish_dir: ./target/generated-docs

README.adoc

Lines changed: 17 additions & 245 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,36 @@
11
= Redis SQL
22
:linkattrs:
3-
:project-owner: redis-field-engineering
4-
:project-name: redis-sql
5-
:project-group: com.redis
6-
:project-version: 0.2.5
7-
:project-url: https://github.com/{project-owner}/{project-name}
8-
:artifact-id: trino-redisearch
9-
:trino-dir: /usr/lib/trino
10-
:trino-datadir: /var/trino
11-
:trino-version: 395
3+
:project-owner: redis-field-engineering
4+
:project-name: redis-sql
5+
:project-group: com.redis
6+
:project-version: 0.2.5
7+
:project-url: https://github.com/{project-owner}/{project-name}
8+
:documentation-url: https://{project-owner}.github.io/{project-name}
9+
:artifact-id: trino-redisearch
10+
:trino-dir: /usr/lib/trino
11+
:trino-datadir: /var/trino
12+
:trino-version: 395
13+
1214

1315
image:{project-url}/actions/workflows/early-access.yml/badge.svg["Build Status", link="{project-url}/actions/workflows/early-access.yml"]
1416
image:https://codecov.io/gh/{project-owner}/{project-name}/branch/master/graph/badge.svg?token={codecov-token}["Coverage", link="https://codecov.io/gh/{project-owner}/{project-name}"]
1517

1618
Redis SQL is a https://trino.io[Trino] connector which allows access to RediSearch data from Trino.
17-
This document describes how to set up the RediSearch Connector to run SQL queries against RediSearch.
18-
19-
image::https://asciinema.org/a/526185.svg[asciicast,link=https://asciinema.org/a/526185]
2019

2120
NOTE: RediSearch 2.0 or later is required.
2221

23-
== Configuration
24-
To configure the RediSearch connector, create a catalog properties file `etc/catalog/redisearch.properties` with the following contents, replacing the properties as appropriate:
25-
26-
[source,properties]
27-
----
28-
connector.name=redisearch
29-
redisearch.uri=redis://localhost:6379
30-
redisearch.default-schema-name=default
31-
----
32-
33-
[[properties]]
34-
=== Configuration properties
35-
36-
[cols="1,1,1"]
37-
|===
38-
|Property name |Description |Default
39-
40-
|`redisearch.uri`
41-
|A Redis connection string. https://github.com/lettuce-io/lettuce-core/wiki/Redis-URI-and-connection-details#uri-syntax[Redis URI syntax].
42-
|
43-
44-
|`redisearch.default-schema-name`
45-
|The schema that contains all tables defined without a qualifying schema name.
46-
|`default`
47-
48-
|`redisearch.username`
49-
|Redis connection username.
50-
|
51-
52-
|`redisearch.password`
53-
|Redis connection password.
54-
|
55-
56-
|`redisearch.cluster`
57-
|Connect to a Redis Cluster.
58-
|`false`
22+
== Documentation
5923

60-
|`redisearch.case-insensitive-names`
61-
|Match index names case insensitively.
62-
|`false`
24+
Documentation is available at link:{documentation-url}[{documentation-url}].
6325

64-
|`redisearch.default-limit`
65-
|Max number of documents returned by FT.SEARCH and FT.AGGREGATE when no limit is present in the SQL query.
66-
|`10000`
67-
68-
|`redisearch.cursor-count`
69-
|Number of rows read during each https://redis.io/docs/stack/search/reference/aggregations/#cursor-api[aggregation cursor] fetch.
70-
|`1000`
71-
|===
72-
73-
== TLS security
74-
The RediSearch connector provides additional security options to support Redis servers with TLS mode.
75-
76-
The allowed configuration values are:
77-
78-
[cols="1,1"]
79-
|===
80-
|Property name |Description
81-
82-
|`redisearch.insecure`
83-
|Allow insecure connections (e.g. invalid certificates) when using SSL.
84-
85-
|`redisearch.cacert-path`
86-
|X.509 CA certificate file to verify with.
87-
88-
|`redisearch.key-path`
89-
|PKCS#8 private key file to authenticate with (PEM format).
90-
91-
|`redisearch.key-password`
92-
|Password of the private key file, or null if it's not password-protected.
93-
94-
|`redisearch.cert-path`
95-
|X.509 certificate chain file to authenticate with (PEM format).
96-
|===
26+
== Support
9727

28+
Contact us on the https://forum.redis.com/[Redis Forum] or create an issue on {project-url}/issues[Github] where we provide support on a good faith effort basis.
9829

9930
== Docker Example
10031

32+
image::https://asciinema.org/a/526185.svg[asciicast,link=https://asciinema.org/a/526185]
33+
10134
.Clone the project
10235
[source,console,subs="verbatim,attributes"]
10336
----
@@ -134,164 +67,3 @@ docker exec -it trino trino --catalog redisearch --schema default
13467
----
13568
trino:default> select * from beers;
13669
----
137-
138-
== Tableau
139-
140-
Follow these steps to connect Tableau: https://help.tableau.com/current/pro/desktop/en-us/examples_presto.htm
141-
142-
== Install and Run
143-
144-
=== Trino
145-
146-
Trino installation instructions are available here: https://trino.io/docs/current/installation.html
147-
148-
The following steps deploy a single-node Trino server on Ubuntu.
149-
150-
Trino requires a 64-bit of Java 17.
151-
It is recommended to https://www.azul.com/downloads/?package=jdk[Azul Zulu] as the JDK.
152-
[source,console]
153-
----
154-
$ java -version
155-
openjdk version "17.0.4.1" 2022-08-12 LTS
156-
OpenJDK Runtime Environment Zulu17.36+17-CA (build 17.0.4.1+1-LTS)
157-
OpenJDK 64-Bit Server VM Zulu17.36+17-CA (build 17.0.4.1+1-LTS, mixed mode, sharing)
158-
----
159-
160-
Download the Trino server tarball and unpack it.
161-
[source,console,subs="verbatim,attributes"]
162-
----
163-
wget https://repo1.maven.org/maven2/io/trino/trino-server/{trino-version}/trino-server-{trino-version}.tar.gz
164-
mkdir {trino-dir}
165-
tar xzvf trino-server-{trino-version}.tar.gz --directory {trino-dir} --strip-components 1
166-
----
167-
168-
Trino needs a data directory for storing logs, etc.
169-
It is recommended to create a data directory outside of the installation directory, which allows it to be easily preserved when upgrading Trino.
170-
[source,console,subs="verbatim,attributes"]
171-
----
172-
mkdir -p {trino-datadir}
173-
----
174-
175-
Create an `etc` directory inside the installation directory to hold configuration files.
176-
[source,console,subs="verbatim,attributes"]
177-
----
178-
mkdir {trino-dir}/etc
179-
----
180-
181-
Create a node properties file `etc/node.properties`.
182-
183-
.{trino-dir}/etc/node.properties
184-
[source,properties,subs="verbatim,attributes"]
185-
----
186-
node.environment=production
187-
node.id=ffffffff-ffff-ffff-ffff-ffffffffffff
188-
node.data-dir={trino-datadir}
189-
----
190-
191-
Create a JVM config file `etc/jvm.config`.
192-
193-
.{trino-dir}/etc/jvm.config
194-
[source,properties]
195-
----
196-
-server
197-
-Xmx16G
198-
-XX:InitialRAMPercentage=80
199-
-XX:MaxRAMPercentage=80
200-
-XX:G1HeapRegionSize=32M
201-
-XX:+ExplicitGCInvokesConcurrent
202-
-XX:+ExitOnOutOfMemoryError
203-
-XX:+HeapDumpOnOutOfMemoryError
204-
-XX:-OmitStackTraceInFastThrow
205-
-XX:ReservedCodeCacheSize=512M
206-
-XX:PerMethodRecompilationCutoff=10000
207-
-XX:PerBytecodeRecompilationCutoff=10000
208-
-Djdk.attach.allowAttachSelf=true
209-
-Djdk.nio.maxCachedBufferSize=2000000
210-
-XX:+UnlockDiagnosticVMOptions
211-
-XX:+UseAESCTRIntrinsics
212-
----
213-
214-
Create a config properties file `etc/config.properties`.
215-
.{trino-dir}/etc/config.properties
216-
[source,properties]
217-
----
218-
coordinator=true
219-
node-scheduler.include-coordinator=true
220-
http-server.http.port=8080
221-
discovery.uri=http://localhost:8080
222-
----
223-
224-
Create a log levels file `etc/log.properties`.
225-
.{trino-dir}/etc/log.properties
226-
[source,properties]
227-
----
228-
io.trino=INFO
229-
----
230-
231-
=== Redis SQL
232-
233-
Download latest {project-url}/releases/latest[release] and unzip without any directory structure under `<trino>/plugin/redisearch`.
234-
235-
[source,console,subs="verbatim,attributes"]
236-
----
237-
wget {project-url}/releases/download/v{trino-version}/{artifact-id}-{trino-version}.zip
238-
unzip -j {artifact-id}-{project-version}.zip -d {trino-dir}/plugin/redisearch
239-
----
240-
241-
Create a `redisearch.properties` file under `{trino-dir}/etc/catalog` directory:
242-
243-
[source,properties]
244-
----
245-
connector.name=redisearch
246-
redisearch.uri=redis://localhost:6379
247-
----
248-
249-
Change and/or add <<properties,properties>> as needed.
250-
251-
=== Run
252-
253-
==== Trino Server
254-
255-
Start the Trino server by running:
256-
257-
[source,console,subs="verbatim,attributes"]
258-
----
259-
{trino-dir}/bin/launcher run
260-
----
261-
262-
==== Trino CLI
263-
264-
Download https://repo1.maven.org/maven2/io/trino/trino-cli/{trino-version}/trino-cli-{trino-version}-executable.jar[trino-cli-{trino-version}-executable.jar], rename it to `trino`, make it executable with `chmod +x`, and run it to show the version of the CLI:
265-
266-
[source,console,subs="verbatim,attributes"]
267-
----
268-
wget https://repo1.maven.org/maven2/io/trino/trino-cli/{trino-version}/trino-cli-{trino-version}-executable.jar
269-
mv trino-cli-{trino-version}-executable.jar trino
270-
chmod +x trino
271-
----
272-
273-
Connect to Trino using the CLI:
274-
275-
[source,console]
276-
----
277-
./trino --catalog redisearch --schema default
278-
----
279-
280-
Run a SQL query:
281-
282-
[source,console]
283-
----
284-
trino:default> select * from mySearchIndex;
285-
----
286-
287-
== Build
288-
289-
Run these commands to build the Trino connector for RediSearch from source (requires Java 17+):
290-
291-
[source,console,subs="verbatim,attributes"]
292-
----
293-
git clone {project-url}.git
294-
cd {project-name}
295-
./gradlew clean build
296-
----
297-

0 commit comments

Comments
 (0)