Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

* #401: Updated to the virtual-schema-common-jdbc:6.1.0 #403

Merged
Merged
42 changes: 27 additions & 15 deletions doc/changes/changes_4.0.4.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,46 @@
# Exasol Virtual Schemas 4.0.4, released 2020-10-??
# Exasol Virtual Schemas 4.0.4, released 2020-11-13

Code name:
Code name: Important bugfixes

## Summary

In this release we fixed a few bugs, including a security issue. Please update your adapters as soon as possible.

## Documentation

* #371: Documented data types conversion for Hive dialect.
* #377: Improved Scalar Functions API documentation.
* #384: Turned embedded JSON into key-value encoding in Adapter Notes API examples.
* #386: Remove the documentation that was moved to the portal, added links instead.
* #394: Described 'No suitable driver found', added a note that Hive 1.1.0 has problems with its driver.
* #394: Described 'No suitable driver found', added a note that Hive 1.1.0 has problems with its driver.
* #391: Removed the API documentation from this repository and added a link to it.

## Refactoring

* #263: Removed SybaseMetadataReader class as it was not used by the dialect.
* #381: Migrated from version.sh to artifact-reference-checker-maven-plugin.
* #389: Improved connection error handling.
* #396: Updated to the `virtual-schema-common-java:6.0.0`
* #396: Updated to the `virtual-schema-common-jdbc:6.0.0`
* #401: Updated to the `virtual-schema-common-jdbc:7.0.0`

## Dependency updates

* Added com.exasol:artifact-reference-checker-maven-plugin:0.3.1
* Updated com.exasol:virtual-schema-common-java:jar:5.0.4 to version 6.0.0
* Updated org.apache.hbase:hbase-server:jar:2.3.0 to version 2.3.1
* Updated org.junit.jupiter:junit-jupiter:jar:5.6.2 to version 5.7.0
* Updated org.mockito:mockito-junit-jupiter:jar:3.4.6 to version 3.5.13
* Updated com.exasol:exasol-jdbc:jar:6.2.5 to version 7.0.0
* Updated com.exasol:exasol-testcontainers:jar:2.1.0 to version 3.1.0
* Updated org.postgresql:postgresql:jar:42.2.14 to version 42.2.16
* Updated org.apache.hbase:hbase-server:jar:2.3.1 to version 2.3.2
* Updated com.microsoft.sqlserver:mssql-jdbc:jar:8.4.0.jre11 to version 8.4.1.jre11
* Updated com.exasol:test-db-builder-java:jar:1.0.1 to version 1.1.0
* Updated com.exasol:hamcrest-resultset-matcher:jar:1.1.1 to version 1.2.1
* Updated com.exasol:virtual-schema-common-jdbc:5.0.4 to 7.0.0
* Updated org.apache.hbase:hbase-server:2.3.0 to 2.3.3
* Updated org.junit.jupiter:junit-jupiter:5.6.2 to 5.7.0
* Updated org.mockito:mockito-junit-jupiter:3.4.6 to 3.6.0
* Updated com.exasol:exasol-jdbc:6.2.5 to 7.0.3
* Updated com.exasol:exasol-testcontainers:2.1.0 to 3.3.0
* Updated org.postgresql:postgresql:42.2.14 to 42.2.18
* Updated org.apache.hbase:hbase-server:2.3.1 to 2.3.2
* Updated com.microsoft.sqlserver:mssql-jdbc:8.4.0.jre11 to 8.4.1.jre11
* Updated com.exasol:test-db-builder-java:1.0.1 to 1.1.0
* Updated com.exasol:hamcrest-resultset-matcher:1.1.1 to 1.2.1
* Updated nl.jqno.equalsverifier:equalsverifier:3.4.3 to 3.5
* Updated mysql:mysql-connector-java:8.0.21 to 8.0.22
* Updated org.testcontainers:junit-jupiter:1.14.3 to 1.15.0
* Updated org.testcontainers:mssqlserver:1.14.3 to 1.15.0
* Updated org.testcontainers:mysql:1.14.3 to 1.15.0
* Updated org.testcontainers:oracle-xe:1.14.3 to 1.15.0
* Updated org.testcontainers:postgresql:1.14.3 to 1.15.0
7 changes: 5 additions & 2 deletions doc/dialects/athena.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ You need to specify the following settings when adding the JDBC driver via EXAOp
| Parameter | Value |
|-----------|-----------------------------------------------------|
| Name | `ATHENA` |
| Main | `com.amazon.athena.jdbc.Driver` |
| Main | `com.simba.athena.jdbc.Driver` |
| Prefix | `jdbc:awsathena:` |
| Files | `AthenaJDBC42_<JDBC driver version>.jar` |

