<?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>question Re: (SPARK-12823) Cannot create UDF with StructType input - in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/SPARK-12823-Cannot-create-UDF-with-StructType-input/m-p/127948#M34680</link>
    <description>&lt;P&gt;Hi All,  I further researched this issue and found an alternative solution.  if you define the function as follows&lt;/P&gt;&lt;P&gt;   val parsePatientfun = udf { (thestruct: Row)  =&amp;gt;
     thestruct.getAs[String]("City") }&lt;/P&gt;&lt;P&gt;you can get to the fields from StuctureType.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jul 2016 07:09:43 GMT</pubDate>
    <dc:creator>ram_pratapa</dc:creator>
    <dc:date>2016-07-18T07:09:43Z</dc:date>
    <item>
      <title>(SPARK-12823) Cannot create UDF with StructType input -</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/SPARK-12823-Cannot-create-UDF-with-StructType-input/m-p/127947#M34679</link>
      <description>&lt;P&gt;Hi,  I am trying create a UDF and use it in dataframe select something like&lt;/P&gt;&lt;P&gt;val selected = jsonRxMap.select(&lt;STRONG&gt;parsePatient&lt;/STRONG&gt;($"Patient") ,&lt;STRONG&gt;parseProvider&lt;/STRONG&gt;($"Provider"),&lt;STRONG&gt;parsePharmacy&lt;/STRONG&gt;($"Pharmacy"))&lt;/P&gt;&lt;P&gt;$"Patient" is StuctureType  and I searched google find this SPARK-12823 and I am not sure is there any work around to solve the problem.   The goal is that by passing the StructuredType ( struct&amp;lt;FirstName:string,Address1:string,Address2:string,AltID:string,Beeper:string,..) to &lt;STRONG&gt;parsePatient &lt;/STRONG&gt;function which returns a unique value to that patient and I can store the patient in a dimention table in hive with ORC format.&lt;/P&gt;&lt;P&gt;Can any one help.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2016 06:52:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/SPARK-12823-Cannot-create-UDF-with-StructType-input/m-p/127947#M34679</guid>
      <dc:creator>ram_pratapa</dc:creator>
      <dc:date>2016-07-14T06:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: (SPARK-12823) Cannot create UDF with StructType input -</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/SPARK-12823-Cannot-create-UDF-with-StructType-input/m-p/127948#M34680</link>
      <description>&lt;P&gt;Hi All,  I further researched this issue and found an alternative solution.  if you define the function as follows&lt;/P&gt;&lt;P&gt;   val parsePatientfun = udf { (thestruct: Row)  =&amp;gt;
     thestruct.getAs[String]("City") }&lt;/P&gt;&lt;P&gt;you can get to the fields from StuctureType.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2016 07:09:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/SPARK-12823-Cannot-create-UDF-with-StructType-input/m-p/127948#M34680</guid>
      <dc:creator>ram_pratapa</dc:creator>
      <dc:date>2016-07-18T07:09:43Z</dc:date>
    </item>
  </channel>
</rss>

