Skip to content

Commit a7ae7d5

Browse files
committed
Add Trino-IoTDB connector PoC using trino-base-jdbc framework
Implement a proof-of-concept Trino connector for Apache IoTDB using Trino's trino-base-jdbc framework with IoTDB's JDBC driver in Table Model mode (sql_dialect=table). Core features: - IoTDBPlugin extending JdbcPlugin with "iotdb" connector name - IoTDBClient extending BaseJdbcClient with schema listing via SHOW DATABASES, type mapping for all 10 IoTDB types, dynamic timestamp precision detection via SHOW VARIABLES, and LIMIT/TopN pushdown support - IoTDBConnectionModule injecting sql_dialect=table programmatically - Integration test infrastructure with Testcontainers (IoTDB Docker) and BaseJdbcConnectorTest (400+ inherited tests) - Type mapping round-trip tests for BOOLEAN, INT32, INT64, FLOAT, DOUBLE, STRING, TIMESTAMP, and DATE types
1 parent ed29a53 commit a7ae7d5

File tree

14 files changed

+1231
-0
lines changed

14 files changed

+1231
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# IoTDB Connector Catalog Configuration
2+
# Place this file in Trino's etc/catalog/ directory
3+
4+
connector.name=iotdb
5+
connection-url=jdbc:iotdb://iotdb-host:6667
6+
connection-user=root
7+
connection-password=root
8+
9+
# Optional: IoTDB-specific settings
10+
# iotdb.predicate-pushdown.enabled=true

