Skip to content
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

HazelcastMSSQLDialect missing support for IDENTITY and NVARCHAR types #26336

Open
mgoldver opened this issue May 21, 2024 · 2 comments
Open

HazelcastMSSQLDialect missing support for IDENTITY and NVARCHAR types #26336

mgoldver opened this issue May 21, 2024 · 2 comments

Comments

@mgoldver
Copy link

When trying to use GenericMapStore pointing to MsSql DB table with IDENTITY column as a primary key, getting an exception stating "Unsupported column type 'int identity'".
The similar exception is thrown when table contains a column of type "NVARCHAR".

The only workaround that I was able to implement is to overwrite com.hazelcast.jet.sql.impl.connector.jdbc.mssql.HazelcastMSSQLDialect
resolveType method with the following:

    @Override
    public QueryDataType resolveType(String columnTypeName, int precision, int scale)
    {
        return switch (columnTypeName.toUpperCase(Locale.ROOT))
        {
            case "FLOAT" -> QueryDataType.DOUBLE;
            case "DATETIME2", "SMALLDATETIME" -> QueryDataType.TIMESTAMP;
            case "INT IDENTITY" -> QueryDataType.INT;
            case "NVARCHAR" -> QueryDataType.VARCHAR;
            default -> DefaultTypeResolver.resolveType(columnTypeName, precision, scale);
        };
    }
@jgardiner68
Copy link

Hi Michael,

I have added this to our internal tracking JIRA as SUP-431

James

@mgoldver
Copy link
Author

mgoldver commented May 21, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants