diff --git a/ibis/backends/sql/compilers/exasol.py b/ibis/backends/sql/compilers/exasol.py index 317c6e6b345a..21a9e1ce0d0c 100644 --- a/ibis/backends/sql/compilers/exasol.py +++ b/ibis/backends/sql/compilers/exasol.py @@ -189,9 +189,11 @@ def visit_CountStar(self, op, *, arg, where): return self.f.count(STAR) def visit_CountDistinctStar(self, op, *, arg, where): - raise com.UnsupportedOperationError( - "COUNT(DISTINCT *) is not supported in Exasol" - ) + cols = [sg.column(k, quoted=self.quoted) for k in op.arg.schema.keys()] + if where is not None: + cols = [self.if_(where, c, NULL) for c in cols] + row = sge.Tuple(expressions=cols) + return self.f.count(sge.Distinct(expressions=[row])) def visit_Median(self, op, *, arg, where): return self.visit_Quantile(op, arg=arg, quantile=sge.convert(0.5), where=where) diff --git a/ibis/backends/tests/test_aggregation.py b/ibis/backends/tests/test_aggregation.py index b3ab50b189e3..40e2a5ca2501 100644 --- a/ibis/backends/tests/test_aggregation.py +++ b/ibis/backends/tests/test_aggregation.py @@ -13,6 +13,7 @@ from ibis import literal as L from ibis.backends.tests.errors import ( ClickHouseDatabaseError, + ExaQueryError, GoogleBadRequest, ImpalaHiveServer2Error, MySQLNotSupportedError, @@ -790,7 +791,6 @@ def test_arbitrary(backend, alltypes, df, filtered): raises=com.OperationNotDefinedError, reason="no one has attempted implementation yet", ) -@pytest.mark.notimpl(["exasol"], raises=com.UnsupportedOperationError) def test_count_distinct_star(alltypes, df, ibis_cond, pandas_cond): table = alltypes[["int_col", "double_col", "string_col"]] expr = table.nunique(where=ibis_cond(table)) diff --git a/ibis/backends/tests/test_generic.py b/ibis/backends/tests/test_generic.py index bd61852109a9..73d1545bd8bf 100644 --- a/ibis/backends/tests/test_generic.py +++ b/ibis/backends/tests/test_generic.py @@ -782,10 +782,7 @@ def test_table_info_large(con): reason="quantile and mode is not supported", ) @pytest.mark.notimpl( - [ - "exasol", - "druid", - ], + ["druid"], raises=com.OperationNotDefinedError, reason="Mode and StandardDev is not supported", ) @@ -829,10 +826,10 @@ def test_table_info_large(con): pytest.mark.notimpl( [ "clickhouse", + "exasol", + "impala", "pyspark", - "clickhouse", "risingwave", - "impala", ], raises=com.OperationNotDefinedError, reason="mode is not supported", @@ -911,10 +908,10 @@ def test_table_info_large(con): pytest.mark.notimpl( [ "clickhouse", + "exasol", + "impala", "pyspark", - "clickhouse", "risingwave", - "impala", ], raises=com.OperationNotDefinedError, reason="mode is not supported", @@ -958,10 +955,7 @@ def test_table_describe(alltypes, selector, expected_columns): reason="quantile is not supported", ) @pytest.mark.notimpl( - [ - "exasol", - "druid", - ], + ["druid"], raises=com.OperationNotDefinedError, reason="StandardDev is not supported", )