마지막 문자가 대문자일 수도 있고 소문자일 수도 있으며, 숫자일 수도 있습니다. 따라서 샘플
링 비율은 약
1
.
6
%(
1
/
62
)입니다.
7
더 많은 비율을 샘플링하려면 다음과 같이 마지막 문자가
‘
b
’
뿐 아니라 다른 문자일 때도 조건을 만족하도록 쿼리를 수정합니다.
SELECT
user_id, ...
FROM
table
WHERE
right
(user_id,1)
in
(‘b’,’f’,’m’)
;
반대로, 더 적은 비율로 샘플링하려면 마지막 한 글자뿐 아니라 그 앞의 여러 문자를 추가로 파
싱해 조건을 만족할 확률이 줄어들도록 쿼리를 수정합니다.
SELECT
user_id, ...
FROM
table
WHERE
right
(user_id,2) = ‘c3’
;
TIP
샘플링을 할 때는 여러분이 사용하는 함수로 랜덤 샘플링 또는 랜덤에 가까운 샘플링을 할 수 있는지 확인하
는 편이 좋습니다. 필자는 사용자
ID
값에서 마지막 두 문자를 이용해 샘플링하려던 중에 사용자
ID
가 임의로
생성된 값이 아니라 특정 조합으로 이뤄진 두 자리 숫자라는 사실을 뒤늦게 발견한 경험이 있습니다. 이를 모
른 채로 단순히 사용자
ID
에
mod
함수를 ...
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.
O’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
I 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
I’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
I'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.