hezean / sustc

Template for project 2 of SUSTech Principles of Database Systems (CS307 / CS213), 23 fall semester.
http://172.18.34.154
MIT License
22 stars 9 forks source link

Can't get "Likedby" in DanmuRecord #87

Closed spl234 closed 8 months ago

spl234 commented 8 months ago

When I try to import data into "like Danmu" table, I need to use the "Likedby" attribute in "DanmuRecord". But while using "getLikedby()" method, It always give back a null value. What may cause this?

sses7757 commented 8 months ago

@sketchplane23 Can you provide more information including error messages and your related codes?

spl234 commented 8 months ago

图片 for example,when I try to get and print "likedby",there is a null

sses7757 commented 8 months ago

@sketchplane23 What is this danmu? Can you System.out.println(danmu) and show the result? Since there is no null likeBy in the given data. Besides, have you confirmed the correctness of your downloaded .ser data file? Is this problem reproduceable in other computers?

yzh0811 commented 8 months ago

Yes,this problem also happened in my computer,if we use System.out.println(danmu),it will print "DanmuRecord{likedBy=null}",we have determined that our .ser data file is the same with the sa in this morning.

sses7757 commented 8 months ago

@yzh0811 @sketchplane23 Although I cannot reproduce the bug, some SA also noticed that the printed objects may be null in asynchronous operations. However, they can execute their codes and successfully import data. You can check the database to see whether the import process is successful.

yzh0811 commented 8 months ago

You mean we need to import the likeby no matter whether it is null or not?Because it may succeed?

hezean commented 8 months ago

you may try replacing all cases.xxx.parallelStream().forEach to cases.xxx.forEach in BenchmarkService (remove the parallel stream) to overcome the log-null issue for better bugging.