<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Bug with display function with structs? in Machine Learning</title>
    <link>https://community.databricks.com/t5/machine-learning/bug-with-display-function-with-structs/m-p/2941#M55</link>
    <description>&lt;P&gt;It appears to me that there's a deceptive bug when using the databricks display function and viewing struct data. For whatever reason, multiple spaces are cut down to only one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;from pyspark.sql.functions import struct, col
&amp;nbsp;
df = spark.createDataFrame([
  ("this has two  spaces", "this has three   spaces"),
  ("this has one space", "this has nospace")
], ["sc", "osc"])
&amp;nbsp;
df = df.select(struct(df.columns).alias("scstruct"))
&amp;nbsp;
display( df )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You'll see in the result that the values with 2, 3, and 4 spaces are cut down to single spaces. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I came across this while attempting to diagnose a regex -&amp;gt; due to this bug, I wasn't aware of what the data values &lt;I&gt;actually&lt;/I&gt; were.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Jun 2023 15:50:07 GMT</pubDate>
    <dc:creator>VVM</dc:creator>
    <dc:date>2023-06-16T15:50:07Z</dc:date>
    <item>
      <title>Bug with display function with structs?</title>
      <link>https://community.databricks.com/t5/machine-learning/bug-with-display-function-with-structs/m-p/2941#M55</link>
      <description>&lt;P&gt;It appears to me that there's a deceptive bug when using the databricks display function and viewing struct data. For whatever reason, multiple spaces are cut down to only one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;from pyspark.sql.functions import struct, col
&amp;nbsp;
df = spark.createDataFrame([
  ("this has two  spaces", "this has three   spaces"),
  ("this has one space", "this has nospace")
], ["sc", "osc"])
&amp;nbsp;
df = df.select(struct(df.columns).alias("scstruct"))
&amp;nbsp;
display( df )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You'll see in the result that the values with 2, 3, and 4 spaces are cut down to single spaces. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I came across this while attempting to diagnose a regex -&amp;gt; due to this bug, I wasn't aware of what the data values &lt;I&gt;actually&lt;/I&gt; were.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2023 15:50:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/bug-with-display-function-with-structs/m-p/2941#M55</guid>
      <dc:creator>VVM</dc:creator>
      <dc:date>2023-06-16T15:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with display function with structs?</title>
      <link>https://community.databricks.com/t5/machine-learning/bug-with-display-function-with-structs/m-p/2942#M56</link>
      <description>&lt;P&gt;Hi @Patrick Mascari​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Great to meet you, and thanks for your question! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's see if your peers in the community have an answer to your question. Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jun 2023 09:27:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/bug-with-display-function-with-structs/m-p/2942#M56</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-06-17T09:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with display function with structs?</title>
      <link>https://community.databricks.com/t5/machine-learning/bug-with-display-function-with-structs/m-p/2943#M57</link>
      <description>&lt;P&gt;not so sure the community can help here as this appears to be a verifiable and reproducible Databricks bug?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2023 11:13:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/bug-with-display-function-with-structs/m-p/2943#M57</guid>
      <dc:creator>VVM</dc:creator>
      <dc:date>2023-06-19T11:13:18Z</dc:date>
    </item>
  </channel>
</rss>

