safonov
New Contributor II

Looks like it ugly hits some limit of nested messages in protobuf.

Because this script generates a flat plan (as opposed to my example in the previous message) and works fine:

col_num = 1000
data = [tuple([f'val_{n}' for n in range(1, col_num + 1)])]
df = spark.createDataFrame(data=data)
collumns_renaming = []
for i in range(1, len(data[0]) + 1):
    collumns_renaming.append(
        f.col(f'_{i}').alias(f'col_{i}')
    )
df = df.select(*collumns_renaming)
df.printSchema()


But databricks-connect could handle it somehow or prevent segfaults, I suppose. And documented limitations would be nice.