Skip to content

Commit 8e2bdee

Browse files
marcosmarxmsatish-chinthanippuevantahler
authored andcommitted
Destination Teradata: make connector avaialble on Airbyte Cloud (airbytehq#28667)
Co-authored-by: SatishChGit <[email protected]> Co-authored-by: evantahler <[email protected]>
1 parent 7fbaf0b commit 8e2bdee

File tree

5 files changed

+31
-19
lines changed

5 files changed

+31
-19
lines changed

airbyte-integrations/connectors/destination-teradata/metadata.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@ data:
22
connectorSubtype: database
33
connectorType: destination
44
definitionId: 58e6f9da-904e-11ed-a1eb-0242ac120002
5-
dockerImageTag: 0.1.3
5+
dockerImageTag: 0.1.5
66
dockerRepository: airbyte/destination-teradata
77
githubIssueLabel: destination-teradata
88
icon: teradata.svg
99
license: MIT
1010
name: Teradata Vantage
1111
registries:
1212
cloud:
13-
enabled: false
13+
enabled: true
1414
oss:
1515
enabled: true
1616
releaseStage: alpha
1717
documentationUrl: https://docs.airbyte.com/integrations/destinations/teradata
18-
supportsDbt: true
1918
tags:
2019
- language:java
2120
ab_internal:

airbyte-integrations/connectors/destination-teradata/src/main/java/io/airbyte/integrations/destination/teradata/TeradataDestination.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ public class TeradataDestination extends AbstractJdbcDestination implements Dest
4949

5050
protected static final String CA_CERT_KEY = "ssl_ca_certificate";
5151

52+
protected static final String ENCRYPTDATA = "ENCRYPTDATA";
53+
54+
protected static final String ENCRYPTDATA_ON = "ON";
55+
5256
public static void main(String[] args) throws Exception {
5357
new IntegrationRunner(new TeradataDestination()).run(args);
5458
}
@@ -57,6 +61,12 @@ public TeradataDestination() {
5761
super(DRIVER_CLASS, new StandardNameTransformer(), new TeradataSqlOperations());
5862
}
5963

64+
private static void createCertificateFile(String fileName, String fileValue) throws IOException {
65+
try (final PrintWriter out = new PrintWriter(fileName, StandardCharsets.UTF_8)) {
66+
out.print(fileValue);
67+
}
68+
}
69+
6070
@Override
6171
protected Map<String, String> getDefaultConnectionProperties(final JsonNode config) {
6272
final Map<String, String> additionalParameters = new HashMap<>();
@@ -69,15 +79,10 @@ protected Map<String, String> getDefaultConnectionProperties(final JsonNode conf
6979
additionalParameters.put(PARAM_SSLMODE, REQUIRE);
7080
}
7181
}
82+
additionalParameters.put(ENCRYPTDATA, ENCRYPTDATA_ON);
7283
return additionalParameters;
7384
}
7485

