title: Save datetime into Parquet in Spark
body: <p>I want to create Parquet file with data of unknown format at compilation time. I'm getting schema as a text later on and I know that some columns contain date with time. I want to do this using Spark and Java. So I followed <a href="http://spark.apache.org/docs/1.2.1/sql-programming-guide.html#programmatically-specifying-the-schema">http://spark.apache.org/docs/1.2.1/sql-programming-guide.html#programmatically-specifying-the-schema</a> and created schema with proper types. I tried to use Spark's <code>DataType.TimestampType</code> and <code>DataType.DateType</code> for date like columns. But neither of them is working. When I try to save the file with <code>JavaSchemaRDD.saveAsParquetFile</code> I'm getting the error <code>Unsupported datatype</code>+ the type that I tried for date. I tried this with <code>emptyRDD</code> so there isn't any trouble with data conversion.</p>
  
  <p>After looking into: <a href="http://parquet.incubator.apache.org/documentation/latest/">http://parquet.incubator.apache.org/documentation/latest/</a> and  <a href="https://github.com/Parquet/parquet-format/blob/master/LogicalTypes.md">https://github.com/Parquet/parquet-format/blob/master/LogicalTypes.md</a> I think that I need to convert the data into some integer/long type and inform about the fact that they represent Date. If so, how can I do this in Spark? Or maybe I need to do something else?</p>