LoginSignup
1

More than 5 years have passed since last update.

BigQueryの64bit unsigned int 対応

Last updated at Posted at 2017-01-18
select 
  integer(cast(9223372036854775807 as FLOAT) ),
  integer(cast(9223372036854775807 as string) )
;
  • 結果
    image

  • Stringで扱うことにした


  • おまけ:ソートするとき
    • stringそのままソートするとintegerのソート結果を期待できないぞ!
    • integerでもないぞ!signed int の最大値超えるとnullるから、結果がおかしくなるぞ!
    • 気をつけろ!
SELECT *, Float(string_column) as order_key 
FROM table
order by order_key desc
LIMIT 100

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1