75-
private static void createCertificateFile(String fileName, String fileValue) throws IOException {
76-
try (final PrintWriter out = new PrintWriter(fileName, StandardCharsets.UTF_8)) {
77-
out.print(fileValue);
78-
}
79-
}
80-
8186
private Map<String, String> obtainConnectionOptions(final JsonNode encryption) {
8287
final Map<String, String> additionalParameters = new HashMap<>();
8388
if (!encryption.isNull()) {

airbyte-integrations/connectors/destination-teradata/src/main/java/io/airbyte/integrations/destination/teradata/TeradataSqlOperations.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ public void createTableIfNotExists(final JdbcDatabase database, final String sch
107107
@Override
108108
public String createTableQuery(final JdbcDatabase database, final String schemaName, final String tableName) {
109109
return String.format(
110-
"CREATE SET TABLE %s.%s, FALLBACK ( \n" + "%s VARCHAR(256), \n" + "%s JSON, \n" + "%s TIMESTAMP(6) \n"
111-
+ ");\n",
110+
"CREATE SET TABLE %s.%s, FALLBACK ( %s VARCHAR(256), %s JSON, %s TIMESTAMP(6)) " +
111+
" UNIQUE PRIMARY INDEX (%s) ",
112112
schemaName, tableName, JavaBaseConstants.COLUMN_NAME_AB_ID, JavaBaseConstants.COLUMN_NAME_DATA,
113-
JavaBaseConstants.COLUMN_NAME_EMITTED_AT);
113+
JavaBaseConstants.COLUMN_NAME_EMITTED_AT, JavaBaseConstants.COLUMN_NAME_AB_ID);
114114
}
115115

116116
@Override

airbyte-integrations/connectors/destination-teradata/src/test-integration/java/io/airbyte/integrations/destination/teradata/TeradataDestinationAcceptanceTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,12 @@ public void testSecondSync() {
179179
// overrides test in coming releases
180180
}
181181

182+
@Override
183+
@Test
184+
public void testCustomDbtTransformations() throws Exception {
185+
// overrides test in coming releases
186+
}
187+
182188
protected DataSource getDataSource(final JsonNode config) {
183189
final JsonNode jdbcConfig = destination.toJdbcConfig(config);
184190
return DataSourceFactory.create(jdbcConfig.get(JdbcUtils.USERNAME_KEY).asText(),

docs/integrations/destinations/teradata.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ You'll need the following information to configure the Teradata destination:
2626

2727
Each stream will be output into its own table in Teradata. Each table will contain 3 columns:
2828

29-
- `_airbyte_ab_id`: a uuid assigned by Airbyte to each event that is processed. The column type in Teradata is `VARCHAR(256)`.
29+
- `_airbyte_ab_id`: a unique uuid assigned by Airbyte to each event that is processed. This is the primary index column. The column type in Teradata is `VARCHAR(256)`.
3030
- `_airbyte_emitted_at`: a timestamp representing when the event was pulled from the data source. The column type in Teradata is `TIMESTAMP(6)`.
3131
- `_airbyte_data`: a json blob representing with the event data. The column type in Teradata is `JSON`.
3232

@@ -84,9 +84,11 @@ You can also use a pre-existing user but we highly recommend creating a dedicate
8484

8585
## CHANGELOG
8686

87-
| Version | Date | Pull Request | Subject |
88-
| :------ | :--------- | :---------------------------------------------- | :------------------------------- |
89-
| 0.1.3 | 2023-08-17 | https://github.com/airbytehq/airbyte/pull/30740 | Enable custom DBT transformation |
90-
| 0.1.2 | 2023-08-09 | https://github.com/airbytehq/airbyte/pull/29174 | Small internal refactor |
91-
| 0.1.1 | 2023-03-03 | https://github.com/airbytehq/airbyte/pull/21760 | Added SSL support |
92-
| 0.1.0 | 2022-12-13 | https://github.com/airbytehq/airbyte/pull/20428 | New Destination Teradata Vantage |
87+
| Version | Date | Pull Request | Subject |
88+
|:--------|:-----------| :---------------------------------------------- |:--------------------------------------------------------|
89+
| 0.1.5 | 2024-01-12 | https://github.com/airbytehq/airbyte/pull/33872 | Added Primary Index on _airbyte_ab_id to fix NoPI issue |
90+
| 0.1.4 | 2023-12-04 | https://github.com/airbytehq/airbyte/pull/28667 | Make connector available on Airbyte Cloud |
91+
| 0.1.3 | 2023-08-17 | https://github.com/airbytehq/airbyte/pull/30740 | Enable custom DBT transformation |
92+
| 0.1.2 | 2023-08-09 | https://github.com/airbytehq/airbyte/pull/29174 | Small internal refactor |
93+
| 0.1.1 | 2023-03-03 | https://github.com/airbytehq/airbyte/pull/21760 | Added SSL support |
94+
| 0.1.0 | 2022-12-13 | https://github.com/airbytehq/airbyte/pull/20428 | New Destination Teradata Vantage |

0 commit comments

Comments
 (0)