SUB_BITMAP

Learn how to use the SUB_BITMAP bitmap function in PlaidCloud Lakehouse. Generates a sub-bitmap of the source bitmap, beginning from the start index, with a...

Generates a sub-bitmap of the source bitmap, beginning from the start index, with a specified size.

Analyze Syntax

func.sub_bitmap( <bitmap>, <start>, <size> )

Analyze Examples

func.sub_bitmap(func.build_bitmap([1, 2, 3, 4, 5]), 1, 3)

┌───────────────────────────────────────────────────────────┐
 func.sub_bitmap(func.build_bitmap([1, 2, 3, 4, 5]), 1, 3) 
├───────────────────────────────────────────────────────────┤
 2,3,4                                                     
└───────────────────────────────────────────────────────────┘

SQL Syntax

SUB_BITMAP( <bitmap>, <start>, <size> )

SQL Examples

SELECT SUB_BITMAP(BUILD_BITMAP([1, 2, 3, 4, 5]), 1, 3)::String;

┌─────────────────────────────────────────────────────────┐
 sub_bitmap(build_bitmap([1, 2, 3, 4, 5]), 1, 3)::string 
├─────────────────────────────────────────────────────────┤
 2,3,4                                                   
└─────────────────────────────────────────────────────────┘