chaisql / chai

Modern embedded SQL database
MIT License
1.56k stars 95 forks source link

msgpack: invalid code=d9 decoding bytes length #456

Closed xqzhou closed 2 years ago

xqzhou commented 2 years ago

What version of Genji are you using?

$ genji version
latest master as of today. 
commit f8b184da75c85692c6b9ebd0c1d24c0d37fdb457 (origin/main, origin/HEAD, main)
Author: Asdine El Hrychy 
Date:   Mon May 16 20:31:46 2022 +0400

    Improve INSERT API

What did you do?

  1. create airbnb-listing table db.Exec("CREATE TABLE listing")
  2. insert data into airbnb-listing db.Exec("INSERT INTO listing VALUES ?", &listing)
  3. select average rating group by city select city, avg(review_scores_rating) as avg_rating from listing group by city order by avg_rating desc;

What did you expect to see?

average rating grouped by city

What did you see instead?

msgpack: invalid code=d9 decoding bytes length

Test data & Genji database attached

airbnb-listings-10.txt listing.db.zip

asdine commented 2 years ago

Thanks for the details issue and for the data! I'm currently rewriting the encoding layer so this should be fixed this week

asdine commented 2 years ago

We are no longer using msgpack, we switched to a custom encoding layer. I can confirm that the query works now:

select city, avg(review_scores_rating) as avg_rating from listing group by city order by avg_rating desc;
{
  "city": "Beijing",
  "avg_rating": 90
}