Skip to content

Commit

Permalink
Import from ora: provide explicit type mappings via added switch (#20)
Browse files Browse the repository at this point in the history
* #14 #18 provide explicit type mappings via added switch
  • Loading branch information
pj-spoelders authored Apr 11, 2022
1 parent 45e4dfb commit e7c772f
Show file tree
Hide file tree
Showing 19 changed files with 567 additions and 301 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/broken_links_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ on:
jobs:
linkChecker:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Configure broken links checker
run: |
mkdir -p ./target
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/ci-build-next-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,20 @@ on:
jobs:
java-17-compatibility:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout the repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 17
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
cache: 'maven'
- name: Run tests and build with Maven
run: |
mvn --batch-mode --update-snapshots clean package -DtrimStackTrace=false \
Expand All @@ -35,3 +32,4 @@ jobs:
if: ${{ always() && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
fail_if_no_tests: false
10 changes: 2 additions & 8 deletions .github/workflows/dependencies_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 11
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
cache: 'maven'
- name: Checking dependencies for vulnerabilities
run: mvn org.sonatype.ossindex.maven:ossindex-maven-plugin:audit -f pom.xml
10 changes: 2 additions & 8 deletions .github/workflows/release_droid_print_quick_checksum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 11
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
cache: 'maven'
- name: Build with Maven skipping tests
run: mvn --batch-mode clean verify -DskipTests
- name: Print checksum
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/release_droid_upload_github_release_assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 11
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
cache: 'maven'
- name: Build with Maven skipping tests
run: mvn clean verify -DskipTests
run: mvn --batch-mode clean verify -DskipTests
- name: Generate sha256sum files
run: find target -maxdepth 1 -name *.jar -exec bash -c 'sha256sum {} > {}.sha256' \;
- name: Upload assets to the GitHub release draft
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ pom.xml.versionsBackup
*.old
*.md.html
.vscode/

*.flattened-pom.xml
10 changes: 10 additions & 0 deletions .project-keeper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
sources:
- type: maven
path: pom.xml
modules:
- integration_tests
- udf_coverage
- jar_artifact
excludes:
- "E-PK-CORE-18: Outdated content: '.github/workflows/ci-build.yml'"
- "E-PK-CORE-18: Outdated content: '.github/workflows/release_droid_prepare_original_checksum.yml'"
82 changes: 45 additions & 37 deletions dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,70 +26,78 @@
| [udf-debugging-java][26] | [MIT][1] |
| [Matcher for SQL Result Sets][28] | [MIT][1] |
| [virtual-schema-shared-integration-tests][30] | [MIT][1] |
| [JaCoCo :: Agent][32] | [Eclipse Public License 2.0][33] |

## Plugin Dependencies

| Dependency | License |
| ------------------------------------------------------- | ---------------------------------------------- |
| [JaCoCo :: Maven Plugin][32] | [Eclipse Public License 2.0][33] |
| [Maven Surefire Plugin][34] | [Apache License, Version 2.0][17] |
| [SonarQube Scanner for Maven][34] | [GNU LGPL 3][35] |
| [Apache Maven Compiler Plugin][36] | [Apache License, Version 2.0][17] |
| [Apache Maven Assembly Plugin][38] | [Apache License, Version 2.0][17] |
| [Maven Failsafe Plugin][40] | [Apache License, Version 2.0][17] |
| [Apache Maven Enforcer Plugin][42] | [Apache License, Version 2.0][17] |
| [Versions Maven Plugin][44] | [Apache License, Version 2.0][17] |
| [Artifact reference checker and unifier][46] | [MIT][1] |
| [Project keeper maven plugin][48] | [MIT][1] |
| [error-code-crawler-maven-plugin][50] | [MIT][1] |
| [org.sonatype.ossindex.maven:ossindex-maven-plugin][52] | [ASL2][53] |
| [Maven Dependency Plugin][54] | [The Apache Software License, Version 2.0][53] |
| [Reproducible Build Maven Plugin][56] | [Apache 2.0][53] |
| [Apache Maven JAR Plugin][58] | [Apache License, Version 2.0][17] |
| [Maven Clean Plugin][60] | [The Apache Software License, Version 2.0][53] |
| [Maven Resources Plugin][62] | [The Apache Software License, Version 2.0][53] |
| [Maven Install Plugin][64] | [The Apache Software License, Version 2.0][53] |
| [Maven Deploy Plugin][66] | [The Apache Software License, Version 2.0][53] |
| [Maven Site Plugin 3][68] | [The Apache Software License, Version 2.0][53] |
| [Apache Maven Enforcer Plugin][38] | [Apache License, Version 2.0][17] |
| [Maven Flatten Plugin][40] | [Apache Software Licenese][41] |
| [org.sonatype.ossindex.maven:ossindex-maven-plugin][42] | [ASL2][41] |
| [Reproducible Build Maven Plugin][44] | [Apache 2.0][41] |
| [Maven Surefire Plugin][46] | [Apache License, Version 2.0][17] |
| [Versions Maven Plugin][48] | [Apache License, Version 2.0][17] |
| [Project keeper maven plugin][50] | [The MIT License][51] |
| [Apache Maven Assembly Plugin][52] | [Apache License, Version 2.0][17] |
| [Apache Maven JAR Plugin][54] | [Apache License, Version 2.0][17] |
| [Artifact reference checker and unifier][56] | [MIT][1] |
| [Apache Maven Dependency Plugin][58] | [Apache License, Version 2.0][17] |
| [Maven Failsafe Plugin][60] | [Apache License, Version 2.0][17] |
| [JaCoCo :: Maven Plugin][62] | [Eclipse Public License 2.0][33] |
| [error-code-crawler-maven-plugin][64] | [MIT][1] |
| [Maven Clean Plugin][66] | [The Apache Software License, Version 2.0][41] |
| [Maven Resources Plugin][68] | [The Apache Software License, Version 2.0][41] |
| [Maven Install Plugin][70] | [The Apache Software License, Version 2.0][41] |
| [Maven Deploy Plugin][72] | [The Apache Software License, Version 2.0][41] |
| [Maven Site Plugin 3][74] | [The Apache Software License, Version 2.0][41] |

[48]: https://github.com/exasol/project-keeper-maven-plugin
[32]: https://www.eclemma.org/jacoco/index.html
[4]: https://github.com/exasol/error-reporting-java
[6]: https://www.oracle.com/database/technologies/maven-central-guide.html
[2]: https://github.com/exasol/db-fundamentals-java
[53]: http://www.apache.org/licenses/LICENSE-2.0.txt
[34]: https://maven.apache.org/surefire/maven-surefire-plugin/
[60]: http://maven.apache.org/plugins/maven-clean-plugin/
[41]: http://www.apache.org/licenses/LICENSE-2.0.txt
[46]: https://maven.apache.org/surefire/maven-surefire-plugin/
[66]: http://maven.apache.org/plugins/maven-clean-plugin/
[7]: https://www.oracle.com/downloads/licenses/oracle-free-license.html
[1]: https://opensource.org/licenses/MIT
[14]: https://github.com/mockito/mockito
[40]: https://maven.apache.org/surefire/maven-failsafe-plugin/
[60]: https://maven.apache.org/surefire/maven-failsafe-plugin/
[24]: https://github.com/exasol/test-db-builder-java
[30]: https://github.com/exasol/virtual-schema-shared-integration-tests
[44]: http://www.mojohaus.org/versions-maven-plugin/
[54]: http://maven.apache.org/plugins/maven-dependency-plugin/
[48]: http://www.mojohaus.org/versions-maven-plugin/
[50]: https://github.com/exasol/project-keeper/
[11]: http://opensource.org/licenses/BSD-3-Clause
[36]: https://maven.apache.org/plugins/maven-compiler-plugin/
[21]: http://opensource.org/licenses/MIT
[0]: https://github.com/exasol/virtual-schema-common-jdbc
[33]: https://www.eclipse.org/legal/epl-2.0/
[35]: http://www.gnu.org/licenses/lgpl.txt
[18]: https://github.com/exasol/exasol-testcontainers
[32]: https://www.jacoco.org/jacoco/trunk/doc/maven.html
[62]: https://www.jacoco.org/jacoco/trunk/doc/maven.html
[15]: https://github.com/mockito/mockito/blob/main/LICENSE
[28]: https://github.com/exasol/hamcrest-resultset-matcher
[56]: http://zlika.github.io/reproducible-build-maven-plugin
[44]: http://zlika.github.io/reproducible-build-maven-plugin
[51]: https://github.com/exasol/project-keeper/blob/main/LICENSE
[58]: https://maven.apache.org/plugins/maven-dependency-plugin/
[17]: https://www.apache.org/licenses/LICENSE-2.0.txt
[34]: http://sonarsource.github.io/sonar-scanner-maven/
[16]: https://www.jqno.nl/equalsverifier
[42]: https://maven.apache.org/enforcer/maven-enforcer-plugin/
[38]: https://maven.apache.org/enforcer/maven-enforcer-plugin/
[13]: https://www.eclipse.org/legal/epl-v20.html
[64]: http://maven.apache.org/plugins/maven-install-plugin/
[70]: http://maven.apache.org/plugins/maven-install-plugin/
[12]: https://junit.org/junit5/
[52]: https://sonatype.github.io/ossindex-maven/maven-plugin/
[42]: https://sonatype.github.io/ossindex-maven/maven-plugin/
[20]: https://testcontainers.org
[40]: https://www.mojohaus.org/flatten-maven-plugin/flatten-maven-plugin
[26]: https://github.com/exasol/udf-debugging-java
[10]: http://hamcrest.org/JavaHamcrest/
[66]: http://maven.apache.org/plugins/maven-deploy-plugin/
[68]: http://maven.apache.org/plugins/maven-site-plugin/
[62]: http://maven.apache.org/plugins/maven-resources-plugin/
[46]: https://github.com/exasol/artifact-reference-checker-maven-plugin
[50]: https://github.com/exasol/error-code-crawler-maven-plugin
[58]: https://maven.apache.org/plugins/maven-jar-plugin/
[38]: https://maven.apache.org/plugins/maven-assembly-plugin/
[72]: http://maven.apache.org/plugins/maven-deploy-plugin/
[74]: http://maven.apache.org/plugins/maven-site-plugin/
[68]: http://maven.apache.org/plugins/maven-resources-plugin/
[56]: https://github.com/exasol/artifact-reference-checker-maven-plugin
[64]: https://github.com/exasol/error-code-crawler-maven-plugin
[54]: https://maven.apache.org/plugins/maven-jar-plugin/
[52]: https://maven.apache.org/plugins/maven-assembly-plugin/
19 changes: 17 additions & 2 deletions doc/changes/changes_2.2.0.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
# Virtual Schema for Oracle 2.2.0, released 2022-??-??
# Virtual Schema for Oracle 2.2.0, released 2022-04-11

Code name:
Code name: Import from ora: explicit data types switch.

## Features

* #14: Explicitly state types when using IMPORT_FROM_ORA: Added GENERATE_JDBC_DATATYPE_MAPPING_FOR_OCI flag to virtual schema adapter for this functionality.
## Dependency Updates

### Test Dependency Updates

* Updated `com.exasol:virtual-schema-shared-integration-tests:2.1.1` to `2.2.0`
* Added `org.jacoco:org.jacoco.agent:0.8.5`

### Plugin Dependency Updates

* Updated `com.exasol:error-code-crawler-maven-plugin:0.7.1` to `1.1.0`
* Updated `com.exasol:project-keeper-maven-plugin:1.3.4` to `2.3.0`
* Updated `org.apache.maven.plugins:maven-dependency-plugin:2.8` to `3.2.0`
* Updated `org.apache.maven.plugins:maven-jar-plugin:3.2.2` to `3.2.0`
* Added `org.codehaus.mojo:flatten-maven-plugin:1.2.7`
* Updated `org.codehaus.mojo:versions-maven-plugin:2.9.0` to `2.8.1`
* Added `org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184`
* Updated `org.sonatype.ossindex.maven:ossindex-maven-plugin:3.2.0` to `3.1.0`
26 changes: 25 additions & 1 deletion doc/user_guide/oracle_user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,38 @@ CREATE VIRTUAL SCHEMA <virtual schema name>
IMPORT_FROM_ORA = 'true'
ORA_CONNECTION_NAME = 'ORA_CONNECTION';
```
### Auto generated datatype mapping list while using IMPORT_FROM_ORA.
Using `IMPORT FROM ORA` might lead to some unexpected datatype mappings. Unlike for a JDBC connection there's no explicit data mapping being generated when using `IMPORT FROM ORA`.
As a current stopgap solution for this issue we now (starting from version 2.2.0) also provide a `GENERATE_JDBC_DATATYPE_MAPPING_FOR_OCI` switch you can specify and enable when creating the virtual schema.
```sql
CREATE VIRTUAL SCHEMA <virtual schema name>
USING ADAPTER.JDBC_ADAPTER
WITH
CONNECTION_NAME = 'ORACLE_JDBC_CONNECTION'
SCHEMA_NAME = '<schema name>'
IMPORT_FROM_ORA = 'true'
GENERATE_JDBC_DATATYPE_MAPPING_FOR_OCI = 'true'
ORA_CONNECTION_NAME = 'ORA_CONNECTION';
```
This will add explicit datatype mapping to the generated command when using `IMPORT FROM ORA`.

Example:

Before

`IMPORT FROM ORA AT ORACLE_CON STATEMENT ...`

After setting `GENERATE_JDBC_DATATYPE_MAPPING_FOR_OCI` to `true`

`IMPORT INTO(c1 DECIMAL(36,1), c2 .... ) FROM ORA AT ORACLE_CON STATEMENT ...`

## Supported Capabilities

The Oracle dialect does not support all capabilities. A complete list can be found in [OracleSqlDialect.getCapabilities()](../../src/main/java/com/exasol/adapter/dialects/oracle/OracleSqlDialect.java).

## Type Mappings and Limitations

| Orcale Data Type | Supported | Converted Exasol Data Type | Comments |
| Oracle Data Type | Supported | Converted Exasol Data Type | Comments |
| -------------------------------------------------------------------------------- | --------- | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| BINARY\_DOUBLE || VARCHAR(2000000) | |
| BINARY\_FLOAT || VARCHAR(2000000) | |
Expand Down
2 changes: 2 additions & 0 deletions lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config.stopBubbling = true
lombok.addLombokGeneratedAnnotation = true
Loading

0 comments on commit e7c772f

Please sign in to comment.