mikeizbicki / cmc-csci143

big data course materials
40 stars 76 forks source link

diff result that reflect no diff #445

Closed giffiecode closed 7 months ago

giffiecode commented 7 months ago
Yuechen.Pei.23@lambda-server:~/pagila-hw$ diff results/10.out expected/10.out 
277d276
<  GUNFIGHT MOON               |     388 |           4
278a278
>  GUNFIGHT MOON               |     388 |           4
407d406
<  FIRE WOLVES                 |     316 |           5
409a409
>  FIRE WOLVES                 |     316 |           5
1001d1000
< 

I received the above when running the diff command on my query below. I don't spot any difference from the output. What's the difference based on this diff output?

SELECT f.title, f.film_id, COUNT(fa.actor_id) AS actor_count
FROM film f
JOIN film_actor fa ON f.film_id = fa.film_id
GROUP BY f.film_id
ORDER BY actor_count, film_id, title;
mikeizbicki commented 7 months ago

This looks like a sorting issue to me. If you run diff -u instead of just diff, you'll get a more-human-readable output that should be easier to understand.