벤더 확인:
"80% of their files are less than 32 megabytes."
현황:
벤더 평가:
"yesterday we saw their tables. Their files are very large. They were,
like, 400 megabytes... Yeah, they were pretty good size."
발견:
"Going to do iceberg and parquet going forward."
벤더 발언:
"I wish I had a tattoo, tattoo that says partition when you can
bucket if you must avoid bucketing"
해석:
1. 우선순위 1: Partitioning (가능한 항상)
2. 우선순위 2: Bucketing (꼭 필요할 때만)
3. 원칙: Bucketing 회피
"spark and Impala does not like all the buckets, lots of bucketing
at the table level, it creates problems when you want to be able to
do compaction later on with Spark."
문제:
"Partitioning is better, because almost everything has date as a
date field"
권장:
"You never want to partition with especially with Impala, if it's
going to be using iceberg tables, you don't want to partition like,
less than 10 Meg on the files."
최소 크기:
벤더 확인:
"anything over 32 megabytes for the actual... partition file, the
parquet file, you're fine. That's good."
벤더 설명:
"You further break out those partitions by bucketing based on zip code...
but you have to know that ahead of time, it's database design."
적절한 사용:
1. Partition 내 추가 분할: 날짜로 파티션 → Zip Code로 버킷
2. 명확한 카디널리티: 사전 파악 가능
3. 빈번한 조인: 동일 키로 자주 조인
예시: 지역 데이터
"you partition based on city, and then you bucket based [on] zip code...
California, you'll bucket on... the city, and then the zip code in
North Dakota, which has, like, 1/100 the number of people."
벤더 경고:
"if you pocket, let's say you pocket by country, and then you have
here, Korea, US, and then Mexico, you have one record, so you end up
with a separate file."
문제 상황:
역효과:
"every time the query engine needs to do something that involves
everyone, it needs to read a lot of files. So it could actually backfire."
벤더 설명:
"The compaction goes and analyze all of these [small files] and puts
together files into like larger chunks."
목적:
"as far as compaction goes, that's normally handled by the query engine.
So Impala does compaction, Spark does compaction, Hive Trino, they all
handle compaction built in"
지원 엔진:
벤더 설명:
"Let's say you have an iceberg table, and this is the table, right?
This is no partition, and let's say you write a ton of small files."
초기 상태:
Table (No Partition)
├── small_file_1.parquet
├── small_file_2.parquet
├── small_file_3.parquet
├── ... (수천 개)
1차 Compaction:
"When you do compaction, they compact... puts together files into
larger chunks."
결과:
Table (No Partition)
├── compacted_chunk_1.parquet (Large)
├── compacted_chunk_2.parquet (Large)
벤더 경고:
"After you do compaction, if you keep adding small files and you do
compaction, again, you have to again, recompact... all, every single
one. It will be very slow."
문제:
결론:
"Compaction, without partitioning, is a very expensive process, and
that's just doesn't matter whose storage is, just the way it works."
벤더 설명:
"if you have partitioning in place... you have a bunch of smaller
files, partitions, more files, partitions, more files, partition"
초기 상태:
Table (Partitioned by Date)
├── date=2026-02-01/
│ ├── small_file_1.parquet
│ ├── small_file_2.parquet
├── date=2026-02-02/
│ ├── small_file_3.parquet
│ ├── small_file_4.parquet
├── date=2026-02-03/
│ ├── small_file_5.parquet
1차 Compaction:
"Once you do compaction of partition, [compacted] files, when you
compaction again, these are [already] compacted. There's no, not
much that can be done. So they're left alone"
결과:
Table (Partitioned by Date)
├── date=2026-02-01/ (Compacted)
│ └── compacted.parquet (Large)
├── date=2026-02-02/ (Compacted)
│ └── compacted.parquet (Large)
├── date=2026-02-03/ (Compacted)
│ └── compacted.parquet (Large)
2026-02-04 데이터 유입:
Table (Partitioned by Date)
├── date=2026-02-01/ (이미 Compacted - 건드리지 않음)
├── date=2026-02-02/ (이미 Compacted - 건드리지 않음)
├── date=2026-02-03/ (이미 Compacted - 건드리지 않음)
├── date=2026-02-04/ (신규)
│ ├── small_file_6.parquet
│ ├── small_file_7.parquet
2차 Compaction:
"it's faster to just recompact the [new] data... So your goal is
to have larger files."
처리:
벤더 정리:
"If you have partitioning, it mitigates the problem, because the
[query] will still just grab this [partition] after compaction.
Compaction [is] really faster because it's very clearly defined
[which partitions need work]."
장점:
1. 범위 제한: 신규 파티션만 처리
2. 기존 보존: 이미 Compacted된 파티션 재처리 불필요
3. 속도: 전체 대비 일부만 처리
벤더 평가:
"They don't have the problem right now for the tables that are very
large... [files were] 400 megabytes... you can always go one gigabyte,
right? That will actually speed up [performance]."
현황:
벤더 강조:
"You never want to partition... less than 10 Meg on the files.
It just does not work."
최소 기준:
벤더 권장:
"anything over 32 megabytes for the actual... partition file,
the parquet file, you're fine. That's good."
권장 범위:
확인된 크기:
"Their files are very large. They were, like, 400 megabytes"
벤더 설명:
"this is a feature of iceberg. It will naturally separate [partition]
files... you can actually configure this if you want them larger"
Iceberg 특성:
최적화 방향:
"you will, you won't hit like an immediate problem... [but] you can
configure [for] larger [files]"
벤더 설명:
"CDP has spark 3.1, I think, which required, like tuning for
memory mapping."
문제:
요구사항:
"There had to be extra shuffle set up for Spark in earlier versions,
like three one"
벤더 확인:
"you don't need that with three, five, with what you're going to be
using in containers. None of that's a problem anymore."
장점:
벤더 권장:
"you want to have [path-style] enabled, and then the path style
should be set to true"
Spark 설정:
spark = SparkSession.builder \
.config("spark.hadoop.fs.s3a.path.style.access", "true") \
.getOrCreate()
벤더 강조:
"they actually have a thing in there that talks about MinIO pathing.
It's literally... s3 path full... the full path. That's it, simple
as that"
Trino 설정:
iceberg.catalog.type=rest
s3.path-style-access=true
벤더 설명:
"spark on yarn. Required HDFS for the [shared] state"
문제:
벤더 확인:
"with unicorn, you're [not needing HDFS]... when you put spark in
Docker and Kubernetes, your shuffle, where is that going [local]"
장점:
벤더 확인:
"80% of their files are less than 32 megabytes."
우려:
벤더 제안:
"there's auto compaction with some of the query tools like Trino...
Spark does compaction... they all handle compaction built in"
활성화 방법:
Spark 예시:
# Iceberg Compaction
spark.sql("""
CALL system.rewrite_data_files(
table => 'iceberg.db.table_name',
strategy => 'binpack',
options => map('target-file-size-bytes','134217728')
)
""")
목표:
현재:
"So normally we they use the daily partition."
권장 유지:
벤더 경고:
"is there any recommendation on [depth] of partition... too many"
답변:
벤더 설명:
"That's one of the features of iceberg, pretty much one thing that
helps [with compaction]"
특징:
벤더 제안:
"if you wanted to simplify, we provide a rest catalog for iceberg...
We're just replacing just the HMS in this scenario, directly on the
storage itself."
AIStore Tables:
벤더 방법:
"in Trino, you set up the two catalogs, and then you just... migrate
across it. You just copy it over... if the iceberg tables are already
inside of AI store... We can do a discovery of the tables themselves."
방법:
1. Trino Dual Catalog: HMS + AIStore
2. Copy: HMS → AIStore
3. Discovery: 기존 Iceberg 테이블 자동 인식
벤더 제안:
"you're changing formats, going from RC or straight parquet into
iceberg. This, it's ELT... it's better, because they can compact...
you end up with larger files that are faster."
이점:
벤더 설명:
"if you just grab the [dashboard], you'll see like, last three hours
this many files of this distribution came off, like large files,
[many] small files"
모니터링:
설정 권장:
✅ DO:
1. 날짜 기반 Partitioning: Daily 권장
2. 최소 파일 크기: 10MB 이상
3. 권장 파일 크기: 32MB~1GB
4. 쿼리 패턴 고려: 자주 필터링하는 컬럼
❌ DON'T:
1. 과도한 Partitioning: 파일 크기 < 10MB
2. Bucketing 남용: 꼭 필요할 때만
3. HMS 계속 사용: Iceberg REST Catalog로 전환
✅ DO:
1. Auto-Compaction 활성화: Trino/Spark
2. 주기적 수동 Compaction: 주말/야간
3. Partition별 처리: 신규 파티션만
4. 목표 파일 크기: 128MB~1GB
❌ DON'T:
1. 전체 테이블 Compaction: Partition 없이
2. 빈번한 Compaction: 비용 대비 효과 낮음
3. Compaction 무시: Small files 누적
✅ DO:
1. Spark 3.5 사용: Kubernetes 환경
2. Path-style Access: true로 설정
3. Local Shuffle: Container 내 처리
4. Iceberg Native: Spark-Iceberg 통합
❌ DON'T:
1. Spark 3.1 고집: 구형 버전
2. YARN 의존: Kubernetes로 전환
3. HDFS Shuffle: 불필요
쿼리 성능:
예상:
스토리지:
컴퓨팅:
예상:
관리 단순화:
안정성:
문서 버전: 1.0
최종 수정일: 2026년 2월 6일
다음 리뷰: Compaction 적용 후 (2026년 3월)
"I wish I had a tattoo that says partition when you can bucket
if you must avoid bucketing"
"Compaction, without partitioning, is a very expensive process,
and that's just doesn't matter whose storage is, just the way
it works."
"You never want to partition... less than 10 Meg... anything
over 32 megabytes... you're fine."
"you don't need that with three, five... None of that's a
problem anymore."
"80% of their files are less than 32 megabytes... Their files
[in some tables] were, like, 400 megabytes"