<?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 dataframe column structtype metadata not getting saved to unitycatalog in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/dataframe-column-structtype-metadata-not-getting-saved-to/m-p/50460#M6080</link>
    <description>&lt;P&gt;I have the below schema&lt;/P&gt;&lt;P&gt;schema = StructType([&lt;BR /&gt;StructField(&lt;BR /&gt;name="Test",&lt;BR /&gt;dataType=StringType(),&lt;BR /&gt;nullable=False,&lt;BR /&gt;metadata={&lt;BR /&gt;"description": "This is to test metadata description."&lt;BR /&gt;}&lt;BR /&gt;)&lt;BR /&gt;])&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;data = [('Test1',), ('Test2',), ('Test3',)]
df = spark.createDataFrame(data, schema=schema)&lt;/LI-CODE&gt;&lt;P&gt;and I am writing to datalake&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;df.write.mode("overwrite").format("delta").saveAsTable(table_name)&lt;/LI-CODE&gt;&lt;P&gt;Now when I read the from the unity catalog table and try to access the metadata, I don't see it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from pyspark.sql import functions as F
df = spark.read.format("delta").table(table_name)
print(df.schema['Test'].metadata)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where is the metadata from that column stored? I have checked information_schema.columns as well and I don't see it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 04 Nov 2023 23:51:24 GMT</pubDate>
    <dc:creator>vk217</dc:creator>
    <dc:date>2023-11-04T23:51:24Z</dc:date>
    <item>
      <title>dataframe column structtype metadata not getting saved to unitycatalog</title>
      <link>https://community.databricks.com/t5/get-started-discussions/dataframe-column-structtype-metadata-not-getting-saved-to/m-p/50460#M6080</link>
      <description>&lt;P&gt;I have the below schema&lt;/P&gt;&lt;P&gt;schema = StructType([&lt;BR /&gt;StructField(&lt;BR /&gt;name="Test",&lt;BR /&gt;dataType=StringType(),&lt;BR /&gt;nullable=False,&lt;BR /&gt;metadata={&lt;BR /&gt;"description": "This is to test metadata description."&lt;BR /&gt;}&lt;BR /&gt;)&lt;BR /&gt;])&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;data = [('Test1',), ('Test2',), ('Test3',)]
df = spark.createDataFrame(data, schema=schema)&lt;/LI-CODE&gt;&lt;P&gt;and I am writing to datalake&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;df.write.mode("overwrite").format("delta").saveAsTable(table_name)&lt;/LI-CODE&gt;&lt;P&gt;Now when I read the from the unity catalog table and try to access the metadata, I don't see it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from pyspark.sql import functions as F
df = spark.read.format("delta").table(table_name)
print(df.schema['Test'].metadata)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where is the metadata from that column stored? I have checked information_schema.columns as well and I don't see it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Nov 2023 23:51:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/dataframe-column-structtype-metadata-not-getting-saved-to/m-p/50460#M6080</guid>
      <dc:creator>vk217</dc:creator>
      <dc:date>2023-11-04T23:51:24Z</dc:date>
    </item>
  </channel>
</rss>

