title: how to introduce the schema in a Row in Spark?
body: <p>In the Row Java API there is a row.schema(), however there is not a row.set(StructType schema). </p>
  
  <p>Also I tried to RowFactorie.create(objets), but I don't know how to proceed</p>
  
  <p>UPDATE:</p>
  
  <p>The problems is how to generate a new dataframe when I modify the structure in workers I put the example</p>
  
  <pre><code>DataFrame sentenceData = jsql.createDataFrame(jrdd, schema);
  List&lt;Row&gt; resultRows2 = sentenceData.toJavaRDD()
              .map(new MyFunction&lt;Row, Row&gt;(parameters) {
              /** my map function **// 
  
                  public Row call(Row row) {
  
                   // I want to change Row definition adding new columns
                      Row newRow = functionAddnewNewColumns (row);
                      StructType newSchema = functionGetNewSchema (row.schema);
  
                      // Here I want to insert the structure 
  
                      //
                      return newRow
                      }
  
                  }
  
          }).collect();
  
  
  JavaRDD&lt;Row&gt; jrdd = jsc.parallelize(resultRows);
  
  // Here is the problema  I don't know how to get the new schema to create the   new modified dataframe
  
  DataFrame newDataframe = jsql.createDataFrame(jrdd, newSchema);
  </code></pre>