Skip to content

New HsqlDB connector #23061

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

New HsqlDB connector #23061

wants to merge 2 commits into from

Conversation

prrvchr
Copy link
Member

@prrvchr prrvchr commented Aug 16, 2024

Description

Add new HsqlDB connector

Additional context and related issues

I would like to add some pure JDBC functions to Trino in order to be able to provide better integration with LibreOffice Base.
This new connector is a good way to achieve this...
The ultimate goal is to offer LibreOffice Base the possibility via Trino to consolidate or even edit data coming from different DBMS in a very easy way.

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(x) Release notes are required, with the following suggested text:

# Section
* Add HsqlDB connector to Trino.

@cla-bot cla-bot bot added the cla-signed label Aug 16, 2024
@prrvchr prrvchr requested a review from ebyhr August 16, 2024 22:18
@prrvchr prrvchr force-pushed the hsqldb branch 4 times, most recently from b50a6ca to a559036 Compare August 17, 2024 02:25
@prrvchr prrvchr added the enhancement New feature or request label Aug 17, 2024
@prrvchr prrvchr force-pushed the hsqldb branch 4 times, most recently from e02c7ae to b7fddc2 Compare August 21, 2024 13:35
@prrvchr
Copy link
Member Author

prrvchr commented Aug 22, 2024

Well I have to admit that I only have 4GB of memory on my laptop and that I am unable to launch the tests locally (it freezes my terminal) and that therefore I am obliged to push in order to obtain a result...
So this might take a little time...

@prrvchr prrvchr force-pushed the hsqldb branch 3 times, most recently from 35a052b to 7051d03 Compare August 22, 2024 12:02
@prrvchr prrvchr requested review from martint and findepi August 22, 2024 12:58
case Types.TIMESTAMP:
TimestampType timestampType = createTimestampType(getTimestampPrecision(typeHandle.requiredColumnSize()));
return Optional.of(timestampColumnMapping(timestampType));
case Types.TIMESTAMP_WITH_TIMEZONE:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend removing timestamp types from the initial PR as most developers introduce a bug during the implementation.

Copy link
Member Author

@prrvchr prrvchr Sep 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, TIMESTAMP and TIMESTAMP_WITH_TIMEZONE were removed from this initial PR (ie: see file HsqlDbClient.java)

private static Properties getConnectionProperties()
{
Properties connectionProperties = new Properties();
connectionProperties.setProperty("hsqldb.default_table_type", "cached");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth leaving a code comment why specifying this property.

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

public abstract class BaseHsqlDbConnectorTest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove a redundant base class. All code should go to TestHsqlDbConnectorTest.

protected boolean hasBehavior(TestingConnectorBehavior connectorBehavior)
{
return switch (connectorBehavior) {
case SUPPORTS_ADD_COLUMN,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sort alphabetically. Also, remove redundant conditions holding the same value in the base class.

@Language("RegExp")
protected String errorMessageForInsertNegativeDate(String date)
{
System.out.println("*********************************************************************************************");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove redundant System.out.println. Same for others.

}
}

public static void main(String[] args)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move main method to the bottom.


import static org.assertj.core.api.Assertions.assertThat;

public class TestHsqlDbJdbcConfig
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://trino.io/docs/current/develop/tests.html

Test classes should be defined as package-private and final.

Same for others.

public class TestHsqlDbJdbcConfig
{
@Test
public void testIsUrlValid()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://trino.io/docs/current/develop/tests.html

Test methods should be defined as package-private.

Same for others.


import static io.trino.plugin.hsqldb.TestingHsqlDbServer.DEFAULT_VERSION;

public class TestHsqlDbLatestConnectorSmokeTest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add a smoke test unless you run with the different HSQLDB version from TestHsqlDbConnectorTest.

Copy link

This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua

@github-actions github-actions bot added the stale label Oct 14, 2024
Copy link

github-actions bot commented Nov 4, 2024

Closing this pull request, as it has been stale for six weeks. Feel free to re-open at any time.

@github-actions github-actions bot closed this Nov 4, 2024
@mosabua mosabua reopened this Nov 4, 2024
@mosabua mosabua added stale-ignore Use this label on PRs that should be ignored by the stale bot so they are not flagged or closed. and removed stale labels Nov 4, 2024
@mosabua
Copy link
Member

mosabua commented Nov 4, 2024

Sorry for the automated closing @prrvchr - from what I can tell you are waiting for another review and/or merge. Maybe @ebyhr can clarify if other reviewers or other help is needed and potentially post on #core-dev in trino slack.

For now I added the stale-ignore label since we want to get this connector in.

@ebyhr ebyhr removed the stale-ignore Use this label on PRs that should be ignored by the stale bot so they are not flagged or closed. label Mar 21, 2025
Copy link

This pull request has gone a while without any activity. Ask for help on #core-dev on Trino slack.

@github-actions github-actions bot added the stale label Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

5 participants