trino-iotdb-connector/pom.xml

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>io.trino</groupId>
5+
<artifactId>trino-iotdb</artifactId>
6+
<version>1.0-SNAPSHOT</version>
7+
<packaging>jar</packaging>
8+
<name>Trino - IoTDB Connector</name>
9+
<description>Trino connector for Apache IoTDB time-series database using JDBC in Table Model mode</description>
10+
<properties>
11+
<trino.version>449</trino.version>
12+
<iotdb.jdbc.version>2.0.7-SNAPSHOT</iotdb.jdbc.version>
13+
<guice.version>7.0.0</guice.version>
14+
<airlift.version>239</airlift.version>
15+
<slice.version>2.2</slice.version>
16+
<opentelemetry.version>1.32.0</opentelemetry.version>
17+
<jackson.version>2.16.1</jackson.version>
18+
<testcontainers.version>1.19.3</testcontainers.version>
19+
<junit.version>5.10.1</junit.version>
20+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
21+
<maven.compiler.release>21</maven.compiler.release>
22+
</properties>
23+
<dependencies>
24+
<!-- Trino JDBC framework (included in plugin classloader) -->
25+
<dependency>
26+
<groupId>io.trino</groupId>
27+
<artifactId>trino-base-jdbc</artifactId>
28+
<version>${trino.version}</version>
29+
</dependency>
30+
<dependency>
31+
<groupId>io.trino</groupId>
32+
<artifactId>trino-plugin-toolkit</artifactId>
33+
<version>${trino.version}</version>
34+
</dependency>
35+
<!-- Guice dependency injection -->
36+
<dependency>
37+
<groupId>com.google.inject</groupId>
38+
<artifactId>guice</artifactId>
39+
<version>${guice.version}</version>
40+
</dependency>
41+
<!-- Airlift configuration -->
42+
<dependency>
43+
<groupId>io.airlift</groupId>
44+
<artifactId>configuration</artifactId>
45+
<version>${airlift.version}</version>
46+
</dependency>
47+
<!-- Guava -->
48+
<dependency>
49+
<groupId>com.google.guava</groupId>
50+
<artifactId>guava</artifactId>
51+
<version>33.0.0-jre</version>
52+
</dependency>
53+
<!-- Jakarta annotations -->
54+
<dependency>
55+
<groupId>jakarta.annotation</groupId>
56+
<artifactId>jakarta.annotation-api</artifactId>
57+
<version>2.1.1</version>
58+
</dependency>
59+
<!-- IoTDB JDBC Driver -->
60+
<dependency>
61+
<groupId>org.apache.iotdb</groupId>
62+
<artifactId>iotdb-jdbc</artifactId>
63+
<version>${iotdb.jdbc.version}</version>
64+
<exclusions>
65+
<exclusion>
66+
<groupId>org.slf4j</groupId>
67+
<artifactId>slf4j-api</artifactId>
68+
</exclusion>
69+
</exclusions>
70+
</dependency>
71+
<!-- Trino SPI (provided by Trino at runtime) -->
72+
<dependency>
73+
<groupId>io.trino</groupId>
74+
<artifactId>trino-spi</artifactId>
75+
<version>${trino.version}</version>
76+
<scope>provided</scope>
77+
</dependency>
78+
<dependency>
79+
<groupId>io.airlift</groupId>
80+
<artifactId>slice</artifactId>
81+
<version>${slice.version}</version>
82+
<scope>provided</scope>
83+
</dependency>
84+
<dependency>
85+
<groupId>io.opentelemetry</groupId>
86+
<artifactId>opentelemetry-api</artifactId>
87+
<version>${opentelemetry.version}</version>
88+
<scope>provided</scope>
89+
</dependency>
90+
<dependency>
91+
<groupId>com.fasterxml.jackson.core</groupId>
92+
<artifactId>jackson-annotations</artifactId>
93+
<version>${jackson.version}</version>
94+
<scope>provided</scope>
95+
</dependency>
96+
<!-- Test dependencies -->
97+
<dependency>
98+
<groupId>io.trino</groupId>
99+
<artifactId>trino-testing</artifactId>
100+
<version>${trino.version}</version>
101+
<scope>test</scope>
102+
</dependency>
103+
<dependency>
104+
<groupId>io.trino</groupId>
105+
<artifactId>trino-base-jdbc</artifactId>
106+
<version>${trino.version}</version>
107+
<type>test-jar</type>
108+
<scope>test</scope>
109+
</dependency>
110+
<dependency>
111+
<groupId>io.trino</groupId>
112+
<artifactId>trino-main</artifactId>
113+
<version>${trino.version}</version>
114+
<scope>test</scope>
115+
</dependency>
116+
<dependency>
117+
<groupId>org.testcontainers</groupId>
118+
<artifactId>testcontainers</artifactId>
119+
<version>${testcontainers.version}</version>
120+
<scope>test</scope>
121+
</dependency>
122+
<dependency>
123+
<groupId>org.junit.jupiter</groupId>
124+
<artifactId>junit-jupiter-api</artifactId>
125+
<version>${junit.version}</version>
126+
<scope>test</scope>
127+
</dependency>
128+
<dependency>
129+
<groupId>org.assertj</groupId>
130+
<artifactId>assertj-core</artifactId>
131+
<version>3.25.1</version>
132+
<scope>test</scope>
133+
</dependency>
134+
</dependencies>
135+
<build>
136+
<plugins>
137+
<!-- Use trino-plugin packaging when building with Java 17+:
138+
<plugin>
139+
<groupId>io.trino</groupId>
140+
<artifactId>trino-maven-plugin</artifactId>
141+
<version>14</version>
142+
<extensions>true</extensions>
143+
</plugin>
144+
-->
145+
<plugin>
146+
<groupId>org.apache.maven.plugins</groupId>
147+
<artifactId>maven-compiler-plugin</artifactId>
148+
<version>3.12.1</version>
149+
<configuration>
150+
<release>21</release>
151+
</configuration>
152+
</plugin>
153+
<plugin>
154+
<groupId>org.apache.maven.plugins</groupId>
155+
<artifactId>maven-surefire-plugin</artifactId>
156+
<version>3.2.3</version>
157+
</plugin>
158+
</plugins>
159+
</build>
160+
</project>

0 commit comments

Comments
 (0)