Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Routines to get meta data of the data frame without opening the whole data #45

Closed
wei-wu-nyc opened this issue Apr 3, 2017 · 3 comments

Comments

@wei-wu-nyc
Copy link

I don't know if this is requested. It would be helpful to provide functions that gives back some basic info about the data frame in the save fst file without opening the whole file. For example:

  1. Number of columns and rows. So that the users can determine whether to open the whole file or read part of the file.
  2. May be give the name of the columns and the data type of each columns.

Thanks.

@MarcusKlik
Copy link
Collaborator

Hi @wei-wu-nyc , thanks for your request. The latest CRAN release of the fst package actually has a method fst.metadata which shows some basic information about a fst file in tibble-style (such as names and types). Future releases will show more information, for example the key columns and dimensions of the stored table. Hope this helps!

@wei-wu-nyc
Copy link
Author

Thanks @MarcusKlik, this actually is enough for my current need. Did not see the fst.metadata call.

@MarcusKlik
Copy link
Collaborator

Using method fst.metadata from the develop branch of fst:

x = data.table(X = 1:10, B = LETTERS[1:10], key = "X")
write.fst(x, "1.fst")
fst.metadata("1.fst")

will now give you output like:

<fst file>
10 rows, 2 columns (1.fst)

* 'X': integer (key 1)
* 'B': character

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants