Apache Hop version?
2.19
Java version?
21
Operating system
Windows
What happened?
Hop correctly recognizes SQL Server's uniqueidentifier type in
BaseDatabaseMeta.customizeValueFromSqlType()
(core/src/main/java/org/apache/hop/core/database/BaseDatabaseMeta.java:1971) and changes the field
to Hop UUID metadata. DDL generation then loses the SQL Server dialect:
String def = "UUID";
if (iDatabase.isMsSqlServerNativeVariant()) {
def = "UNIQUEIDENTIFIER";
}
ValueMetaUuid therefore returns UNIQUEIDENTIFIER for the MSSQLNATIVE connection, but returns
UUID for the regular MSSQL connection. SQL Server has no UUID data type, so a
uniqueidentifier column read through the regular connection cannot be recreated with Hop's
generated DDL.
Only MsSqlServerNativeDatabaseMeta overrides isMsSqlServerNativeVariant() to return true
(MsSqlServerNativeDatabaseMeta.java:188); the jTDS-based MsSqlServerDatabaseMeta inherits
false from BaseDatabaseMeta:1683, so it takes the UUID branch.
Steps to reproduce
Create or clone UUID value metadata, call getDatabaseColumnType() with each SQL Server database
meta, and compare:
MSSQLNATIVE -> UNIQUEIDENTIFIER
MSSQL -> UUID
Expected: UNIQUEIDENTIFIER from both — they target the same engine.
Actual: the regular MSSQL connection generates DDL SQL Server rejects.
Suggested fix
Emit UNIQUEIDENTIFIER for every SQL Server database-meta variant, not only
isMsSqlServerNativeVariant(), and add a test for both connection types.
Issue Priority
Priority: 3
Issue Component
Component: Database
Apache Hop version?
2.19
Java version?
21
Operating system
Windows
What happened?
Hop correctly recognizes SQL Server's
uniqueidentifiertype inBaseDatabaseMeta.customizeValueFromSqlType()(
core/src/main/java/org/apache/hop/core/database/BaseDatabaseMeta.java:1971) and changes the fieldto Hop UUID metadata. DDL generation then loses the SQL Server dialect:
ValueMetaUuidtherefore returnsUNIQUEIDENTIFIERfor the MSSQLNATIVE connection, but returnsUUIDfor the regular MSSQL connection. SQL Server has noUUIDdata type, so auniqueidentifiercolumn read through the regular connection cannot be recreated with Hop'sgenerated DDL.
Only
MsSqlServerNativeDatabaseMetaoverridesisMsSqlServerNativeVariant()to returntrue(
MsSqlServerNativeDatabaseMeta.java:188); the jTDS-basedMsSqlServerDatabaseMetainheritsfalsefromBaseDatabaseMeta:1683, so it takes theUUIDbranch.Steps to reproduce
Create or clone UUID value metadata, call
getDatabaseColumnType()with each SQL Server databasemeta, and compare:
Expected:
UNIQUEIDENTIFIERfrom both — they target the same engine.Actual: the regular MSSQL connection generates DDL SQL Server rejects.
Suggested fix
Emit
UNIQUEIDENTIFIERfor every SQL Server database-meta variant, not onlyisMsSqlServerNativeVariant(), and add a test for both connection types.Issue Priority
Priority: 3
Issue Component
Component: Database