Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
Update to Trino-431
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitrisStaratzis committed Nov 9, 2023
1 parent b79982c commit c5cb6e9
Show file tree
Hide file tree
Showing 18 changed files with 149 additions and 124 deletions.
129 changes: 64 additions & 65 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,50 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<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>
<artifactId>trino-root</artifactId>
<groupId>io.trino</groupId>
<version>411</version>
<artifactId>trino-root</artifactId>
<version>431</version>
</parent>

<artifactId>trino-tiledb</artifactId>
<description>Trino - TileDB Connector</description>

<repositories>
<repository>
<id>oss.sonatype.org-snapshot</id>
<url>http://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>io.airlift</groupId>
<artifactId>bootstrap</artifactId>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>configuration</artifactId>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>json</artifactId>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>log</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down Expand Up @@ -91,6 +57,25 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.airlift</groupId>
<artifactId>bootstrap</artifactId>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>configuration</artifactId>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>json</artifactId>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>log</artifactId>
</dependency>

<dependency>
<groupId>io.tiledb</groupId>
Expand All @@ -99,15 +84,34 @@
</dependency>

<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
<version>2.0.1</version>
</dependency>

<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>slice</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>units</artifactId>
<scope>provided</scope>
</dependency>

<!-- Trino SPI -->
<dependency>
<groupId>io.trino</groupId>
Expand All @@ -124,20 +128,15 @@

<dependency>
<groupId>io.airlift</groupId>
<artifactId>slice</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>units</artifactId>
<scope>provided</scope>
<artifactId>testing</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<scope>provided</scope>
<groupId>io.airlift.tpch</groupId>
<artifactId>tpch</artifactId>
<version>0.10</version>
<scope>test</scope>
</dependency>

<!-- for testing -->
Expand Down Expand Up @@ -167,19 +166,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>testing</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.airlift.tpch</groupId>
<artifactId>tpch</artifactId>
<version>0.10</version>
<scope>test</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/org.assertj/assertj-core -->
<dependency>
<groupId>org.assertj</groupId>
Expand Down Expand Up @@ -207,6 +193,19 @@
</dependency>
</dependencies>

<repositories>
<repository>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>oss.sonatype.org-snapshot</id>
<url>http://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>

<build>
<plugins>
<plugin>
Expand All @@ -227,7 +226,7 @@
<!-- put your configurations here -->
<packaging>trino-plugin</packaging>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
<resource>META-INF/services/io.trino.spi.Plugin</resource>
<file>src/main/resources/services/io.trino.spi.Plugin</file>
Expand All @@ -236,10 +235,10 @@
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/trino/plugin/tiledb/TileDBClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
import io.tiledb.java.api.TileDBObject;
import io.trino.spi.TrinoException;
import io.trino.spi.connector.ConnectorSession;
import jakarta.inject.Inject;
import oshi.hardware.HardwareAbstractionLayer;

import javax.inject.Inject;

import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
Expand Down Expand Up @@ -276,7 +275,8 @@ public Config buildConfig()
}
}

public Context buildContext(ConnectorSession session, EncryptionType encryptionType, String encryptionKey) throws TileDBError
public Context buildContext(ConnectorSession session, EncryptionType encryptionType, String encryptionKey)
throws TileDBError
{
Config tileDBConfig = new Config();
boolean updateCtx = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
import com.google.common.collect.ImmutableList;
import io.trino.spi.session.PropertyMetadata;
import io.trino.spi.type.TypeManager;

import javax.inject.Inject;
import jakarta.inject.Inject;

import java.util.List;
import java.util.Map;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/io/trino/plugin/tiledb/TileDBConnector.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
import io.trino.spi.connector.ConnectorTransactionHandle;
import io.trino.spi.session.PropertyMetadata;
import io.trino.spi.transaction.IsolationLevel;

import javax.inject.Inject;
import jakarta.inject.Inject;

import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/io/trino/plugin/tiledb/TileDBMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
import io.trino.spi.statistics.ComputedStatistics;
import io.trino.spi.type.Type;
import io.trino.spi.type.VarcharType;

import javax.inject.Inject;
import jakarta.inject.Inject;

import java.net.URI;
import java.net.URISyntaxException;
Expand Down
12 changes: 7 additions & 5 deletions src/main/java/io/trino/plugin/tiledb/TileDBModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
import io.trino.spi.type.TypeSignature;
import io.trino.spi.type.VarbinaryType;
import io.trino.spi.type.VarcharType;

import javax.inject.Inject;
import jakarta.inject.Inject;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -102,7 +101,8 @@ protected Type _deserialize(String value, DeserializationContext context)
}
}

