spotfiresoftware / spotfire-python

Package for Building Python Extensions to Spotfire®
Other
18 stars 6 forks source link

append mode to sbdf export #45

Open lwlwlwlw opened 1 year ago

lwlwlwlw commented 1 year ago

Feature requests: Would it be possible to add append mode to sbdf export (append data to an existing sbdf file)? Thank you.

bbassett-tibco commented 1 year ago

Hi @lwlwlwlw! Can you be more specific (perhaps with an example of what API you are expecting) about what kind of appending you are looking for? Are you looking for appending rows, appending columns, or some other concept of appending?

I'll also comment that the process of appending is complicated by the inherent structure of SBDF files. They are laid out as a sequence of table slices (consisting of a number of rows) that contain a sequence of column slices (consisting of all the values in one column in the rows covered by the containing table slice). To append a row involves rewriting (and growing) all the column slices in the last table slice; appending a column will have to rewrite all table slices (and would probably require rebalancing rows between slices since there is target number of values (rows x columns) in each table slice for performance reasons).

In general, it's probably easier to import the data from the file, make any modifications to the data that are desired, and then exporting.

lwlwlwlw commented 1 year ago

@bbassett-tibco Thank you for your reply.

One of our customers wants to append data (rows) to existing sbdf file because the data is incremental.

Preferable something like this, ("append=True" option to indicate appending)

import spotfire.sbdf as sb df=data.frame(...) sb.export_data(df,"d:/tmp/file.sbdf", append=True)