kyuubi/externals
Reese Feng a54ee39ab3 [KYUUBI #6984] Fix ValueError when rendering MapType data
[
[KYUUBI #6984] Fix ValueError when rendering MapType data
](https://github.com/apache/kyuubi/issues/6984)

### Why are the changes needed?
The issue was caused by an incorrect iteration of MapType data in the `%table` magic command. When iterating over a `MapType` column, the code used `for k, v in m` directly, which leads to a `ValueError` because raw `Map` entries may not be properly unpacked

### How was this patch tested?
- [x] Manual testing:
  Executed a query with a `MapType` column and confirmed that the `%table` command now renders it without errors.
```python
 from pyspark.sql import SparkSession
 from pyspark.sql.types import MapType, StringType, IntegerType
 spark = SparkSession.builder \
     .appName("MapFieldExample") \
     .getOrCreate()

 data = [
     (1, {"a": "1", "b": "2"}),
     (2, {"x": "10"}),
     (3, {"key": "value"})
 ]

 schema = "id INT, map_col MAP<STRING, STRING>"
 df = spark.createDataFrame(data, schema=schema)
 df.printSchema()
 df2=df.collect()
```
using `%table` render table
```python
 %table df2
```

result
```python
{'application/vnd.livy.table.v1+json': {'headers': [{'name': 'id', 'type': 'INT_TYPE'}, {'name': 'map_col', 'type': 'MAP_TYPE'}], 'data': [[1, {'a': '1', 'b': '2'}], [2, {'x': '10'}], [3, {'key': 'value'}]]}}

```

### Was this patch authored or co-authored using generative AI tooling?
No

**notice** This PR was co-authored by DeepSeek-R1.

Closes #6985 from JustFeng/patch-1.

Closes #6984

e0911ba94 [Reese Feng] Update PySparkTests for magic cmd
bc3ce1a49 [Reese Feng] Update PySparkTests for magic cmd
200d7ad9b [Reese Feng] Fix syntax error in dict iteration in magic_table_convert_map

Authored-by: Reese Feng <10377945+JustFeng@users.noreply.github.com>
Signed-off-by: Wang, Fei <fwang12@ebay.com>
2025-03-19 21:18:35 -07:00
..
kyuubi-chat-engine [KYUUBI #6843] [FOLLOWUP] Fix 'query-timeout-thread' thread leak 2025-01-10 10:30:00 +08:00
kyuubi-download [KYUUBI #6769] [RELEASE] Bump 1.11.0-SNAPSHOT 2024-10-23 17:10:56 +08:00
kyuubi-flink-sql-engine [KYUUBI #6843] Fix 'query-timeout-thread' thread leak 2024-12-27 18:02:16 +08:00
kyuubi-hive-sql-engine [KYUUBI #6859] Exclude log4j12 from hive engine module classpath 2024-12-25 17:18:58 +08:00
kyuubi-jdbc-engine [KYUUBI #6915] Fix ClickHouse integration tests 2025-02-14 10:23:20 +08:00
kyuubi-spark-sql-engine [KYUUBI #6984] Fix ValueError when rendering MapType data 2025-03-19 21:18:35 -07:00
kyuubi-trino-engine [KYUUBI #6843] Fix 'query-timeout-thread' thread leak 2024-12-27 18:02:16 +08:00