-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Note: This issue is identical to DAT-648 from the older DataStax OSS JIRA. Moving to Github Issues in an attempt to consolidate all work here.
Description from the original ticket follows. This issue was originally reported by Steve Lacerda.
We have an issue where the customer has data like this:
The properties_frozen field is null. But, when it’s unloaded via dsbulk, it turns into {}:
tenant_name,driver_id,creation_time,description,properties,properties_frozen,state,tenant_id,update_time
ota-cst-lab,1,2023-04-05T22:01:20.473Z,SMPP Channel 1 to sms-router-0,"{"sms.channel.command.retry.number":"1","sms.channel.command.retry.period":"50","sms.channel.destination.host":"sms-router-0.sms-router","sms.channel.destination.port":"8181","sms.channel.login.name":"otacs","sms.channel.login.password":"otacs","sms.channel.protocol":"SMPP","sms.channel.stack.size":"5000","sms.channel.timeout.delay":"2000","sms.channel.window.size":"30"}",{},ENABLED,NULL,2023-04-05T22:01:20.473Z
I’ve tried unloading with several different params:
--codec.nullStrings "NULL, NIL" --schema.nullToUnset false --schema.allowMissingFields true
Everything I tried still pushed {} into the frozen field, instead of null.
The load is fine if the value is null, it’s just the unload.
I asked if we could just modify the csv file, but that’s not an option because they need to load hundreds of tables.
Here’s the schema for the table:
tenant_name ascii,
id ascii,
app_structure_changed boolean,
app_structure_delta ascii,
creation_date timestamp,
eid ascii,
file_structure_changed boolean,
files_delta ascii,
gp_state ascii,
org_groups frozen<set>,
other_ids map<ascii, ascii>,
other_ids_frozen frozen<map<ascii, ascii>>,
previous_state ascii,
profile_name ascii,
properties map<ascii, ascii>,
properties_frozen frozen<map<ascii, ascii>>,
subscription_state ascii,
subscription_state_change_date timestamp,
tenant_id ascii,
update_date timestamp,
PRIMARY KEY ((tenant_name, id))
Additional follow-up from Steve:
CQLSH COPY TO seems to work and preserves the null instead of forcing {}.