Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
178 changes: 178 additions & 0 deletions fluss-trino/QUICKSTART.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
# Fluss Trino Connector - Quick Start Guide

## Overview

The Fluss Trino Connector enables Trino to query Apache Fluss tables, providing OLAP capabilities over real-time streaming data.

## Installation

### 1. Build the Connector

```bash
cd fluss-trino
mvn clean package -DskipTests
```

### 2. Deploy to Trino

```bash
# Create plugin directory
mkdir -p $TRINO_HOME/plugin/fluss

# Copy the connector JAR (choose the appropriate version)
cp fluss-trino-435/target/fluss-trino-435-*.jar $TRINO_HOME/plugin/fluss/

# Or for version 436:
# cp fluss-trino-436/target/fluss-trino-436-*.jar $TRINO_HOME/plugin/fluss/
```

### 3. Configure Catalog

Create `$TRINO_HOME/etc/catalog/fluss.properties`:

```properties
connector.name=fluss
bootstrap.servers=localhost:9092
```

### 4. Restart Trino

```bash
$TRINO_HOME/bin/launcher restart
```

## Usage Examples

### Connect to Trino CLI

```bash
trino --server localhost:8080 --catalog fluss
```

### Basic Queries

```sql
-- List all databases
SHOW SCHEMAS FROM fluss;

-- List tables in a database
SHOW TABLES FROM fluss.my_database;

-- Describe table structure
DESCRIBE fluss.my_database.my_table;

-- Select data
SELECT * FROM fluss.my_database.my_table LIMIT 10;

-- Filter with WHERE clause
SELECT id, name, age
FROM fluss.my_database.users
WHERE age > 18 AND city = 'Beijing';

-- Aggregate query
SELECT country, COUNT(*) as user_count, AVG(age) as avg_age
FROM fluss.my_database.users
GROUP BY country
ORDER BY user_count DESC;

-- JOIN query
SELECT
u.id,
u.name,
o.order_id,
o.total_amount
FROM fluss.db1.users u
INNER JOIN fluss.db1.orders o ON u.id = o.user_id
WHERE o.order_date >= DATE '2024-01-01';
```

### Advanced Features

#### Column Pruning
Only specified columns are read from storage:
```sql
SELECT id, name FROM fluss.db.users; -- Only id and name are read
```

#### Predicate Pushdown
Filter conditions are pushed to storage layer:
```sql
SELECT * FROM fluss.db.orders WHERE order_date >= DATE '2024-01-01';
```

#### Limit Pushdown
Limit is applied at storage layer:
```sql
SELECT * FROM fluss.db.users LIMIT 100;
```

## Configuration Reference

### Required Configuration

| Property | Description | Example |
|----------|-------------|---------|
| `connector.name` | Connector identifier | `fluss` |
| `bootstrap.servers` | Fluss server addresses | `localhost:9092` |

### Optional Configuration

| Property | Description | Default | Example |
|----------|-------------|---------|---------|
| `connection.max-idle-time` | Max connection idle time | `10m` | `15m` |
| `request.timeout` | Request timeout | `60s` | `30s` |
| `scanner.fetch.max-wait-time` | Scanner max wait time | `500ms` | `1s` |
| `scanner.fetch.min-bytes` | Scanner min fetch bytes | `1MB` | `512KB` |
| `union-read.enabled` | Enable union read | `true` | `false` |
| `column-pruning.enabled` | Enable column pruning | `true` | `false` |
| `predicate-pushdown.enabled` | Enable predicate pushdown | `true` | `false` |
| `limit-pushdown.enabled` | Enable limit pushdown | `true` | `false` |
| `max-splits-per-second` | Max splits per second | `1000` | `500` |
| `max-splits-per-request` | Max splits per request | `100` | `50` |

## Troubleshooting

### Connection Issues

**Problem**: Cannot connect to Fluss cluster

**Solution**:
- Verify `bootstrap.servers` configuration
- Check network connectivity to Fluss servers
- Review Trino server logs in `$TRINO_HOME/var/log/server.log`

### Performance Issues

**Problem**: Queries are slow

**Solution**:
- Enable query optimizations (column pruning, predicate pushdown)
- Increase `max-splits-per-second` for better parallelism
- Check Fluss cluster health and resources

### Data Type Issues

**Problem**: Unsupported data type error

**Solution**:
- Check supported type mappings in README.md
- Verify table schema in Fluss

## Supported Features

- ✅ Read from LogStore
- ✅ Read from KvStore
- ✅ Column pruning
- ✅ Predicate pushdown
- ✅ Limit pushdown
- ✅ All basic data types
- ✅ Complex types (ARRAY, MAP, ROW)
- ⏳ Union Read (real-time + historical)
- ⏳ Aggregate pushdown
- ⏳ Write support

## Support

- Documentation: https://fluss.apache.org/docs
- Issues: https://github.com/apache/fluss/issues
- Mailing List: dev@fluss.apache.org
139 changes: 139 additions & 0 deletions fluss-trino/fluss-trino-435/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.fluss</groupId>
<artifactId>fluss-trino</artifactId>
<version>0.8-SNAPSHOT</version>
</parent>

<artifactId>fluss-trino-435</artifactId>
<name>Fluss : Engine Trino : 435</name>

<properties>
<trino.major.version>435</trino.major.version>
<trino.minor.version>435</trino.minor.version>
</properties>

<dependencies>
<!-- Fluss Trino Common -->
<dependency>
<groupId>org.apache.fluss</groupId>
<artifactId>fluss-trino-common</artifactId>
<version>${project.version}</version>
</dependency>

<!-- Trino SPI -->
<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-spi</artifactId>
<version>${trino.minor.version}</version>
<scope>provided</scope>
</dependency>

<!-- Airlift -->
<dependency>
<groupId>io.airlift</groupId>
<artifactId>bootstrap</artifactId>
<version>${airlift.version}</version>
<scope>provided</scope>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>org.apache.fluss</groupId>
<artifactId>fluss-trino-common</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>

<dependency>
<groupId>org.apache.fluss</groupId>
<artifactId>fluss-server</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.fluss</groupId>
<artifactId>fluss-test-utils</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-testing</artifactId>
<version>${trino.minor.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-main</artifactId>
<version>${trino.minor.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<!-- Maven Shade Plugin for creating uber jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>shade-fluss</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<shadedArtifactAttached>false</shadedArtifactAttached>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
<artifactSet>
<includes>
<include>org.apache.fluss:*</include>
</includes>
</artifactSet>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Loading
Loading