3

I'm using the Stack Exchange Data Dump and am trying to have posts along with the creators of the posts. I would like to put text like "created on [date] by [user]". In most cases, the fields OwnerDisplayName and LastEditorDisplayName are null.

Is this intentional? If so, why is the name only available in some cases?

Also, the readme that shows which fields are available is missing OwnerDisplayName. I found it from the post Database schema documentation for the public data dump and SEDE.

4
  • Can you give an example for one of the posts you're interested in which still has the post and user available on the network? If it's not longer available on the network or the user account is no longer available, that may have something to do with it.
    – Mast
    Oct 28 at 3:34
  • I don't think that's the reason. For example in cseducators.meta.stackexchange.com, out of 457 posts in the most recent dump, only 18 have OwnerDisplayName, and of those, 14 are by the same user. A newer post I found with the author still listed does not have either of the name attributes.
    – busterroni
    Oct 28 at 4:27
  • 1
    Don't use those fields, use the actual fields (OwnerUserId and LastEditorUserId) and join with Users to read their names. Any other way won't be reliable. Oct 28 at 6:50
  • @ShadowTheKidWizard thanks!
    – busterroni
    Oct 28 at 8:30

1 Answer 1

4

OwnerDisplayName and LastEditorDisplayName are de-normalized. They may not reliably contain data. If they do, it may not be updated when the name changes. It is advised to not rely on it.

5
  • 1
    Got it, thank you. Do you know why it's available in some cases? Also, I want to attribute authors for their posts. Is it recommended I reference OwnerUserId with Users?
    – busterroni
    Oct 28 at 4:32
  • 1
    @busterroni owerdisplayname gets set when a user deletes their profile. So you'll find either a OwnerUserId pointing to a record in the Users table or a non-null value in OwnerDisplayName. See also: meta.stackexchange.com/questions/90411/…. There might be cases (I think of SE staff anonymizing posts) where both fields end-up empty.
    – rene
    Oct 28 at 6:26
  • @rene got it, thanks. I think the readme should be updated to include the missing field anyway.
    – busterroni
    Oct 28 at 6:47
  • 1
    @busterroni given that keeping the readme up-to-date is a hassle, you better refer to the Database schema documentation for the public data dump and SEDE
    – rene
    Oct 28 at 6:52
  • 2
    @rene that's what I'm now referring to, but it would be good if someone updated the readme, or linked to that post from it
    – busterroni
    Oct 28 at 6:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .