Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add mergeSchema option #1452

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import sys

from awsglue import DynamicFrame
from awsglue.context import GlueContext
from awsglue.job import Job
from awsglue.transforms import *
from awsglue.utils import getResolvedOptions
from pyspark.context import SparkContext
from awsglue.context import GlueContext
from awsglue.job import Job
from awsglue import DynamicFrame
from scripts.helpers.helpers import get_glue_env_var, get_latest_partitions, PARTITION_KEYS

from scripts.helpers.helpers import (
PARTITION_KEYS,
get_glue_env_var,
get_latest_partitions,
)


def sparkSqlQuery(glueContext, query, mapping, transformation_ctx) -> DynamicFrame:
for alias, frame in mapping.items():
Expand Down Expand Up @@ -42,6 +49,7 @@ def sparkSqlQuery(glueContext, query, mapping, transformation_ctx) -> DynamicFra
database="dataplatform-" + environment + "-liberator-raw-zone",
table_name="liberator_permit_vrm_update",
transformation_ctx="AmazonS3_node1658998021932",
additional_options={"mergeSchema": "true"},
)

# Script generated for node SQL
Expand Down Expand Up @@ -306,7 +314,9 @@ def sparkSqlQuery(glueContext, query, mapping, transformation_ctx) -> DynamicFra

# Script generated for node Amazon S3
AmazonS3_node1658765590649 = glueContext.getSink(
path="s3://dataplatform-" + environment + "-refined-zone/parking/liberator/Parking_Permit_diesel_Tends_Bought_in_Month/",
path="s3://dataplatform-"
+ environment
+ "-refined-zone/parking/liberator/Parking_Permit_diesel_Tends_Bought_in_Month/",
connection_type="s3",
updateBehavior="UPDATE_IN_DATABASE",
partitionKeys=PARTITION_KEYS,
Expand Down