You are viewing documentation about an older version (1.12.1). View latest version

snowflake.snowpark.functions.monotonically_increasing_id

snowflake.snowpark.functions.monotonically_increasing_id(sign: int = 0) Column[source]

Returns a sequence of monotonically increasing integers, with wrap-around which happens after largest representable integer of integer width 8 byte.

Parameters:

sign – When 0, the sequence continues at 0 after wrap-around. When 1, the sequence continues at smallest representable 8 byte integer. Defaults to 0.

See also

  • Session.generator(), which can be used to generate in tandem with seq8 to

    generate sequences.

Example::
>>> df = session.generator(seq8(0), rowcount=3)
>>> df.collect()
[Row(SEQ8(0)=0), Row(SEQ8(0)=1), Row(SEQ8(0)=2)]
Copy