Skip to content

Commit 561fabe

Browse files
🐛 BUG-4307: Fix incorrect handling of LONG RAW data type (#7125)
1 parent b230bc5 commit 561fabe

File tree

8 files changed

+59
-6
lines changed

8 files changed

+59
-6
lines changed

airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/b39a7370-74c3-45a6-ac3a-380d48520a83.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"sourceDefinitionId": "b39a7370-74c3-45a6-ac3a-380d48520a83",
33
"name": "Oracle DB",
44
"dockerRepository": "airbyte/source-oracle",
5-
"dockerImageTag": "0.3.7",
5+
"dockerImageTag": "0.3.8",
66
"documentationUrl": "https://docs.airbyte.io/integrations/sources/oracle"
77
}

airbyte-config/init/src/main/resources/seed/source_definitions.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@
332332
- sourceDefinitionId: b39a7370-74c3-45a6-ac3a-380d48520a83
333333
name: Oracle DB
334334
dockerRepository: airbyte/source-oracle
335-
dockerImageTag: 0.3.7
335+
dockerImageTag: 0.3.8
336336
documentationUrl: https://docs.airbyte.io/integrations/sources/oracle
337337
sourceType: database
338338
- sourceDefinitionId: c8630570-086d-4a40-99ae-ea5b18673071
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Oracle Source
2+
The Oracle source connector allows syncing the data from the Oracle DB. The current source connector supports Oracle 11g or above.
3+
The connector uses *ojdbc8* driver underneath to establish the connection. The Oracle source does not alter the schema present in your database.
4+
5+
### Important details
6+
Connector works with `useFetchSizeWithLongColumn=true` property, which required to select the data from `LONG` or `LONG RAW` type columns.
7+
Oracle recommends avoiding LONG and LONG RAW columns. Use LOB instead. They are included in Oracle only for legacy reasons.
8+
THIS IS A THIN ONLY PROPERTY. IT SHOULD NOT BE USED WITH ANY OTHER DRIVERS.
9+
10+
See [this](https://docs.airbyte.io/integrations/sources/oracle) link for the nuances about the connector.

airbyte-integrations/connectors/source-oracle/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ ENV TZ UTC
88
COPY build/distributions/${APPLICATION}*.tar ${APPLICATION}.tar
99
RUN tar xf ${APPLICATION}.tar --strip-components=1
1010

11-
LABEL io.airbyte.version=0.3.7
11+
LABEL io.airbyte.version=0.3.8
1212
LABEL io.airbyte.name=airbyte/source-oracle
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Oracle Source
2+
3+
## Documentation
4+
This is the repository for the Oracle only source connector in Java.
5+
For information about how to use this connector within Airbyte, see [User Documentation](https://docs.airbyte.io/integrations/sources/oracle)
6+
7+
## Local development
8+
9+
#### Building via Gradle
10+
From the Airbyte repository root, run:
11+
```
12+
./gradlew :airbyte-integrations:connectors:source-oracle:build
13+
```
14+
15+
### Locally running the connector docker image
16+
17+
#### Build
18+
Build the connector image via Gradle:
19+
```
20+
./gradlew :airbyte-integrations:connectors:source-oracle:airbyteDocker
21+
```
22+
When building via Gradle, the docker image name and tag, respectively, are the values of the `io.airbyte.name` and `io.airbyte.version` `LABEL`s in
23+
the Dockerfile.
24+
25+
## Testing
26+
We use `JUnit` for Java tests.
27+
28+
### Test Configuration
29+
#### Acceptance Tests
30+
To run acceptance and custom integration tests:
31+
```
32+
./gradlew :airbyte-integrations:connectors:source-oracle:integrationTest
33+
```

airbyte-integrations/connectors/source-oracle/src/main/java/io/airbyte/integrations/source/oracle/OracleSource.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ public static Source sshWrappedSource() {
5555
public JsonNode toDatabaseConfig(final JsonNode config) {
5656
final List<String> additionalParameters = new ArrayList<>();
5757

58+
/*
59+
The property useFetchSizeWithLongColumn required to select LONG or LONG RAW columns.
60+
Oracle recommends avoiding LONG and LONG RAW columns. Use LOB instead. They are included in Oracle only for legacy reasons.
61+
THIS IS A THIN ONLY PROPERTY. IT SHOULD NOT BE USED WITH ANY OTHER DRIVERS.
62+
See https://docs.oracle.com/cd/E11882_01/appdev.112/e13995/oracle/jdbc/OracleDriver.html
63+
https://docs.oracle.com/cd/B19306_01/java.102/b14355/jstreams.htm#i1014085
64+
*/
65+
additionalParameters.add("oracle.jdbc.useFetchSizeWithLongColumn=true");
66+
5867
final Protocol protocol = config.has("encryption")
5968
? obtainConnectionProtocol(config.get("encryption"), additionalParameters)
6069
: Protocol.TCP;

airbyte-integrations/connectors/source-oracle/src/test-integration/java/io/airbyte/integrations/source/oracle/OracleSourceDatatypeTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ protected void initTests() {
174174
TestDataHolder.builder()
175175
.sourceType("BINARY_DOUBLE")
176176
.airbyteType(JsonSchemaPrimitive.NUMBER)
177-
.addInsertValues("126.45d", "2.22507485850720E-308", "TO_BINARY_DOUBLE('1.79769313486231E+308')", "BINARY_DOUBLE_INFINITY")
177+
.addInsertValues("126.45d", "2.22507485850720E-308", "1.79769313486231E+308d", "BINARY_DOUBLE_INFINITY")
178178
.addExpectedValues("126.45", "0.0", "1.79769313486231E308", "Infinity")
179179
.build());
180180

@@ -266,8 +266,8 @@ protected void initTests() {
266266
.sourceType("LONG")
267267
.airbyteType(JsonSchemaPrimitive.STRING)
268268
.fullSourceDataType("LONG RAW")
269-
// @TODO stream fails when reading data back
270-
// .addInsertValues("utl_raw.cast_to_raw('some content here')", "null")
269+
.addInsertValues("utl_raw.cast_to_raw('some content here')", "null")
270+
.addExpectedValues("c29tZSBjb250ZW50IGhlcmU=", null)
271271
.build());
272272

273273
addDataTypeTestData(

docs/integrations/sources/oracle.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ Airbite has the ability to connect to the Oracle source with 3 network connectiv
132132

133133
| Version | Date | Pull Request | Subject |
134134
| :--- | :--- | :--- | :--- |
135+
| 0.3.8 | 2021-10-13 | [7125](https://github.com/airbytehq/airbyte/pull/7125) | Fix incorrect handling of LONG RAW data type |
135136
| 0.3.7 | 2021-10-01 | [6616](https://github.com/airbytehq/airbyte/pull/6616) | Added network encryption options |
136137
| 0.3.6 | 2021-09-30 | [6585](https://github.com/airbytehq/airbyte/pull/6585) | Improved SSH Tunnel key generation steps |
137138
| 0.3.5 | 2021-09-22 | [6356](https://github.com/airbytehq/airbyte/pull/6356) | Added option to connect to DB via SSH. |

0 commit comments

Comments
 (0)