Skip to content

Instantly share code, notes, and snippets.

View wesleyegberto's full-sized avatar
🎯
Exploring

Wesley Egberto wesleyegberto

🎯
Exploring
View GitHub Profile
@rponte
rponte / using-uuid-as-pk.md
Last active May 25, 2024 13:59
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...

TL;TD

Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes

from pyspark.sql.functions import col, explode_outer, from_json, lit, concat
from pyspark.sql.types import StructType, ArrayType
def get_json_df(input_df, primary_partition_column, json_column_name, spark_session):
'''
Description:
This function provides the schema of json records and the dataframe to be used for flattening
:param input_df: [type: pyspark.sql.dataframe.DataFrame] input dataframe