The Gandiva Expression Compiler#
Gandiva is a runtime expression compiler that usesLLVM to generateefficient native code for compute on Arrow record batches.Gandiva only handles projections and filters; for other transformations, seeCompute Functions.
Gandiva was designed to take advantage of the Arrow memory format and modernhardware. From the Arrow memory model, since Arrow arrays have separate buffers for values andvalidity bitmaps, values and their null status can often be processedindependently, allowing for better instruction pipelining. On modern hardware,compiling expressions using LLVM allows the execution to be optimizedto the local runtime environment and hardware, including available SIMDinstructions. To reduce optimization overhead, many Gandiva functions arepre-compiled into LLVM IR (intermediate representation).
Expression, Projector and Filter#
To effectively utilize Gandiva, you will construct expression trees withTreeExprBuilder,including the creation of function nodes, if-else logic, and boolean expressions.Subsequently, leverageProjector orFilter execution kernels to efficiently evaluate these expressions.SeeGandiva Expression, Projector, and Filter for more details.
External Functions Development#
Gandiva offers the capability of integrating external functions, encompassingboth C functions and IR functions. This feature broadens the spectrum offunctions that can be applied within Gandiva expressions. For developerslooking to customize and enhance their computational solutions,Gandiva provides the opportunity to develop and register their own externalfunctions, thus allowing for a more tailored and flexible use of the Gandivaenvironment.SeeGandiva External Functions Development Guide for more details.

