skip to main content
Supported SQL Functionality : SQL Expressions : Functions
  

Try DataDirect Drivers Now

Functions

The following tables show how SQL-92 functions are supported in Apache Spark SQL.
Table 24. Set Functions Supported
Set Function
Support in Spark SQL
Count
Supported
AVG
Supported
MIN
Supported
MAX
Supported
SUM
Supported
DISTINCT
Supported
ALL
Supported
Table 25. Numeric Functions Supported
Numeric Function
Support in Spark SQL
CHAR_LENGTH CHARACTER_LENGTH
Not supported. Use LENGTH(string) instead.
Position...In
Not supported
BIT_LENGTH(s)
Not supported
OCTET_LENGTH(str)
Not supported
EXTRACT...FROM
Not supported
Table 26. String Functions Supported
String Function
Support in Spark SQL
Substring
Supported
Convert … using
Not supported
TRIM
Supported.
Leading
Not supported. Use LTRIM.
Trailing
Not supported. Use RTRIM.
Both
Not supported (default behavior of TRIM)
Table 27. Date/Time Functions Supported
Date/Time Function
Support in Spark SQL
CURRENT_DATE( )
Not supported1
CURRENT_TIME( )
Not supported2
CURRENT_TIMESTAMP
Not supported. Use UNIX_TIMESTAMP()3.

1 Supported by JDBC Escapes. See SQL Escape Sequences for JDBC for details.

2 Supported by JDBC Escapes. See SQL Escape Sequences for JDBC for details.

3 Supported by JDBC Escapes. See SQL Escape Sequences for JDBC for details.

Table 28. System Functions Supported
System Function
Support in Spark SQL
CASE ... END
Supported.
COALESCE
Supported.
NULLIF
Not supported.1
CAST
Supported.

1 Supported by JDBC Escapes