Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public enum ScalarFunction {
UPPER(Category.STRING, SqlKind.OTHER_FUNCTION),
LOWER(Category.STRING, SqlKind.OTHER_FUNCTION),
TRIM(Category.STRING, SqlKind.TRIM),
SUBSTR(Category.STRING, SqlKind.OTHER_FUNCTION),
SUBSTRING(Category.STRING, SqlKind.OTHER_FUNCTION),
/**
* String concatenation. Calcite's {@code SqlStdOperatorTable.CONCAT} is a
Expand All @@ -66,9 +67,23 @@ public enum ScalarFunction {
* rename surfaces as a compile error rather than as a silent string mismatch at runtime.
*/
CONCAT(Category.STRING, SqlKind.OTHER_FUNCTION, SqlStdOperatorTable.CONCAT),
CONCAT_WS(Category.STRING, SqlKind.OTHER_FUNCTION),
CHAR_LENGTH(Category.STRING, SqlKind.OTHER_FUNCTION),
REPLACE(Category.STRING, SqlKind.OTHER_FUNCTION),
REGEXP_REPLACE(Category.STRING, SqlKind.OTHER_FUNCTION),
ASCII(Category.STRING, SqlKind.OTHER_FUNCTION),
LEFT(Category.STRING, SqlKind.OTHER_FUNCTION),
LENGTH(Category.STRING, SqlKind.OTHER_FUNCTION),
LOCATE(Category.STRING, SqlKind.OTHER_FUNCTION),
POSITION(Category.STRING, SqlKind.POSITION),
LTRIM(Category.STRING, SqlKind.OTHER_FUNCTION),
RTRIM(Category.STRING, SqlKind.OTHER_FUNCTION),
REVERSE(Category.STRING, SqlKind.OTHER_FUNCTION),
RIGHT(Category.STRING, SqlKind.OTHER_FUNCTION),
TOSTRING(Category.STRING, SqlKind.OTHER_FUNCTION),
NUMBER_TO_STRING(Category.STRING, SqlKind.OTHER_FUNCTION), // Alias for TOSTRING
TONUMBER(Category.STRING, SqlKind.OTHER_FUNCTION),
STRCMP(Category.STRING, SqlKind.OTHER_FUNCTION),

// ── Math ─────────────────────────────────────────────────────────
PLUS(Category.MATH, SqlKind.PLUS),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ pub async unsafe fn create_session_context(
.build();

let ctx = SessionContext::new_with_state(state);
crate::udf::register_all(&ctx);

// Register default ListingTable for parquet scans
let listing_options = ListingOptions::new(Arc::new(ParquetFormat::new()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,14 @@ pub(crate) fn coerce_args(
}

pub mod convert_tz;
pub mod tonumber;
pub mod tostring;

pub fn register_all(ctx: &SessionContext) {
convert_tz::register_all(ctx);
log::info!("OpenSearch UDF register_all: convert_tz registered");
tonumber::register_all(ctx);
tostring::register_all(ctx);
log::info!("OpenSearch UDF register_all: convert_tz, tonumber, tostring registered");
}

#[cfg(test)]
Expand Down
Loading
Loading