Apache Drill - Querying Complex Data



In this chapter, we will discuss in detail about which all composite data types does Apache Drill supports.

  • Array − An array is a repeated list of values. A value in an array can be a scalar type, such as string or int, or an array can be a complex type, such as a map or another array.

  • Map − A map is a set of name/value pairs. A value in a map can be a scalar type, such as string or int, or a complex type, such as an array or another map.

Apache Drill uses map and array data types internally for reading complex and nested data structures from data sources.

Sr.No Function & Description
1

FLATTEN

FLATTEN separates the elements in a repeated field into individual records.

2

KVGEN

This function returns a list of the keys that exist in the map.

3

REPEATED_COUNT

This function counts the values in an array.

4

REPEATED CONTAINS

Searches for a keyword in an array. If the keyword is present in an array, the result will be true otherwise false.

Advertisements