Repository: tobymao/sqlglot

Issue:
DuckDB `array_length(..., 1)` fails to parse
```
In [4]: import sqlglot as sg

In [5]: sg.__version__
Out[5]: '10.1.0'

In [6]: sg.parse_one('select array_length([0], 1) as x', read='duckdb')
ParseError: The number of provided arguments (2) is greater than the maximum number of supported arguments (1). Line 1, Col: 27.
  select array_length([0], 1) as x
```

DuckDB allows the second argument (dimension) for compatibility with postgres:

```
❯ duckdb <<< "select array_length([0], 1) as x"
┌───────┐
│   x   │
│ int64 │
├───────┤
│     1 │
└───────┘
```

Discussion:

Patch:
diff --git a/sqlglot/expressions.py b/sqlglot/expressions.py
index da772032..ab35b1f7 100644
--- a/sqlglot/expressions.py
+++ b/sqlglot/expressions.py
@@ -2447,7 +2447,7 @@ class ArrayFilter(Func):
 
 
 class ArraySize(Func):
-    pass
+    arg_types = {"this": True, "expression": False}
 
 
 class ArraySort(Func):


Test patch:
diff --git a/tests/dialects/test_duckdb.py b/tests/dialects/test_duckdb.py
index 06787022..4d605506 100644
--- a/tests/dialects/test_duckdb.py
+++ b/tests/dialects/test_duckdb.py
@@ -105,6 +105,10 @@ class TestDuckDB(Validator):
                 "spark": "ARRAY(0, 1, 2)",
             },
         )
+        self.validate_all(
+            "SELECT ARRAY_LENGTH([0], 1) AS x",
+            write={"duckdb": "SELECT ARRAY_LENGTH(LIST_VALUE(0), 1) AS x"},
+        )
         self.validate_all(
             "REGEXP_MATCHES(x, y)",
             write={