sap-commerce-db-sync icon indicating copy to clipboard operation
sap-commerce-db-sync copied to clipboard

Allow for spaces in column names from source system

Open jamiebartlett-kps opened this issue 1 year ago • 5 comments
trafficstars

Had to include a few methods from the Apache DDL library and tweak them a bit.

jamiebartlett-kps avatar Mar 06 '24 09:03 jamiebartlett-kps

CLA assistant check
All committers have signed the CLA.

cla-assistant[bot] avatar Mar 06 '24 09:03 cla-assistant[bot]

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.

jamiebartlett-kps avatar Mar 21 '24 08:03 jamiebartlett-kps

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

lnowakowski avatar Mar 21 '24 09:03 lnowakowski

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.

jamiebartlett-kps avatar Mar 21 '24 09:03 jamiebartlett-kps

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

lnowakowski avatar Mar 21 '24 09:03 lnowakowski