Created
October 1, 2022 22:45
-
-
Save cesar1091/33c414a80c5224f2469774a24486f7d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
customer = spark.read.format("parquet").load("/user/vagrant/lab1/pregunta2/customer") | |
customer.createOrReplaceTempView("customer") | |
val result = spark.sql("select customer_id, concat(substring(customer_fname,1,3),' ', customer_lname) as name, customer_street from customer") | |
result.rdd.map(lambda x: "\t".join(map(str,x))).saveAsTextFile("/user/vagrant/lab1/pregunta6/resultado","org.apache.hadoop.io.compress.BZip2Codec") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment