Skip to Content
Delta Lake: 시작 및 실행
book

Delta Lake: 시작 및 실행

by Bennie Haelen, Dan Davis
May 2025
Beginner to intermediate
266 pages
4h 32m
Korean
O'Reilly Media, Inc.
Content preview from Delta Lake: 시작 및 실행

4장. 테이블 삭제, 업데이트 및 병합

이 작품은 AI를 사용하여 번역되었습니다. 여러분의 피드백과 의견을 환영합니다: translation-feedback@oreilly.com

Delta Lake는 기존 데이터 레이크에 트랜잭션 계층을 추가하기 때문에 업데이트, 삭제, 병합과 같은 기존 DML 작업을 수행할 수 있습니다. 델타 테이블에서 DELETE 작업( )을 수행하면 데이터 파일 수준에서 작업이 수행되어 필요에 따라 데이터 파일을 제거하고 추가합니다. 제거된 데이터 파일은 더 이상 델타 테이블의 현재 버전에 포함되지 않지만 시간 이동을 통해 이전 버전의 테이블로 되돌릴 수 있으므로 즉시 물리적으로 삭제해서는 안 됩니다(시간 이동은 6장에서 다루고 있습니다). UPDATE 작업을 실행할 때도 마찬가지입니다. 데이터 파일은 필요에 따라 델타 테이블에서 추가 및 제거됩니다.

가장 강력한 Delta Lake DML 작업은 MERGE 작업으로, Delta 테이블에서 UPDATE, DELETE, INSERT 작업을 혼합한 "업서트" 작업을 수행할 수 있습니다. 소스 테이블과 대상 테이블을 조인하고, 일치 조건을 작성한 다음, 일치하거나 일치하지 않는 레코드에 대해 어떤 일이 일어날지 지정합니다.

델타 테이블에서 데이터 삭제

깨끗한 taxidb.YellowTaxis 테이블부터 시작하겠습니다. 이 테이블은 챕터 4의"챕터 초기화" 스크립트 에 의해 생성됩니다.1 9,999,995백만 행이 있습니다:

%sql
SELECT  
    COUNT(id)
FROM    
    taxidb.YellowTaxis

출력:

+----------+
| count(1) |
+----------+
| 9999995  |
+----------+

테이블 생성 및 기록 설명

taxidb.YellowTaxis 델타 테이블은 "챕터 초기화" 스크립트에서 생성되어 /chapter04 폴더에 복사되었습니다. DESCRIBE HISTORY 에서 테이블을 살펴봅시다:2

%sql
DESCRIBE HISTORY taxidb.YellowTaxis

출력(관련 부분만 표시됨):

+-----------+--------------------------------+---------------------+
| operation | operationParameters            | operationMetrics    |
+-----------+--------------------------------+---------------------+
| WRITE     | [('mode', 'Overwrite'), (...)] | [('numFiles', '2'), |
|           |                                |  ('numOutputRows',  | 
|           |                                |  '9999995'), ...]   |
+-----------+--------------------------------+---------------------+

WRITE 작업을 포함하는 하나의 트랜잭션 이 있으며, 총 9,999,995 행에 대해 두 개의 데이터 파일을 작성하고 있음을 알 수 있습니다. 이 두 파일에 대해 자세히 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Delta Lake : le guide définitif

Delta Lake : le guide définitif

Denny Lee, Tristen Wentling, Scott Haines, Prashanth Babu
Delta Lake: Der ultimative Reiseführer

Delta Lake: Der ultimative Reiseführer

Denny Lee, Tristen Wentling, Scott Haines, Prashanth Babu
Delta Lake: Auf und davon

Delta Lake: Auf und davon

Bennie Haelen, Dan Davis
데이터 및 머신러닝 플랫폼 아키텍처 설계

데이터 및 머신러닝 플랫폼 아키텍처 설계

Marco Tranquillin, Valliappa Lakshmanan, Firat Tekiner

Publisher Resources

ISBN: 9798341654273