Here is a sample code. If you notice the SystemModstamp & LastModifiedDate column values are converted into bigint from timestamp type. How can we preserve the original data type in the returned result?
from salesforce_bulk import SalesforceBulk
bulk = SalesforceBulk(username=“xxxxxx@xxxx.com", password=“xxxxxxxxx”, security_token=“xxxxxxxxxxxxxxxxxxxxxx”)
# Create a new job
job = bulk.create_query_job("Contact", contentType='JSON')
# Add one or more batches to the job
batch = bulk.query(job, "select Id,LastName, LastModifiedDate, SystemModstamp from Contact where SystemModstamp < LAST_N_DAYS:20")
# Close the job
bulk.close_job(job)
# Wait for each batch to finish
while not bulk.is_batch_done(batch):
time.sleep(10)
results = []
for result in bulk.get_all_results_for_query_batch(batch):
results.append(json.load(IteratorBytesIO(result)))
for row in results:
print(row)
Here is a sample code. If you notice the SystemModstamp & LastModifiedDate column values are converted into bigint from timestamp type. How can we preserve the original data type in the returned result?
Sample Output: