qari faizi writes

imam qarafi maliki mentions the narration “ali asws is the greatest jugde amongst you” in his book “al ahkam fi tameez ul fatawa an al ahkam wa tasrafat ul qadi wa al imam”, page 46; and sheikh abdul fatah abu ghada has done taleeq on this book; so he writes in its explanation

“holy prophet asws sent ali asws in youth to yemen as judge, and gave him the good news that allah will guide him; and keep him on true path/haq; holy prophet asws taught him judgement; so him being “aqdi ul ummat” is not surprising;; (then abu ghada mentioned the narration being discussed from sunan abi daood and then wrote); it should suffice for you that holy prophet asws taught judgement to a person; prayed for strength and steadfastness of his tongue and heart; give testminoty of him being the best judge; no doubt abu hasan asws was so famous in judgement that his name beceome a gold standerd for solution of most difficult of cases, to the extent that it was then said in cases where it was difficult to find the basic issue that

قضية و لا ابا الحسن لها

it is difficult but not for abu ul hasan asws

and abu ul hasan meant hazrat ali asws

and he was حلال المشكلات /hallal ul mushkilat (the one who solves problems); such problem which none could solve and and that is why umar seek protection from that problem where hazrat ali asws was not there for solution; and he said:

if ali asws was not there, umar would have died;

and he said: ali is the great judge;

and ibn masood said: we use to say that ali is the great judge of madina;;

and abdullah bin abbas said: by god! ali asws has got 90 % of knowledge and is also a partner in the rest 10 %;

and ayesha said that he is more aware of sunnah than others.

(taliqaat abu ghada: al ahkam lil qarafi; page 46-47)

[khasais-e-ali, translation, sharah, takhreej by qari faizi; page 216-217, printed by maktaba baab ul ilm; 1430; Lahore]