From 2f85a420c665240c75f91f146ac209c5ce8213fc Mon Sep 17 00:00:00 2001 From: Jiting Xu <126802425+jitingxu1@users.noreply.github.com> Date: Thu, 7 Mar 2024 14:37:49 -0800 Subject: [PATCH] feat(datafusion, flink, mssql): add uuid operation (#8545) Continued from [PR](https://github.com/ibis-project/ibis/pull/8438): add uuid operation for mssql, flink, datafusion, --- ibis/backends/datafusion/compiler.py | 1 + ibis/backends/flink/compiler.py | 1 + ibis/backends/mssql/compiler.py | 1 + ibis/backends/tests/test_uuid.py | 7 +------ 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ibis/backends/datafusion/compiler.py b/ibis/backends/datafusion/compiler.py index e29b8e9dbe56..64c4de25e85d 100644 --- a/ibis/backends/datafusion/compiler.py +++ b/ibis/backends/datafusion/compiler.py @@ -82,6 +82,7 @@ class DataFusionCompiler(SQLGlotCompiler): ops.Last: "last_value", ops.Median: "median", ops.StringLength: "character_length", + ops.RandomUUID: "uuid", ops.RegexSplit: "regex_split", } diff --git a/ibis/backends/flink/compiler.py b/ibis/backends/flink/compiler.py index 5bed84e647c8..38392812a934 100644 --- a/ibis/backends/flink/compiler.py +++ b/ibis/backends/flink/compiler.py @@ -80,6 +80,7 @@ class FlinkCompiler(SQLGlotCompiler): ops.MapValues: "map_values", ops.Power: "power", ops.RandomScalar: "rand", + ops.RandomUUID: "uuid", ops.RegexSearch: "regexp", ops.StrRight: "right", ops.StringLength: "char_length", diff --git a/ibis/backends/mssql/compiler.py b/ibis/backends/mssql/compiler.py index dd53736a4d23..bd97c198d00e 100644 --- a/ibis/backends/mssql/compiler.py +++ b/ibis/backends/mssql/compiler.py @@ -133,6 +133,7 @@ class MSSQLCompiler(SQLGlotCompiler): ops.Log10: "log10", ops.Power: "power", ops.RandomScalar: "rand", + ops.RandomUUID: "newid", ops.Repeat: "replicate", ops.Reverse: "reverse", ops.StringAscii: "ascii", diff --git a/ibis/backends/tests/test_uuid.py b/ibis/backends/tests/test_uuid.py index e9b33496ca45..6caf06ab1dde 100644 --- a/ibis/backends/tests/test_uuid.py +++ b/ibis/backends/tests/test_uuid.py @@ -19,6 +19,7 @@ "exasol": "UUID", "flink": "CHAR(36) NOT NULL", "impala": "STRING", + "mssql": "uniqueidentifier", "postgres": "uuid", "risingwave": "character varying", "snowflake": "VARCHAR", @@ -42,11 +43,8 @@ def test_uuid_literal(con, backend): @pytest.mark.notimpl( [ - "datafusion", "druid", "exasol", - "flink", - "mssql", "mysql", "oracle", "polars", @@ -64,11 +62,8 @@ def test_uuid_function(con): @pytest.mark.notimpl( [ - "datafusion", "druid", "exasol", - "flink", - "mssql", "mysql", "oracle", "polars",