-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Add Teradata connector #26574
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
Add Teradata connector #26574
Conversation
Implements the Teradata connector SPI with support for: • Connection setup • Schema retrieval • SQL pushdown support • Data type mapping Adds integration tests against a Teradata ClearScape Analytics™ Experience instance to verify connection, query execution, and result mapping. Updates documentation under connectors to include usage examples and configuration options. This connector extends Trino’s ecosystem to support Teradata users, allowing them to leverage Trino’s distributed query engine for federated queries.
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
Is it free to use? Otherwise, who's responsible for CI expenses? |
Removed not required tests
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
It is free of use. |
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
Fixed github error prone check issues
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
Could you add a test that overrides BaseConnectorTest? |
https://github.com/trinodb/trino/pull/26574/files#diff-b3eb8fb41d01a2646e4f9dd43103edcdedf1140acbbadcd0cc5fd5d3377dbd5cR62 we have already added TeradataJdbcConnectorTest, which extends BaseJdbcConnectorTest, and in turn extends BaseConnectorTest. |
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
Snowflake <connector/snowflake> | ||
SQL Server <connector/sqlserver> | ||
System <connector/system> | ||
Teradata <connector/teradata> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update ci.yml so we can run tests on CI. You can ask maintainers to add secrets to this repository in Slack.
<img src="../_static/img/teradata.png" class="connector-logo"> | ||
``` | ||
|
||
The Teradata connector allows querying and creating tables in an external Teradata database. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap at 80 characters. Same for other places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in new PR #26731
- `TINYINT` | ||
- `TINYINT` | ||
- | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove redundant empty lines and fix indentation:
* - Teradata type
- Trino type
- Notes
* - `TINYINT`
- `TINYINT`
-
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in new PR #26731
plugin/trino-teradata/pom.xml
Outdated
<parent> | ||
<groupId>io.trino</groupId> | ||
<artifactId>trino-root</artifactId> | ||
<version>476</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to 477-SNAPSHOT
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to 478-SNAPSHOT
as per latest code of trino core
<packaging>trino-plugin</packaging> | ||
<name>${project.artifactId}</name> | ||
<description>Trino - Teradata connector</description> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable compiler fail warnings:
<properties>
<air.compiler.fail-warnings>true</air.compiler.fail-warnings>
</properties>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in new PR #26731
public void testNumericAggregationPushdown() | ||
{ | ||
if (!this.hasBehavior(TestingConnectorBehavior.SUPPORTS_AGGREGATION_PUSHDOWN)) { | ||
Assertions.assertThat(this.query("SELECT min(nationkey) FROM nation")).isNotFullyPushedDown(AggregationNode.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Static import assertThat
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in new PR #26731
{ | ||
if (!this.hasBehavior(TestingConnectorBehavior.SUPPORTS_AGGREGATION_PUSHDOWN)) { | ||
Assertions.assertThat(this.query("SELECT min(nationkey) FROM nation")).isNotFullyPushedDown(AggregationNode.class); | ||
Assertions.assertThat(this.query("SELECT max(nationkey) FROM nation")).isNotFullyPushedDown(AggregationNode.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove redundant this.
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in new PR #26731
|
||
tableName = "test_ctas" + randomNameSuffix(); | ||
assertExplainAnalyze("EXPLAIN ANALYZE CREATE TABLE " + tableName + " AS SELECT name FROM nation"); | ||
assertQuery("SELECT * from " + tableName, "SELECT name FROM nation"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use assertThat(query(...))
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in new PR #26731
import static io.trino.type.JsonType.JSON; | ||
import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; | ||
|
||
public class TestTeradataJDBCTypeMapping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to TestTeradataTypeMapping.
Also, please follow our test guideline. https://trino.io/docs/current/develop/tests.html#conventions-and-recommendations
- Test classes should be defined as package-private and final.
- Test methods should be defined as package-private.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in new PR #26731
@Test | ||
public void testByteint() | ||
{ | ||
SqlDataTypeTest.create().addRoundTrip("byteint", "0", TINYINT, "CAST(0 AS TINYINT)").addRoundTrip("byteint", "127", TINYINT, "CAST(127 AS TINYINT)").addRoundTrip("byteint", "-128", TINYINT, "CAST(-128 AS TINYINT)").addRoundTrip("byteint", "null", TINYINT, "CAST(null AS TINYINT)").execute(getQueryRunner(), teradataJDBCCreateAndInsert("byteint")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap per round trip:
SqlDataTypeTest.create()
.addRoundTrip("byteint", "0", TINYINT, "CAST(0 AS TINYINT)")
.addRoundTrip("byteint", "127", TINYINT, "CAST(127 AS TINYINT)")
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in #26731
Description
This PR introduces the Teradata connector, enabling Trino to
query and interact with Teradata data sources.
Key additions:
Implements the Teradata connector SPI with support for:
• Connection setup
• Schema retrieval
• SQL pushdown support
• Data type mapping
Adds integration tests against a Teradata ClearScape Analytics™ Experience instance to verify
connection, query execution, and result mapping.
Updates documentation under connectors to include usage
examples and configuration options.
This connector extends Trino’s ecosystem to support Teradata users, allowing them
to leverage Trino’s distributed query engine for federated queries.
Additional context and related issues
The Teradata connector module has both unit tests and integration tests.
The integration tests require access to a Teradata ClearScape Analytics™ Experience.
You can follow the steps below to run the integration tests locally.
Prerequisites
1. Create a new ClearScape Analytics™ Experience account
If you don't already have one, sign up at:
Teradata ClearScape Analytics™ Experience
2. Login
Sign in with your new account at:
ClearScape Analytics™ Experience Login
3. Collect the API Token
Use the Copy API Token button in the UI to retrieve your token.
4. Define the following environment variables
Running Integration Tests
Once the environment variables are set, run the integration tests with:
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
(x) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: