Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query Discrepancy in Postgres HLL Test #158

Open
developerayuva opened this issue Apr 28, 2024 · 0 comments
Open

Query Discrepancy in Postgres HLL Test #158

developerayuva opened this issue Apr 28, 2024 · 0 comments

Comments

@developerayuva
Copy link

I have encountered an unexpected behavior while executing query from cumulative_add_sparse_edge.sql regress test.
The given test run from data file cumulative_add_sparse_edge.csv.
Since every rows hll value is calculated by using previous hll value and current raw value, I tried to run them manually and getting unexpected results. I used second last hll value to generate last row's hll values as given below

select hll_add('\x148B481002108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002',hll_hashval(2561));

hll_add
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
\x138b48000200410061008100a100c100e10101012101410161018101a101c101e10201022102410261028102a102c102e10301032103410361038103a103c103e10401042104410461048104a104c104e10501052105410561058105a105c105e10601062106410661068106a106c106e10701072107410761078107a107c107e10801082108410861088108a108c108e10901092109410961098109a109c109e10a010a210a410a610a810aa10ac10ae10b010b210b410b610b810ba10bc10be10c010c210c410c610c810ca10cc10ce10d010d210d410d610d810da10dc10de10e010e210e410e610e810ea10ec10ee10f010f210f410f610f810fa10fc10fe11001102110411061108110a110c110e11101112111411161118111a111c111e11201122112411261128112a112c112e11301132113411361138113a113c113e11401142114411461148114a114c114e11501152115411561158115a115c115e11601162116411661168116a116c116e11701172117411761178117a117c117e11801182118411861188118a118c118e11901192119411961198119a119c119e11a011a211a411a611a811aa11ac11ae11b011b211b411b611b811ba11bc11be11c011c211c411c611c811ca11cc11ce11d011d211d411d611d811da11dc11de11e011e211e411e611e811ea11ec11ee11f011f211f411f611f811fa11fc11fe12001202120412061208120a120c120e12101212121412161218121a121c121e12201222122412261228122a122c122e12301232123412361238123a123c123e12401242124412461248124a124c124e12501252125412561258125a125c125e12601262126412661268126a126c126e12701272127412761278127a127c127e12801282128412861288128a128c128e12901292129412961298129a129c129e12a012a212a412a612a812aa12ac12ae12b012b212b412b612b812ba12bc12be12c012c212c412c612c812ca12cc12ce12d012d212d412d612d812da12dc12de12e012e212e412e612e812ea12ec12ee12f012f212f412f612f812fa12fc12fe13001302130413061308130a130c130e13101312131413161318131a131c131e13201322132413261328132a132c132e13301332133413361338133a133c133e13401342134413461348134a134c134e13501352135413561358135a135c135e13601362136413661368136a136c136e13701372137413761378137a137c137e13801382138413861388138a138c138e13901392139413961398139a139c139e13a013a213a413a613a813aa13ac13ae13b013b213b413b613b813ba13bc13be13c013c213c413c613c813ca13cc13ce13d013d213d413d613d813da13dc13de13e013e213e413e613e813ea13ec13ee13f013f213f413f613f813fa13fc13fe14001ffe2

But according to the cumulative_add_sparse_edge.csv file the generated value must be

 \x148B481002108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084210842108421084000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002

I am using postgres version

postgres=> select version();
                                                   version                                                   
-------------------------------------------------------------------------------------------------------------
 PostgreSQL 16.1 on aarch64-unknown-linux-gnu, compiled by aarch64-unknown-linux-gnu-gcc (GCC) 9.5.0, 64-bit

Can someone help me out here? Is this an issue or some precision error, and if not an issue then how to get correct values which is present in .csv file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant