Scalar Functions Support Status

Out of 357 scalar functions in Spark 3.5, Gluten currently fully supports 240 functions and partially supports 24 functions.

Array Functions

Spark FunctionsSpark ExpressionsStatusRestrictions
arrayCreateArrayS
array_appendArrayAppendS
array_compactArrayCompactS
array_containsArrayContainsS
array_distinctArrayDistinctS
array_exceptArrayExceptS
array_insertArrayInsertS
array_intersectArrayIntersectS
array_joinArrayJoinS
array_maxArrayMaxS
array_minArrayMinS
array_positionArrayPositionS
array_prependArrayPrependS
array_removeArrayRemoveS
array_repeatArrayRepeatS
array_unionArrayUnionS
arrays_overlapArraysOverlapS
arrays_zipArraysZipS
flattenFlattenS
getGetS
sequenceSequence
shuffleShuffleS
sliceSliceS
sort_arraySortArrayS

Bitwise Functions

Spark FunctionsSpark ExpressionsStatusRestrictions
&BitwiseAndS
^BitwiseXorS
bit_countBitwiseCountS
bit_getBitwiseGetS
getbitBitwiseGetS
shiftrightShiftRightS
shiftrightunsignedShiftRightUnsigned
|BitwiseOrS
~BitwiseNotS

Collection Functions

Spark FunctionsSpark ExpressionsStatusRestrictions
array_sizeArraySizeS
cardinalitySizeS
concatConcatS
reverseReverseS
sizeSizeS

Conditional Functions

Spark FunctionsSpark ExpressionsStatusRestrictions
coalesceCoalesceS
ifIfS
ifnullNvlS
nanvlNaNvlS
nullifNullIfS
nvlNvlS
nvl2Nvl2S
whenCaseWhenS

Conversion Functions

Spark FunctionsSpark ExpressionsStatusRestrictions
bigintS
binaryS
booleanS
castCastS
dateS
decimalS
doubleS
floatS
intS
smallintS
stringS
timestampS
tinyintS

Csv Functions

Spark FunctionsSpark ExpressionsStatusRestrictions
from_csvCsvToStructs
schema_of_csvSchemaOfCsv
to_csvStructsToCsv

Date and Timestamp Functions

Spark FunctionsSpark ExpressionsStatusRestrictions
add_monthsAddMonthsS
convert_timezoneConvertTimezone
curdateCurDateExpressionBuilder
current_dateCurrentDate
current_timestampCurrentTimestamp
current_timezoneCurrentTimeZone
date_addDateAddS
date_diffDateDiffS
date_formatDateFormatClassS
date_from_unix_dateDateFromUnixDateS
date_partDatePartExpressionBuilder
date_subDateSubS
date_truncTruncTimestampS
dateaddDateAddS
datediffDateDiffS
datepartDatePartExpressionBuilder
dayDayOfMonthS
dayofmonthDayOfMonthS
dayofweekDayOfWeekS
dayofyearDayOfYearS
extractExtractS
from_unixtimeFromUnixTimeS
from_utc_timestampFromUTCTimestampS
hourHourS
last_dayLastDayS
localtimestampLocalTimestamp
make_dateMakeDateS
make_dt_intervalMakeDTInterval
make_intervalMakeInterval
make_timestampMakeTimestampS
make_timestamp_ltzMakeTimestampLTZExpressionBuilder
make_timestamp_ntzMakeTimestampNTZExpressionBuilder
make_ym_intervalMakeYMIntervalS
minuteMinuteS
monthMonthS
months_betweenMonthsBetween
next_dayNextDayS
nowNow
quarterQuarterS
secondSecondS
session_windowSessionWindow
timestamp_microsMicrosToTimestampS
timestamp_millisMillisToTimestampS
timestamp_secondsSecondsToTimestampS
to_dateParseToDate
to_timestampParseToTimestamp
to_timestamp_ltzParseToTimestampLTZExpressionBuilder
to_timestamp_ntzParseToTimestampNTZExpressionBuilder
to_unix_timestampToUnixTimestampPS
to_utc_timestampToUTCTimestampS
truncTruncDateS
try_to_timestampTryToTimestampExpressionBuilder
unix_dateUnixDateS
unix_microsUnixMicrosS
unix_millisUnixMillisS
unix_secondsUnixSecondsS
unix_timestampUnixTimestampS
weekdayWeekDayS
weekofyearWeekOfYearS
windowTimeWindow
window_timeWindowTime
yearYearS

Hash Functions

Spark FunctionsSpark ExpressionsStatusRestrictions
crc32Crc32S
hashMurmur3HashS
md5Md5S
shaSha1S
sha1Sha1S
sha2Sha2S
xxhash64XxHash64S

JSON Functions

Spark FunctionsSpark ExpressionsStatusRestrictions
from_jsonJsonToStructsPSfrom_json with ‘spark.sql.caseSensitive = true’ is not supported in Velox
from_json with ‘spark.sql.json.enablePartialResults = false’ is not supported in Velox
from_json with column corrupt record is not supported in Velox
from_json with duplicate keys is not supported in Velox
from_json with options is not supported in Velox
get_json_objectGetJsonObjectS
json_array_lengthLengthOfJsonArrayS
json_object_keysJsonObjectKeysS
json_tupleJsonTupleS
schema_of_jsonSchemaOfJson
to_jsonStructsToJsonPSWhen ‘spark.sql.caseSensitive = false’, to_json produces unexpected result for struct field with uppercase name
to_json with options is not supported in Velox

Lambda Functions

Spark FunctionsSpark ExpressionsStatusRestrictions
aggregateArrayAggregateS
array_sortArraySortS
existsArrayExistsS
filterArrayFilterS
forallArrayForAllS
map_filterMapFilterS
map_zip_withMapZipWithS
reduceArrayAggregateS
transformArrayTransformS
transform_keysTransformKeysS
transform_valuesTransformValuesS
zip_withZipWithS

Map Functions

Spark FunctionsSpark ExpressionsStatusRestrictions
element_atElementAtS
mapCreateMapPS
map_concatMapConcatPS
map_contains_keyMapContainsKeyS
map_entriesMapEntriesS
map_from_arraysMapFromArrays
map_from_entriesMapFromEntries
map_keysMapKeysS
map_valuesMapValuesS
str_to_mapStringToMapPSOnly spark.sql.mapKeyDedupPolicy = EXCEPTION is supported for Velox backend
try_element_atTryElementAt

Mathematical Functions

Spark FunctionsSpark ExpressionsStatusRestrictions
%RemainderS
*MultiplyS
+AddS
-SubtractS
/DivideS
absAbsS
acosAcosS
acoshAcoshS
asinAsinS
asinhAsinhS
atanAtanS
atan2Atan2S
atanhAtanhS
binBinS
broundBRound
cbrtCbrtS
ceilCeilExpressionBuilderPS
ceilingCeilExpressionBuilderPS
convConvS
cosCosS
coshCoshS
cotCotS
cscCscS
degreesToDegreesS
divIntegralDivide
eEulerNumberS
expExpS
expm1Expm1S
factorialFactorialS
floorFloorExpressionBuilderPS
greatestGreatestS
hexHexS
hypotHypotS
leastLeastS
lnLog
logLogarithmS
log10Log10S
log1pLog1pS
log2Log2S
modRemainderS
negativeUnaryMinusS
piPiS
pmodPmodS
positiveUnaryPositiveS
powPowS
powerPowS
radiansToRadians
randRandS
randnRandn
randomRandS
rintRintS
roundRoundS
secSecS
shiftleftShiftLeftS
signSignumS
signumSignumS
sinSin
sinhSinhS
sqrtSqrtS
tanTan
tanhTanh
try_addTryAddPS
try_divideTryDivide
try_multiplyTryMultiply
try_subtractTrySubtract
unhexUnhexS
width_bucketWidthBucketS

Misc Functions

Spark FunctionsSpark ExpressionsStatusRestrictions
aes_decryptAesDecrypt
aes_encryptAesEncrypt
assert_trueAssertTrueS
bitmap_bit_positionBitmapBitPosition
bitmap_bucket_numberBitmapBucketNumber
bitmap_countBitmapCount
current_catalogCurrentCatalog
current_databaseCurrentDatabase
current_schemaCurrentDatabase
current_userCurrentUser
equal_nullEqualNullS
hll_sketch_estimateHllSketchEstimate
hll_unionHllUnion
input_file_block_lengthInputFileBlockLength
input_file_block_startInputFileBlockStart
input_file_nameInputFileName
java_methodCallMethodViaReflection
monotonically_increasing_idMonotonicallyIncreasingID
reflectCallMethodViaReflection
spark_partition_idSparkPartitionIDS
try_aes_decryptTryAesDecrypt
typeofTypeOf
userCurrentUser
uuidUuidS
versionSparkVersionS
||S

Predicate Functions

Spark FunctionsSpark ExpressionsStatusRestrictions
!NotS
!=S
<LessThanS
<=LessThanOrEqualS
<=>EqualNullSafeS
<>S
=EqualToS
==EqualToS
>GreaterThanS
>=GreaterThanOrEqualS
andAndS
betweenS
caseS
ilikeILikeS
inInPS
isnanIsNaNS
isnotnullIsNotNullS
isnullIsNullS
likeLikeS
notNotS
orOrS
regexpRLikePSLookaround unsupported
regexp_likeRLikePSLookaround unsupported
rlikeRLikePSLookaround unsupported

String Functions

Spark FunctionsSpark ExpressionsStatusRestrictions
asciiAsciiS
base64Base64PSbase64 with chunkBase64String disabled is not supported
bit_lengthBitLengthS
btrimStringTrimBothS
charChrS
char_lengthLengthS
character_lengthLengthS
chrChrS
concat_wsConcatWsS
containsContainsExpressionBuilderPSBinaryType unsupported
decodeDecode
eltElt
encodeEncode
endswithEndsWithExpressionBuilderPSBinaryType unsupported
find_in_setFindInSetS
format_numberFormatNumber
format_stringFormatString
initcapInitCapS
instrStringInstrS
lcaseLowerS
leftLeftS
lenLengthS
lengthLengthS
levenshteinLevenshteinS
locateStringLocateS
lowerLowerS
lpadLPadExpressionBuilderPSBinaryType unsupported
ltrimStringTrimLeftS
luhn_checkLuhncheckS
maskMaskExpressionBuilderS
octet_lengthOctetLength
overlayOverlayS
positionStringLocateS
printfFormatString
regexp_countRegExpCount
regexp_extractRegExpExtractPSLookaround unsupported
regexp_extract_allRegExpExtractAllPSLookaround unsupported
regexp_instrRegExpInStr
regexp_replaceRegExpReplacePSLookaround unsupported
regexp_substrRegExpSubStr
repeatStringRepeatS
replaceStringReplaceS
rightRightS
rpadRPadExpressionBuilderPSBinaryType unsupported
rtrimStringTrimRightS
sentencesSentences
soundexSoundExS
spaceStringSpace
splitStringSplitS
split_partSplitPartS
startswithStartsWithExpressionBuilderPSBinaryType unsupported
substrSubstringPS
substringSubstringPS
substring_indexSubstringIndexS
to_binaryToBinary
to_charToCharacter
to_numberToNumber
to_varcharToCharacter
translateStringTranslateS
trimStringTrimS
try_to_binaryTryToBinary
try_to_numberTryToNumber
ucaseUpperS
unbase64UnBase64PSunbase64 with failOnError is not supported
upperUpperS

Struct Functions

Spark FunctionsSpark ExpressionsStatusRestrictions
named_structCreateNamedStructS
structS

URL Functions

Spark FunctionsSpark ExpressionsStatusRestrictions
parse_urlParseUrl
url_decodeUrlDecodeS
url_encodeUrlEncodeS

XML Functions

Spark FunctionsSpark ExpressionsStatusRestrictions
xpathXPathList
xpath_booleanXPathBoolean
xpath_doubleXPathDouble
xpath_floatXPathFloat
xpath_intXPathInt
xpath_longXPathLong
xpath_numberXPathDouble
xpath_shortXPathShort
xpath_stringXPathString