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
apiVersion: networking.k8s.io/v1 | |
kind: Ingress | |
metadata: | |
name: ... | |
namespace: ... | |
annotations: | |
kubernetes.io/ingress.class: alb | |
alb.ingress.kubernetes.io/load-balancer-name: ... | |
alb.ingress.kubernetes.io/scheme: internal |
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
spark | |
.read // ๋ฐ์ดํฐ๋ฅผ ์ฝ์ด์ต๋๋ค. | |
.format("jdbc") // "jdbc" ๋ฟ ์๋๋ผ "kafka" ๋ฑ ๋ค์ํ Format ์ ์ฌ์ฉํ ์ ์์ต๋๋ค | |
.join(...) // ๋ค๋ฅธ ๋ฐ์ดํฐ์ Join (๋ณํฉ) ํฉ๋๋ค. | |
.where(...) // ๋ฐ์ดํฐ Row ํํฐ๋งํ๊ฑฐ๋ | |
.selectExpr(...) // ํ์ํ Column ๋ง ์ ํํฉ๋๋ค. | |
repartition(5, "col1") // ์ผ๋ง๋ / ์ด๋ค ๊ธฐ์ค์ผ๋ก ๋ถ์ฐํด ์ฒ๋ฆฌํ ์ง๋ฅผ ์ ์ํฉ๋๋ค |
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
spark.executor.instances = 10 | |
spark.executor.cores = 10 | |
spark.executor.memory = 30g (GiB) | |
spark.memory.memoryOverhead = 0.1 | |
spark.memory.fraction = 0.8 | |
spark.memory.storageFraction = 0.5 | |
spark.memory.offHeap.enabled = false |
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
ExecutorLostFailure (executor 7 exited caused by one of the running tasks) Reason: | |
Container killed by YARN for exceeding memory limits. 33.2 GB of 33 GB physical memory used. | |
Consider boosting spark.yarn.executor.memoryOverhead or disabling yarn.nodemanager.vmem-check-enabled because of YARN-4714. |
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
dfInitial = spark.read(...) | |
dfFiltered = dfInitial.select(...).where(..).cache() # ์บ์ ํธ์ถ | |
dfJoined = (...) | |
# action ํธ์ถ | |
# Transformation ์ด ์คํ๋๋ฉฐ dfFiltered ๋ฅผ ๊ณ์ฐํ | |
# dfFiltered ๋ฅผ ์ฌ๋ฌ๋ ๋๋ ์ง Executor ์์ ๋ฉ๋ชจ๋ฆฌ์ ์บ์ฑ | |
dfJoined.write(...) |
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
df = spark.read.(...) | |
df.createOrReplaceTempView("PROPERTY_META") | |
spark.sql("SELECT * FROM PROPERTY_META ..") |
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
# repartition ์ด ์ปฌ๋ผ ๊ธฐ์ค ์์ด ๋์์ผ๋ฏ๋ก | |
# ๋์ผํ property_id (e.g., 2101) ๊ฐ ์ฌ๋ฌ Partition = Connection ์ ๋๋์ด Insert | |
df\ | |
.repartition(10)\ | |
.write\ | |
.mode("append")\ | |
.format("jdbc")\ | |
.option("numPartitions", "10") | |
# property_id ๊ธฐ์ค์ผ๋ก Partition ์ด ๋๋๊ณ |
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
CREATE TABLE ... | |
( | |
... | |
PRIMARY KEY (property_id, part) | |
) |
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
df = spark.read.csv(...) | |
dfSelected = df.selectExpr("...") | |
df.rdd.id | |
dfSelected.rdd.id |
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
df = spark.read.csv(...) | |
dfSelected = df.selectExpr("...") |
NewerOlder