Skip to content

Commit

Permalink
trino: Support FROM_HEX
Browse files Browse the repository at this point in the history
  • Loading branch information
emk committed Feb 16, 2024
1 parent a088739 commit 4a6a273
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ EXP = Fn(FLOAT64) -> FLOAT64;
FARM_FINGERPRINT = Fn(STRING) -> INT64 | Fn(BYTES) -> INT64;
FIRST_VALUE = FnOver<?T>(Agg<?T>) -> ?T;
FORMAT_DATETIME = Fn(DATETIME, STRING) -> STRING;
FROM_HEX = Fn(STRING) -> BYTES;
GENERATE_DATE_ARRAY = Fn(DATE, DATE, INTERVAL) -> ARRAY<DATE>;
GENERATE_UUID = Fn() -> STRING;
GREATEST = Fn<?T>(?T, ..?T) -> ?T;
Expand Down
15 changes: 15 additions & 0 deletions tests/sql/functions/simple/to_hex_from_hex.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- TO_HEX(FROM_HEX(x)) = x

CREATE OR REPLACE TABLE __result1 AS
SELECT
to_hex(from_hex('8f4343a7')) AS hex_arg,
to_hex(from_hex(null)) AS null_arg;

CREATE OR REPLACE TABLE __expected1 (
hex_arg STRING,
null_arg STRING,
);

INSERT INTO __expected1 VALUES
('8f4343a7', NULL);

0 comments on commit 4a6a273

Please sign in to comment.