<?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 What are the best practices to store VectorsUDT in the databricks Feature Store? in Warehousing &amp; Analytics</title>
    <link>https://community.databricks.com/t5/warehousing-analytics/what-are-the-best-practices-to-store-vectorsudt-in-the/m-p/24263#M619</link>
    <description>&lt;P&gt;What are the best practices to store VectorsUDT in the databricks Feature Store?&lt;/P&gt;&lt;P&gt;Hello, I am having issues to save a table that has 2 columns containing VectorUDT data. I saw that the Feature Store of databricks cannot handle this data type but can handle arrays. So, I tried to convert the 2 columns into arrays.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I tried to cast these columns as 'array&amp;lt;double&amp;gt;' using &lt;B&gt;.cast('array&amp;lt;double&amp;gt;')&lt;/B&gt;&amp;nbsp;or with the function&amp;nbsp;&lt;B&gt;vector_to_array&lt;/B&gt;&amp;nbsp;from&amp;nbsp;pyspark.ml.functions,&amp;nbsp;I systematically got the same following error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;SparkException: Failed to execute user defined function(functions$$$Lambda$9020/747195126: (array&amp;lt;struct&amp;lt;type:tinyint,size:int,indices:array&amp;lt;int&amp;gt;,values:array&amp;lt;double&amp;gt;&amp;gt;&amp;gt;) =&amp;gt; array&amp;lt;double&amp;gt;)&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;Caused by: IllegalArgumentException: function vector_to_array requires a non-null input argument and input type must be `org.apache.spark.ml.linalg.Vector` or `org.apache.spark.mllib.linalg.Vector`, but got scala.collection.mutable.WrappedArray$ofRef.&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* What can I do to fix this error and convert my VectorUDT to arrays?&lt;/P&gt;&lt;P&gt;* Or, are there better practices to store VectorUDT in the databricks Feature Store?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;</description>
    <pubDate>Wed, 30 Mar 2022 16:14:19 GMT</pubDate>
    <dc:creator>145625</dc:creator>
    <dc:date>2022-03-30T16:14:19Z</dc:date>
    <item>
      <title>What are the best practices to store VectorsUDT in the databricks Feature Store?</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/what-are-the-best-practices-to-store-vectorsudt-in-the/m-p/24263#M619</link>
      <description>&lt;P&gt;What are the best practices to store VectorsUDT in the databricks Feature Store?&lt;/P&gt;&lt;P&gt;Hello, I am having issues to save a table that has 2 columns containing VectorUDT data. I saw that the Feature Store of databricks cannot handle this data type but can handle arrays. So, I tried to convert the 2 columns into arrays.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I tried to cast these columns as 'array&amp;lt;double&amp;gt;' using &lt;B&gt;.cast('array&amp;lt;double&amp;gt;')&lt;/B&gt;&amp;nbsp;or with the function&amp;nbsp;&lt;B&gt;vector_to_array&lt;/B&gt;&amp;nbsp;from&amp;nbsp;pyspark.ml.functions,&amp;nbsp;I systematically got the same following error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;SparkException: Failed to execute user defined function(functions$$$Lambda$9020/747195126: (array&amp;lt;struct&amp;lt;type:tinyint,size:int,indices:array&amp;lt;int&amp;gt;,values:array&amp;lt;double&amp;gt;&amp;gt;&amp;gt;) =&amp;gt; array&amp;lt;double&amp;gt;)&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;Caused by: IllegalArgumentException: function vector_to_array requires a non-null input argument and input type must be `org.apache.spark.ml.linalg.Vector` or `org.apache.spark.mllib.linalg.Vector`, but got scala.collection.mutable.WrappedArray$ofRef.&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* What can I do to fix this error and convert my VectorUDT to arrays?&lt;/P&gt;&lt;P&gt;* Or, are there better practices to store VectorUDT in the databricks Feature Store?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2022 16:14:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/what-are-the-best-practices-to-store-vectorsudt-in-the/m-p/24263#M619</guid>
      <dc:creator>145625</dc:creator>
      <dc:date>2022-03-30T16:14:19Z</dc:date>
    </item>
  </channel>
</rss>