Please refer to the [documentation on configuring JDBC connections to Athena](https://docs.aws.amazon.com/athena/latest/ug/connect-with-jdbc.html) for details.

IMPORTANT: The latest Athena driver requires to **Disable Security Manager**.
It is necessary because JDBC driver requires Java permissions which we do not grant by default.

## Uploading the JDBC Driver to EXAOperation

1. [Create a bucket in BucketFS](https://docs.exasol.com/administration/on-premise/bucketfs/create_new_bucket_in_bucketfs_service.htm)
Expand All @@ -49,7 +52,7 @@ The SQL statement below creates the adapter script, defines the Java class that
```sql
CREATE OR REPLACE JAVA ADAPTER SCRIPT ADAPTER.JDBC_ADAPTER AS
%scriptclass com.exasol.adapter.RequestDispatcher;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-6.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-7.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/AthenaJDBC42-<JDBC driver version>.jar;
/
;
Expand Down
2 changes: 1 addition & 1 deletion doc/dialects/aurora.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ The SQL statement below creates the adapter script, defines the Java class that
```sql
CREATE OR REPLACE JAVA ADAPTER SCRIPT ADAPTER.JDBC_ADAPTER AS
%scriptclass com.exasol.adapter.RequestDispatcher;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-6.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-7.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/postgresql-<JDBC driver version>.jar;
/
```
Expand Down
2 changes: 1 addition & 1 deletion doc/dialects/bigquery.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ List all the JAR files from Magnitude Simba JDBC driver.
```sql
CREATE JAVA ADAPTER SCRIPT SCHEMA_FOR_VS_SCRIPT.ADAPTER_SCRIPT_BIGQUERY AS
%scriptclass com.exasol.adapter.RequestDispatcher;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-6.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-7.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/GoogleBigQueryJDBC42.jar;
...
...
Expand Down
4 changes: 2 additions & 2 deletions doc/dialects/db2.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ The SQL statement below creates the adapter script, defines the Java class that
```sql
CREATE OR REPLACE JAVA ADAPTER SCRIPT ADAPTER.JDBC_ADAPTER AS
%scriptclass com.exasol.adapter.RequestDispatcher;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-6.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-7.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/db2jcc4.jar;
%jar /buckets/<BFS service>/<bucket>/db2jcc_license_cu.jar;
/
Expand All @@ -68,7 +68,7 @@ CREATE OR REPLACE JAVA ADAPTER SCRIPT ADAPTER.JDBC_ADAPTER AS
```sql
CREATE OR REPLACE JAVA ADAPTER SCRIPT ADAPTER.JDBC_ADAPTER AS
%scriptclass com.exasol.adapter.RequestDispatcher;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-6.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-7.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/db2jcc4.jar;
%jar /buckets/<BFS service>/<bucket>/db2jcc_license_cu.jar;
%jar /buckets/<BFS service>/<bucket>/db2jcc_license_cisuz.jar;
Expand Down
4 changes: 2 additions & 2 deletions doc/dialects/hive.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The SQL statement below creates the adapter script, defines the Java class that
```sql
CREATE OR REPLACE JAVA ADAPTER SCRIPT ADAPTER.JDBC_ADAPTER AS
%scriptclass com.exasol.adapter.RequestDispatcher;
%jar /buckets/<BFS service>/<bucket>/jars/virtual-schema-dist-6.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/jars/virtual-schema-dist-7.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/jars/HiveJDBC41.jar;
/
```
Expand Down Expand Up @@ -302,7 +302,7 @@ In Virtual Schema adapter:
CREATE OR REPLACE JAVA ADAPTER SCRIPT ADAPTER.JDBC_ADAPTER AS
%jvmoption -Dsun.security.krb5.disableReferrals=true;
%scriptclass com.exasol.adapter.RequestDispatcher;
%jar /buckets/<BFS service>/<bucket>/jars/virtual-schema-dist-6.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/jars/virtual-schema-dist-7.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/jars/HiveJDBC41.jar;
/
```
Expand Down
2 changes: 1 addition & 1 deletion doc/dialects/impala.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The SQL statement below creates the adapter script, defines the Java class that
```sql
CREATE OR REPLACE JAVA ADAPTER SCRIPT ADAPTER.JDBC_ADAPTER AS
%scriptclass com.exasol.adapter.RequestDispatcher;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-6.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-7.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/ImpalaJDBC41.jar;
/
;
Expand Down
2 changes: 1 addition & 1 deletion doc/dialects/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The SQL statement below creates the adapter script, defines the Java class that
```sql
CREATE OR REPLACE JAVA ADAPTER SCRIPT SCHEMA_FOR_VS_SCRIPT.ADAPTER_SCRIPT_MYSQL AS
%scriptclass com.exasol.adapter.RequestDispatcher;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-6.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-7.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/mysql-connector-java-<version>.jar;
/
;
Expand Down
2 changes: 1 addition & 1 deletion doc/dialects/oracle.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The SQL statement below creates the adapter script, defines the Java class that
```sql
CREATE JAVA ADAPTER SCRIPT ADAPTER.JDBC_ADAPTER AS
%scriptclass com.exasol.adapter.RequestDispatcher;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-6.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-7.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/ojdbc<JDBC driver version>.jar;
/
;
Expand Down
2 changes: 1 addition & 1 deletion doc/dialects/postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The SQL statement below creates the adapter script, defines the Java class that
```sql
CREATE OR REPLACE JAVA ADAPTER SCRIPT ADAPTER.JDBC_ADAPTER AS
%scriptclass com.exasol.adapter.RequestDispatcher;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-6.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-7.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/postgresql-<version>.jar;
/
```
Expand Down
2 changes: 1 addition & 1 deletion doc/dialects/redshift.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The SQL statement below creates the adapter script, defines the Java class that
```sql
CREATE OR REPLACE JAVA ADAPTER SCRIPT ADAPTER.JDBC_ADAPTER AS
%scriptclass com.exasol.adapter.RequestDispatcher;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-6.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-7.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/RedshiftJDBC42-<JDBC driver version>.jar;
/
;
Expand Down
2 changes: 1 addition & 1 deletion doc/dialects/saphana.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The SQL statement below creates the adapter script, defines the Java class that
```sql
CREATE JAVA ADAPTER SCRIPT ADAPTER.JDBC_ADAPTER AS
%scriptclass com.exasol.adapter.RequestDispatcher;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-6.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-7.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/ngdbc-<JDBC driver version>.jar;
/
;
Expand Down
2 changes: 1 addition & 1 deletion doc/dialects/sql_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The SQL statement below creates the adapter script, defines the Java class that
```sql
CREATE OR REPLACE JAVA ADAPTER SCRIPT SCHEMA_FOR_VS_SCRIPT.ADAPTER_SCRIPT_SQLSERVER AS
%scriptclass com.exasol.adapter.RequestDispatcher;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-6.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-7.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/mssql-jdbc-<version>.jre8.jar;
/
```
Expand Down
2 changes: 1 addition & 1 deletion doc/dialects/sybase.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The SQL statement below creates the adapter script, defines the Java class that
```sql
CREATE OR REPLACE JAVA ADAPTER SCRIPT ADAPTER.JDBC_ADAPTER AS
%scriptclass com.exasol.adapter.RequestDispatcher;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-6.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-7.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/jtds-<version>.jar;
/
```
Expand Down
2 changes: 1 addition & 1 deletion doc/dialects/teradata.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The SQL statement below creates the adapter script, defines the Java class that
```sql
CREATE OR REPLACE JAVA ADAPTER SCRIPT ADAPTER.JDBC_ADAPTER AS
%scriptclass com.exasol.adapter.RequestDispatcher;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-6.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-7.0.0-bundle-4.0.4.jar;
%jar /buckets/<BFS service>/<bucket>/terajdbc4.jar;
%jar /buckets/<BFS service>/<bucket>/tdgssconfig.jar;
/
Expand Down
27 changes: 19 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>11</java.version>
<surefire.and.failsafe.plugin.version>3.0.0-M4</surefire.and.failsafe.plugin.version>
<vscjdbc.version>6.0.0</vscjdbc.version>
<org.testcontainers.version>1.14.3</org.testcontainers.version>
<vscjdbc.version>7.0.0</vscjdbc.version>
<org.testcontainers.version>1.15.0</org.testcontainers.version>
<sonar.coverage.jacoco.xmlReportPaths>target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml
</sonar.coverage.jacoco.xmlReportPaths>
</properties>
Expand Down Expand Up @@ -48,7 +48,18 @@
<artifactId>virtual-schema-common-jdbc</artifactId>
<version>${vscjdbc.version}</version>
</dependency>
<dependency>
<groupId>com.exasol</groupId>
<artifactId>db-fundamentals-java</artifactId>
<version>0.1.1</version>
</dependency>
<!--Unit test dependencies-->
<dependency>
<groupId>nl.jqno.equalsverifier</groupId>
<artifactId>equalsverifier</artifactId>
<version>3.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.exasol</groupId>
<artifactId>virtual-schema-common-jdbc</artifactId>
Expand All @@ -71,20 +82,20 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>3.5.13</version>
<version>3.6.0</version>
<scope>test</scope>
</dependency>
<!--Integration test dependencies-->
<dependency>
<groupId>com.exasol</groupId>
<artifactId>exasol-jdbc</artifactId>
<version>7.0.0</version>
<version>7.0.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.exasol</groupId>
<artifactId>exasol-testcontainers</artifactId>
<version>3.1.0</version>
<version>3.3.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -102,7 +113,7 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.16</version>
<version>42.2.18</version>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
Expand Down Expand Up @@ -177,7 +188,7 @@
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-server</artifactId>
<version>2.3.2</version>
<version>2.3.3</version>
<scope>test</scope>
<!--Excluding transient dependencies with vulnerabilities-->
<exclusions>
Expand Down Expand Up @@ -235,7 +246,7 @@
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.21</version>
<version>8.0.22</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
package com.exasol.adapter.dialects.athena;

import java.util.Objects;

import com.exasol.db.Identifier;

/**
* Represents an identifier in the Athena database.
*/
public class AthenaIdentifier implements Identifier {
private final String id;

private AthenaIdentifier(final String id) {
this.id = id;
}

/**
* Get the quoted identifier as a {@link String}.
*
* @return quoted identifier
*/
@Override
public String quote() {
if (this.id.startsWith("_")) {
return quoteWithBackticks(this.id);
} else {
return quoteWithDoubleQuotes(this.id);
}
}

private String quoteWithBackticks(final String identifier) {
return "`" + identifier + "`";
}

private String quoteWithDoubleQuotes(final String identifier) {
return "\"" + identifier + "\"";
}

/**
* Create a new {@link AthenaIdentifier}.
*
* @param id the identifier as {@link String}
* @return new {@link AthenaIdentifier} instance
*/
public static AthenaIdentifier of(final String id) {
if (validate(id)) {
return new AthenaIdentifier(id);
} else {
throw new AssertionError("E-ID-2: Unable to create identifier \"" + id //
+ "\" because it contains illegal characters." //
+ " For information about valid identifiers, please refer to" //
+ " https://docs.aws.amazon.com/athena/latest/ug/tables-databases-columns-names.html");
exanm marked this conversation as resolved.
Show resolved Hide resolved
}
}

private static boolean validate(final String id) {
if ((id == null) || id.isEmpty()) {
return false;
}
for (int i = 0; i < id.length(); ++i) {
if (!validateCharacter(id.codePointAt(i))) {
return false;
}
}
return true;
}

private static boolean validateCharacter(final int codePoint) {
return codePoint == '_' || Character.isLetter(codePoint) || Character.isDigit(codePoint);
}

@Override
public boolean equals(final Object o) {
AnastasiiaSergienko marked this conversation as resolved.
Show resolved Hide resolved
if (this == o) {
return true;
}
if (!(o instanceof AthenaIdentifier)) {
return false;
}
final AthenaIdentifier that = (AthenaIdentifier) o;
return Objects.equals(this.id, that.id);
}

@Override
public int hashCode() {
return Objects.hash(this.id);
}
}