diff --git a/ibis/backends/sql/compilers/exasol.py b/ibis/backends/sql/compilers/exasol.py index b56f9fad6c72..163ee96eca88 100644 --- a/ibis/backends/sql/compilers/exasol.py +++ b/ibis/backends/sql/compilers/exasol.py @@ -32,7 +32,6 @@ class ExasolCompiler(SQLGlotCompiler): UNSUPPORTED_OPS = ( ops.AnalyticVectorizedUDF, - ops.ApproxMedian, ops.ArgMax, ops.ArgMin, ops.ArrayDistinct, @@ -56,7 +55,6 @@ class ExasolCompiler(SQLGlotCompiler): ops.IsInf, ops.IsNan, ops.Levenshtein, - ops.Median, ops.MultiQuantile, ops.RandomUUID, ops.ReductionVectorizedUDF, @@ -187,6 +185,11 @@ def visit_CountDistinctStar(self, op, *, arg, where): "COUNT(DISTINCT *) is not supported in Exasol" ) + def visit_Median(self, op, *, arg, where): + return self.visit_Quantile(op, arg=arg, quantile=sge.convert(0.5), where=where) + + visit_ApproxMedian = visit_Median + def visit_Quantile(self, op, *, arg, quantile, where): suffix = "cont" if op.arg.dtype.is_numeric() else "disc" funcname = f"percentile_{suffix}" diff --git a/ibis/backends/tests/test_aggregation.py b/ibis/backends/tests/test_aggregation.py index 24f55f56177d..ff705f6c0796 100644 --- a/ibis/backends/tests/test_aggregation.py +++ b/ibis/backends/tests/test_aggregation.py @@ -1175,7 +1175,7 @@ def test_corr_cov( @pytest.mark.notimpl( - ["mysql", "sqlite", "mssql", "druid", "exasol"], + ["mysql", "sqlite", "mssql", "druid"], raises=com.OperationNotDefinedError, ) @pytest.mark.notyet(["flink"], raises=com.OperationNotDefinedError) @@ -1186,7 +1186,7 @@ def test_approx_median(alltypes): @pytest.mark.notimpl( - ["bigquery", "druid", "sqlite", "exasol"], raises=com.OperationNotDefinedError + ["bigquery", "druid", "sqlite"], raises=com.OperationNotDefinedError ) @pytest.mark.notyet( ["impala", "mysql", "mssql", "druid", "trino"],