title: Data type mismatch while transforming data in spark dataset
body: <p>I created a parquet-structure from a csv file using spark:</p>
  
  <pre><code>Dataset&lt;Row&gt; df = park.read().format("com.databricks.spark.csv").option("inferSchema", "true")
              .option("header", "true").load("sample.csv");
  df.write().parquet("sample.parquet");
  </code></pre>
  
  <p>I'm reading the parquet-structure and I'm trying to transform the data in a dataset:</p>
  
  <pre><code>Dataset&lt;org.apache.spark.sql.Row&gt; df = spark.read().parquet("sample.parquet");
  df.createOrReplaceTempView("tmpview");
  Dataset&lt;Row&gt; namesDF = spark.sql("SELECT *, md5(station_id) as hashkey FROM tmpview");
  </code></pre>
  
  <p>Unfortunately I get a data type mismatch error. Do I have to explicitly assign data types?</p>
  
  <blockquote>
    <p>17/04/12 09:21:52 INFO SparkSqlParser: Parsing command: SELECT *,
    md5(station_id) as hashkey FROM tmpview Exception in thread "main"
    org.apache.spark.sql.AnalysisException: cannot resolve
    'md5(tmpview.<code>station_id</code>)' due to data type mismatch: <strong>argument 1
    requires binary type, however, 'tmpview.<code>station_id</code>' is of int type.;</strong>
    line 1 pos 10; 'Project [station_id#0, bikes_available#1,
    docks_available#2, time#3, md5(station_id#0) AS hashkey#16]
    +- SubqueryAlias tmpview, <code>tmpview</code>    +- Relation[station_id#0,bikes_available#1,docks_available#2,time#3]
    parquet</p>
  </blockquote>