Skip to content

Instantly share code, notes, and snippets.

@aialenti
Last active September 13, 2020 14:50
Show Gist options
  • Save aialenti/2f180838a6e4933847e531c7be1d88ad to your computer and use it in GitHub Desktop.
Save aialenti/2f180838a6e4933847e531c7be1d88ad to your computer and use it in GitHub Desktop.
# Read the source tables in Parquet format
sales_table = spark.read.parquet("./data/sales_parquet")
'''
SELECT order_id,
product_id,
seller_id,
date,
num_pieces_sold AS pieces,
bill_raw_text
FROM sales_table a
'''
sales_table_execution_plan = sales_table. \
withColumnRenamed("num_pieces_sold", "pieces")
sales_table_execution_plan.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment