1
0
Fork 0

Adding upstream version 7.1.3.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 14:46:14 +01:00
parent 291e0c125c
commit 768d386bf5
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
42 changed files with 1430 additions and 253 deletions

View file

@ -1,7 +1,6 @@
from sqlglot import exp
from sqlglot.dialects.dialect import Dialect
from sqlglot.generator import Generator
from sqlglot.helper import list_get
from sqlglot.parser import Parser
@ -16,7 +15,7 @@ def _coalesce_sql(self, expression):
def _count_sql(self, expression):
this = expression.this
if isinstance(this, exp.Distinct):
return f"COUNTD({self.sql(this, 'this')})"
return f"COUNTD({self.expressions(this, flat=True)})"
return f"COUNT({self.sql(expression, 'this')})"
@ -33,5 +32,5 @@ class Tableau(Dialect):
FUNCTIONS = {
**Parser.FUNCTIONS,
"IFNULL": exp.Coalesce.from_arg_list,
"COUNTD": lambda args: exp.Count(this=exp.Distinct(this=list_get(args, 0))),
"COUNTD": lambda args: exp.Count(this=exp.Distinct(expressions=args)),
}