<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Converting incoming CDX files to Parquet
Quick look at file sizes
Step1:  Note
Step2:  Load in the unzipped file, filetering out any line that starts with a blank or has essentially no content.
Step3:  Prep a dataframe from the RDD, naming columns appropriately.
Step4:  Write out as Parquet.
<ASSISTANT_TASK:>
Python Code:
!ls -lh eot2012_surt_index.cdx*
Explanation: Converting incoming CDX files to Parquet
Quick look at file sizes:
End of explanation
!gunzip eot2012_surt_index.cdx.gz
Explanation: Note: Spark can typically load *.gz files just fine, but that support comes from Hive integration, which seems to be missing here.  So gunzip first.
End of explanation
eot2012 = sc.textFile("eot2012_surt_index.cdx") \
  .filter(lambda line: line[0] != ' ') \
  .filter(lambda line: len(line)>1) \
  .map(lambda line: line.split(" ")) \
Explanation: Load in the unzipped file, filetering out any line that starts with a blank or has essentially no content.
End of explanation
df = sqlContext.createDataFrame(eot2012)
df = df.withColumnRenamed("_1", "surt_uri") \
    .withColumnRenamed("_2", "capture_time") \
    .withColumnRenamed("_3", "original_uri") \
    .withColumnRenamed("_4", "mime_type") \
    .withColumnRenamed("_5", "response_code") \
    .withColumnRenamed("_6", "hash_sha1") \
    .withColumnRenamed("_7", "redirect_url") \
    .withColumnRenamed("_8", "meta_tags") \
    .withColumnRenamed("_9", "length_compressed") \
    .withColumnRenamed("_10", "warc_offset") \
    .withColumnRenamed("_11", "warc_name") \
Explanation: Prep a dataframe from the RDD, naming columns appropriately.
End of explanation
df.write.parquet("eot2012.parquet")
!du -hs eot2012.parquet
Explanation: Write out as Parquet.
End of explanation
<END_TASK>