suketa / ruby-duckdb

Ruby binding for DuckDB

Home Page:https://github.com/suketa/ruby-duckdb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

implement DuckDB::Result#_to_hugeint_internal

suketa opened this issue · comments

implement DuckDB::Result#_to_hugeint_internal using DuckDB::Result#__to_hugeint_internal

DuckDB::Result#__to_hugeint_internal(col, row) #=> [lower, upper]
DuckDB::Result#_to_hugeint_internal(col, row) #=> Integer value calculated from lower and upper.

The formula is:

value = upper * 2^64 + lower

( https://github.com/duckdb/duckdb/blob/6e671f398d9953b3ec508b06be0414770e569b01/src/include/duckdb.h#L170-L172 )