DuckDB Spark API is incompatible with the PySpark API's `spark.createDataFrame(list of dict)`
- Lenguaje dominante
- Python
- Estrellas
- 187
- Forks
- 112
- Merge medio
- 13 h 29 min
- PR fusionados (30 d)
- 17
Descripción
### What happens?
The DuckDB Spark API is incompatible with the PySpark API's `spark.createDataFrame(list of dict)` method.
### To Reproduce
```python
from duckdb.experimental.spark.sql import SparkSession as DuckdbSparkSession
from pyspark.sql import SparkSession
sql_text = "SELECT * FROM t0"
data = [
{"c0": "1969-12-21"}
]
spark = SparkSession.builder.getOrCreate()
df = spark.createDataFrame(data)
df.createOrReplaceTempView("t0")
print("PySpark SQL result:")
pyspark_result = spark.sql(sql_text)
pyspark_result.show()
duckdb_spark = DuckdbSparkSession.builder.getOrCreate()
df = duckdb_spark.createDataFrame(data)
df.createOrReplaceTempView("t0")
print("Duckdb Spark SQL result: ")
duckdb_spark_result = duckdb_spark.sql(sql_text)
duckdb_spark_result.show()
```
```bash
PySpark SQL result:
+----------+
| c0|
+----------+
|1969-12-21|
+----------+
Duckdb Spark SQL result:
┌─────────┐
│ col0 │
│ varchar │
├─────────┤
│ c0 │
└─────────┘
```
### OS:
x86_64 Ubuntu 24.04 Linux-6.14.0-35-generic-x86_64-with-glibc2.39
### DuckDB Version:
1.4.2
### DuckDB Client:
Python
### Hardware:
_No response_
### Full Name:
asddfl
### Affiliation:
xxx
### Did you include all relevant configuration (e.g., CPU architecture, Linux distribution) to reproduce the issue?
- [x] Yes, I have
### Did you include all code required to reproduce the issue?
- [x] Yes, I have
### Did you include all relevant data sets for reproducing the issue?
Yes
Guía de contribución
Línea de trabajo
Comienza en duckdb.experimental.spark.sql.SparkSession.createDataFrame y ejecuta la reproducción de Python proporcionada con la DuckDB Spark API y PySpark. Compara la salida resultante de la vista temporal y considera completado el issue cuando DuckDB produzca el mismo nombre de columna y valor de fila que PySpark para una lista de diccionarios.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- data
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100