Skip to content

Commit c552895

Browse files
committed
[fix](regression) Declare the Python timezone UDTF string output
### What problem does this PR solve? Related PR: apache#68381 The timezone regression declares ARRAY<STRUCT<value:STRING>> but compares its lateral-view output directly to a string. Declare ARRAY<STRING> to match the single string yielded per row and allow the comparison to reach execution. Preserve coverage for fixed-offset timezones, microseconds, pre-epoch values and NULLs. ### Release note None ### Check List (For Author) - Test: Groovy syntax and embedded Python scalar, UDTF and UDAF value checks; SQL analysis verification. - Behavior changed: No (test-only correction). - Does this need documentation: No.
1 parent c070334 commit c552895

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎regression-test/suites/pythonudf_p0/test_python_arrow_convertor_timezone.groovy‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ suite("test_python_arrow_convertor_timezone") {
3737
def evaluate(value):
3838
return None if value is None else value.strftime('%Y-%m-%d %H:%M:%S.%f')
3939
\$\$"""
40+
// Declare the yielded string as the array element; ARRAY<STRUCT<...>> emits a struct.
4041
sql """CREATE TABLES FUNCTION ${tableFunction}(DATETIME(6))
41-
RETURNS ARRAY<STRUCT<value:STRING>>
42+
RETURNS ARRAY<STRING>
4243
PROPERTIES("type"="PYTHON_UDF", "symbol"="evaluate",
4344
"runtime_version"="${runtimeVersion}") AS \$\$
4445
def evaluate(value):

0 commit comments

Comments
 (0)