sap-commerce-db-sync
sap-commerce-db-sync copied to clipboard
Allow for spaces in column names from source system
Had to include a few methods from the Apache DDL library and tweak them a bit.
Hi @lnowakowski
Thanks for your comments. In the PR, the only change is actually only the below snippet:
query.append(" FROM ");
if (this.getPlatform().isDelimitedIdentifierModeOn()) {
query.append(this.getPlatformInfo().getDelimiterToken());
}
query.append(table.getName());
if (this.getPlatform().isDelimitedIdentifierModeOn()) {
query.append(this.getPlatformInfo().getDelimiterToken());
}
To add the delimiter tokens around the outside of the table name after the FROM in the query. The rest of the changes were necessary as the method which required changing was protected inside the Apache DDLUtils Library.
Thanks for response @jamiebartlett-kps , can you elaborate a bit more, how common in your case is that SAP Commerce type system attribute has space char in its name? IMO it's not verry often, nor maybe it's not even following general recommendations or naming conventions for DB columns
Agreed that it's uncommon in the source system, but if you're replicating into a target system which isn't empty and also holds tables from other sources, it's possible. This is our use case and we've resolved the issue using this change.
Agreed that it's uncommon in the source system, but if you're replicating into a target system which isn't empty and also holds tables from other sources, it's possible. This is our use case and we've resolved the issue using this change.
Understood, however if you're not migrating data to such table, I'd recommend to exclude it, if exclusions feature is not handling this, during either schema analysis or migration process, it's a different story that should be handled as a bug