public static Type prestoTypeFromTileDBType(Datatype type) throws TileDBError
public static Type prestoTypeFromTileDBType(Datatype type)
throws TileDBError
{
switch (type) {
case TILEDB_INT8:
Expand Down Expand Up @@ -149,7 +149,8 @@ public static Type prestoTypeFromTileDBType(Datatype type) throws TileDBError
}
}

public static Datatype tileDBTypeFromTrinoType(Type type) throws TileDBError
public static Datatype tileDBTypeFromTrinoType(Type type)
throws TileDBError
{
type.getJavaType();
if (type.equals(TINYINT)) {
Expand Down Expand Up @@ -202,7 +203,8 @@ else if (type.equals(TIMESTAMP_MILLIS)) {
* @return List
* @throws TileDBError if the datatype passed is not supported
*/
public static List<?> getJavaListForType(Datatype type, boolean isVariableLength) throws TileDBError
public static List<?> getJavaListForType(Datatype type, boolean isVariableLength)
throws TileDBError
{
switch (type) {
case TILEDB_FLOAT32: {
Expand Down
12 changes: 8 additions & 4 deletions src/main/java/io/trino/plugin/tiledb/TileDBPageSink.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ public TileDBPageSink(TileDBOutputTableHandle handle, TileDBClient tileDBClient,
* @param buffers the buffers
* @throws TileDBError TileDBError
*/
private void resetQuery(Map<String, Pair<NativeArray, NativeArray>> buffers) throws TileDBError
private void resetQuery(Map<String, Pair<NativeArray, NativeArray>> buffers)
throws TileDBError
{
// Create query object
query.close();
Expand All @@ -165,7 +166,8 @@ private void resetQuery(Map<String, Pair<NativeArray, NativeArray>> buffers) thr
* @param buffers the buffers
* @throws TileDBError TileDBError
*/
private void resetBuffers(Map<String, Pair<NativeArray, NativeArray>> buffers) throws TileDBError
private void resetBuffers(Map<String, Pair<NativeArray, NativeArray>> buffers)
throws TileDBError
{
for (Map.Entry<String, Pair<NativeArray, NativeArray>> bufferEntry : buffers.entrySet()) {
NativeArray offsets = bufferEntry.getValue().getFirst();
Expand Down Expand Up @@ -312,7 +314,8 @@ private void initBufferEffectiveSizes(Map<String, Pair<Optional<Long>, Long>> bu
* @return QueryStatus
* @throws TileDBError TileDBError
*/
private QueryStatus submitQuery(Map<String, Pair<NativeArray, NativeArray>> buffers, Map<String, Pair<Optional<Long>, Long>> bufferEffectiveSizes) throws TileDBError
private QueryStatus submitQuery(Map<String, Pair<NativeArray, NativeArray>> buffers, Map<String, Pair<Optional<Long>, Long>> bufferEffectiveSizes)
throws TileDBError
{
// We have to keep track of if we created a new buffer or not and if we should clear it
List<NativeArray> buffersToClear = new ArrayList<>();
Expand Down Expand Up @@ -401,7 +404,8 @@ private QueryStatus submitQuery(Map<String, Pair<NativeArray, NativeArray>> buff
* @return new effective buffer size after write
* @throws TileDBError TileDBError
*/
private long appendColumn(Page page, int position, int channel, NativeArray columnBuffer, int bufferPosition) throws TileDBError
private long appendColumn(Page page, int position, int channel, NativeArray columnBuffer, int bufferPosition)
throws TileDBError
{
OffsetDateTime dt;
Block block = page.getBlock(channel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
import io.trino.spi.connector.ConnectorPageSinkProvider;
import io.trino.spi.connector.ConnectorSession;
import io.trino.spi.connector.ConnectorTransactionHandle;

import javax.inject.Inject;
import jakarta.inject.Inject;

import static java.util.Objects.requireNonNull;

Expand Down
Loading

0 comments on commit c5cb6e9

Please sign in to comment.