scylladb / video-streaming

Video streaming sample app with NextJs + ScyllaDB
https://video-streaming.scylladb.com
20 stars 4 forks source link

The ScyllaDB Cloud do not officially support experimental Features #9

Open gauravsinghaec opened 3 weeks ago

gauravsinghaec commented 3 weeks ago

The migration is failing. and looks like the Scylla cloud doesn't support the experimental feature

image

Do we have a way to set the flag with cloud, OR you can update the documentation for the workaround.

gauravsinghaec commented 3 weeks ago

Actually you don't need a UDF. It was done forcefully in this example. Basically the CQL query is also misleading. SELECT id, top10(created_at) AS date FROM recent_videos_view; this is bad as you are UDF on every row and basically you have same set to date(which is array of top created_at).

Anyway as the example has only 9 rows. This UDF is not needed.

Below 3 things I did to fix the start issue.

  1. Change the ENV var for app base URL APP_BASE_URL="http://localhost:3000"
  2. Remove UDFs from video-streaming/migrate/schema.cql Delete all the lines after USE streaming; The the npm run migrate will run successfully
  3. Update queryVideoDates and rawVideos values as below in file video-streaming/src/pages/api/list-videos.ts. Now npm run dev will work fine const queryVideoDates = "SELECT id, created_at AS date FROM recent_videos_view;" const rawVideos = await cluster.execute(query, [videoDates.rows.map((row) => row?.date)], { prepare: true })

TADA your app is running now image