Skip to content

Commit

Permalink
Replaced adapter property IS_LOCAL from virtual-schema-common-java … (
Browse files Browse the repository at this point in the history
#107)

Co-authored-by: Christoph Pirkl <christoph.pirkl@exasol.com>
  • Loading branch information
ckunki and kaklakariada authored Jul 7, 2023
1 parent 38546d2 commit bd134d6
Show file tree
Hide file tree
Showing 14 changed files with 171 additions and 135 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/broken_links_checker.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .project-keeper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ sources:
linkReplacements:
excludes:
- "E-PK-CORE-18: Outdated content: '.github/workflows/ci-build.yml'"
- regex: "(?s)E-PK-CORE-53: The dependencies.md file has outdated content.*"
199 changes: 99 additions & 100 deletions dependencies.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions doc/changes/changelog.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions doc/changes/changes_7.1.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Exasol Virtual Schema 7.1.3, released 2023-07-07

Code name: Refactoring

## Summary

This release replaces Adapter Property `IS_LOCAL` from `virtual-schema-common-java` by a constant in the current project as this property is specific to Exasol Virtual Schema.

See also ticket [VSCOMJAVA #273](https://github.com/exasol/virtual-schema-common-java/pull/273) removing the adapter property from `virtual-schema-common-java`.

## Refactoring

* #85: Replaced adapter property `IS_LOCAL` from virtual-schema-common-java by a constant in VSEXA.

## Dependency Updates

### Compile Dependency Updates

* Updated `com.exasol:virtual-schema-common-jdbc:10.5.0` to `11.0.0`

### Test Dependency Updates

* Updated `com.exasol:virtual-schema-common-jdbc:10.5.0` to `11.0.0`
* Updated `org.jacoco:org.jacoco.agent:0.8.9` to `0.8.10`

### Plugin Dependency Updates

* Updated `com.exasol:error-code-crawler-maven-plugin:1.2.3` to `1.3.0`
* Updated `com.exasol:project-keeper-maven-plugin:2.9.7` to `2.9.9`
* Updated `org.apache.maven.plugins:maven-dependency-plugin:3.5.0` to `3.6.0`
* Updated `org.apache.maven.plugins:maven-failsafe-plugin:3.0.0` to `3.1.2`
* Updated `org.apache.maven.plugins:maven-gpg-plugin:3.0.1` to `3.1.0`
* Updated `org.apache.maven.plugins:maven-surefire-plugin:3.0.0` to `3.1.2`
* Updated `org.basepom.maven:duplicate-finder-maven-plugin:1.5.1` to `2.0.1`
* Updated `org.codehaus.mojo:flatten-maven-plugin:1.4.1` to `1.5.0`
* Updated `org.codehaus.mojo:versions-maven-plugin:2.15.0` to `2.16.0`
* Updated `org.jacoco:jacoco-maven-plugin:0.8.9` to `0.8.10`
2 changes: 1 addition & 1 deletion doc/dialects/exasol.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The SQL statement below creates the adapter script, defines the Java class that
```sql
CREATE JAVA ADAPTER SCRIPT SCHEMA_FOR_VS_SCRIPT.ADAPTER_SCRIPT_EXASOL AS
%scriptclass com.exasol.adapter.RequestDispatcher;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-10.5.0-exasol-7.1.2.jar;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-11.0.0-exasol-7.1.3.jar;
/
```

Expand Down
24 changes: 12 additions & 12 deletions pk_generated_parent.pom

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<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>
<artifactId>exasol-virtual-schema</artifactId>
<version>7.1.2</version>
<version>7.1.3</version>
<name>Exasol Virtual Schema</name>
<description>This projects contains the Exasol dialect for Exasol's Virtual Schema</description>
<url>https://github.com/exasol/exasol-virtual-schema/</url>
<properties>
<vscjdbc.version>10.5.0</vscjdbc.version>
<vscjdbc.version>11.0.0</vscjdbc.version>
</properties>
<distributionManagement>
<snapshotRepository>
Expand Down Expand Up @@ -105,7 +105,7 @@
<plugin>
<groupId>com.exasol</groupId>
<artifactId>project-keeper-maven-plugin</artifactId>
<version>2.9.7</version>
<version>2.9.9</version>
<executions>
<execution>
<goals>
Expand Down Expand Up @@ -190,7 +190,7 @@
<parent>
<artifactId>exasol-virtual-schema-generated-parent</artifactId>
<groupId>com.exasol</groupId>
<version>7.1.2</version>
<version>7.1.3</version>
<relativePath>pk_generated_parent.pom</relativePath>
</parent>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
final class ExasolProperties {
static final String EXASOL_IMPORT_PROPERTY = "IMPORT_FROM_EXA";
static final String EXASOL_CONNECTION_PROPERTY = "EXA_CONNECTION";
static final String EXASOL_IS_LOCAL_PROPERTY = "IS_LOCAL";

private ExasolProperties() {
// prevent instantiation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import static com.exasol.adapter.AdapterProperties.*;
import static com.exasol.adapter.capabilities.MainCapability.*;
import static com.exasol.adapter.dialects.exasol.ExasolProperties.EXASOL_CONNECTION_PROPERTY;
import static com.exasol.adapter.dialects.exasol.ExasolProperties.EXASOL_IMPORT_PROPERTY;
import static com.exasol.adapter.dialects.exasol.ExasolProperties.*;
import static com.exasol.adapter.sql.ScalarFunction.*;

import java.sql.SQLException;
Expand Down Expand Up @@ -36,10 +35,10 @@ public class ExasolSqlDialect extends AbstractSqlDialect {
public ExasolSqlDialect(final ConnectionFactory connectionFactory, final AdapterProperties properties) {
super(connectionFactory, properties,
Set.of(CATALOG_NAME_PROPERTY, SCHEMA_NAME_PROPERTY, EXASOL_IMPORT_PROPERTY, EXASOL_CONNECTION_PROPERTY,
IS_LOCAL_PROPERTY, IGNORE_ERRORS_PROPERTY), //
EXASOL_IS_LOCAL_PROPERTY, IGNORE_ERRORS_PROPERTY), //
List.of(SchemaNameProperty.validator(NAME), //
BooleanProperty.validator(EXASOL_IMPORT_PROPERTY), //
BooleanProperty.validator(IS_LOCAL_PROPERTY), //
BooleanProperty.validator(EXASOL_IS_LOCAL_PROPERTY), //
ImportProperty.validator(EXASOL_IMPORT_PROPERTY, EXASOL_CONNECTION_PROPERTY)));
this.omitParenthesesMap.addAll(Set.of(SYSDATE, SYSTIMESTAMP, CURRENT_SCHEMA, CURRENT_SESSION, CURRENT_STATEMENT,
CURRENT_USER, CURRENT_CLUSTER));
Expand Down Expand Up @@ -91,7 +90,7 @@ protected RemoteMetadataReader createRemoteMetadataReader() {
*/
@Override
protected QueryRewriter createQueryRewriter() {
if (this.properties.isLocalSource()) {
if (this.properties.isEnabled(EXASOL_IS_LOCAL_PROPERTY)) {
return new ExasolLocalQueryRewriter(this);
} else if (isImportFromExa(this.properties)) {
return new ExasolFromExaQueryRewriter(this, createRemoteMetadataReader());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.exasol.adapter.dialects.exasol;

import static com.exasol.adapter.AdapterProperties.CONNECTION_NAME_PROPERTY;
import static com.exasol.adapter.AdapterProperties.IS_LOCAL_PROPERTY;
import static com.exasol.adapter.dialects.exasol.ExasolProperties.EXASOL_CONNECTION_PROPERTY;
import static com.exasol.adapter.dialects.exasol.ExasolProperties.EXASOL_IMPORT_PROPERTY;
import static com.exasol.adapter.dialects.exasol.ExasolProperties.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.mockito.Mockito.mock;
Expand Down Expand Up @@ -69,7 +67,7 @@ void rewriteWithJdbcConnectionAndExpectedResultSetDataTypes(@Mock final Connecti

@Test
void rewriteLocal() throws AdapterException, SQLException {
final AdapterProperties properties = new AdapterProperties(Map.of(IS_LOCAL_PROPERTY, "true"));
final AdapterProperties properties = new AdapterProperties(Map.of(EXASOL_IS_LOCAL_PROPERTY, "true"));
final SqlDialect dialect = new ExasolSqlDialect(null, properties);
final QueryRewriter queryRewriter = new ExasolLocalQueryRewriter(dialect);
assertThat(queryRewriter.rewrite(this.statement, EMPTY_SELECT_LIST_DATA_TYPES, EXA_METADATA, properties),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.exasol.adapter.dialects.exasol;

import static com.exasol.adapter.dialects.exasol.ExasolProperties.EXASOL_IS_LOCAL_PROPERTY;
import static com.exasol.matcher.ResultSetStructureMatcher.table;

import java.util.*;
Expand All @@ -24,7 +25,7 @@ class ExasolSqlDialectLocalConnectionIT extends AbstractExasolSqlDialectIT {

@Override
protected Map<String, String> getConnectionSpecificVirtualSchemaProperties() {
return Map.of("IS_LOCAL", "true");
return Map.of(EXASOL_IS_LOCAL_PROPERTY, "true");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import static com.exasol.adapter.AdapterProperties.*;
import static com.exasol.adapter.capabilities.MainCapability.*;
import static com.exasol.adapter.dialects.exasol.ExasolProperties.EXASOL_CONNECTION_PROPERTY;
import static com.exasol.adapter.dialects.exasol.ExasolProperties.EXASOL_IMPORT_PROPERTY;
import static com.exasol.adapter.dialects.exasol.ExasolProperties.*;
import static com.exasol.adapter.dialects.exasol.ExasolSqlDialect.EXASOL_TIMESTAMP_WITH_LOCAL_TIME_ZONE_SWITCH;
import static com.exasol.reflect.ReflectionUtils.getMethodReturnViaReflection;
import static org.hamcrest.CoreMatchers.containsString;
Expand Down Expand Up @@ -154,7 +153,7 @@ void testCreateJdbcQueryRewriter(@Mock final Connection connectionMock) throws S

@Test
void testCreateLocalQueryRewriter() {
this.rawProperties.put(IS_LOCAL_PROPERTY, "true");
this.rawProperties.put(EXASOL_IS_LOCAL_PROPERTY, "true");
final AdapterProperties properties = new AdapterProperties(this.rawProperties);
final SqlDialect dialect = new ExasolSqlDialect(this.connectionFactoryMock, properties);
assertThat(getMethodReturnViaReflection(dialect, "createQueryRewriter"),
Expand Down Expand Up @@ -232,7 +231,7 @@ void testValidateSchemaProperty() throws PropertyValidationException {
@Test
void checkInvalidIsLocalProperty() {
final AdapterProperties adapterProperties = mandatory() //
.with(IS_LOCAL_PROPERTY, "asdasd") //
.with(EXASOL_IS_LOCAL_PROPERTY, "asdasd") //
.build();
final SqlDialect sqlDialect = new ExasolSqlDialect(null, adapterProperties);
final PropertyValidationException exception = assertThrows(PropertyValidationException.class,
Expand All @@ -243,14 +242,14 @@ void checkInvalidIsLocalProperty() {

@Test
void checkValidIsLocalProperty1() throws PropertyValidationException {
final AdapterProperties adapterProperties = mandatory().with(IS_LOCAL_PROPERTY, "TrUe").build();
final AdapterProperties adapterProperties = mandatory().with(EXASOL_IS_LOCAL_PROPERTY, "TrUe").build();
final SqlDialect sqlDialect = new ExasolSqlDialect(null, adapterProperties);
sqlDialect.validateProperties();
}

@Test
void checkValidIsLocalProperty() throws PropertyValidationException {
final AdapterProperties adapterProperties = mandatory().with(IS_LOCAL_PROPERTY, "FalSe").build();
final AdapterProperties adapterProperties = mandatory().with(EXASOL_IS_LOCAL_PROPERTY, "FalSe").build();
final SqlDialect sqlDialect = new ExasolSqlDialect(null, adapterProperties);
sqlDialect.validateProperties();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public final class IntegrationTestConfiguration {
* Do not use MavenProjectVersionGetter here to enable reference checker to check if reference points to the latest
* version.
*/
public static final String VIRTUAL_SCHEMAS_JAR_NAME_AND_VERSION = "virtual-schema-dist-10.5.0-exasol-7.1.2.jar";
public static final String VIRTUAL_SCHEMAS_JAR_NAME_AND_VERSION = "virtual-schema-dist-11.0.0-exasol-7.1.3.jar";
public static final Path PATH_TO_VIRTUAL_SCHEMAS_JAR = Path.of("target", VIRTUAL_SCHEMAS_JAR_NAME_AND_VERSION);

private IntegrationTestConfiguration() {
Expand Down

0 comments on commit bd134d6

Please sign in to comment.