범용 URI 인터페이스
uri() 메서드는 소스 유형을 자동으로 감지하는 권장되는 범용 진입점입니다:
URI 구문 참고
| 소스 유형 | URI 형식 | 예시 |
|---|---|---|
| 로컬 파일 | path/to/file | data.csv, /abs/path/data.parquet |
| S3 | s3://bucket/path | s3://mybucket/data.parquet?nosign=true |
| GCS | gs://bucket/path | gs://mybucket/data.csv |
| Azure | az://container/path | az://mycontainer/data.parquet |
| HTTP/HTTPS | https://url | https://example.com/data.csv |
| MySQL | mysql://user:pass@host:port/db/table | mysql://root:pass@localhost:3306/mydb/users |
| PostgreSQL | postgresql://user:pass@host:port/db/table | postgresql://postgres:pass@localhost:5432/mydb/users |
| SQLite | sqlite:///path?table=name | sqlite:///data.db?table=users |
| ClickHouse | clickhouse://host:port/db/table | clickhouse://localhost:9000/default/hits |
파일 SOURCES
from_file
| 매개변수 | 유형 | 기본값 | 설명 |
|---|---|---|---|
path | str | required | 파일 경로(로컬 또는 URL) |
format | str | None | 파일 포맷(None인 경우 자동 감지) |
compression | str | None | 압축 방식(None인 경우 자동 감지) |
Pandas와 호환되는 읽기 함수
클라우드 스토리지
from_s3
| 매개변수 | 유형 | 기본값 | 설명 |
|---|---|---|---|
url | str | 필수 | S3 URL (s3://버킷/경로) |
access_key_id | str | None | AWS 액세스 키 ID |
secret_access_key | str | None | AWS 시크릿 액세스 키 |
format | str | None | 파일 포맷(자동 감지됨) |
from_gcs
from_azure
from_hdfs
from_url
데이터베이스
from_mysql
| 매개변수 | 유형 | 기본값 | 설명 |
|---|---|---|---|
host | str | 필수 | MySQL 호스트 |
database | str | 필수 | 데이터베이스 이름 |
table | str | 필수 | 테이블 이름 |
user | str | 필수 | 사용자 이름 |
password | str | 필수 | 비밀번호 |
port | int | 3306 | 포트 번호 |
from_postgresql
from_clickhouse
from_mongodb
from_sqlite
데이터 레이크
from_iceberg
from_delta
from_hudi
인메모리 SOURCES
from_df / from_dataframe
DataFrame 생성자
특수 데이터 SOURCES
from_numbers
from_random
run_sql
요약 표
| 메서드 | 소스 유형 | 예시 |
|---|---|---|
uri() | 범용 | DataStore.uri("s3://bucket/data.parquet") |
from_file() | 로컬/원격 파일 | DataStore.from_file("data.csv") |
read_csv() | CSV 파일 | pd.read_csv("data.csv") |
read_parquet() | Parquet 파일 | pd.read_parquet("data.parquet") |
from_s3() | Amazon S3 | DataStore.from_s3("s3://bucket/path") |
from_gcs() | Google Cloud Storage | DataStore.from_gcs("gs://bucket/path") |
from_azure() | Azure Blob | DataStore.from_azure("az://container/path") |
from_hdfs() | HDFS | DataStore.from_hdfs("hdfs://host/path") |
from_url() | HTTP/HTTPS | DataStore.from_url("https://example.com/data.csv") |
from_mysql() | MySQL | DataStore.from_mysql(host, db, table, user, pass) |
from_postgresql() | PostgreSQL | DataStore.from_postgresql(host, db, table, user, pass) |
from_clickhouse() | ClickHouse | DataStore.from_clickhouse(host, db, table) |
from_mongodb() | MongoDB | DataStore.from_mongodb(uri, db, collection) |
from_sqlite() | SQLite | DataStore.from_sqlite("data.db", table) |
from_iceberg() | Apache Iceberg | DataStore.from_iceberg("/path/to/table") |
from_delta() | Delta Lake | DataStore.from_delta("/path/to/table") |
from_hudi() | Apache Hudi | DataStore.from_hudi("/path/to/table") |
from_df() | pandas DataFrame | DataStore.from_df(pandas_df) |
DataFrame() | 딕셔너리/DataFrame | pd.DataFrame({'a': [1, 2, 3]}) |
from_numbers() | 연속 숫자 | DataStore.from_numbers(1000000) |
from_random() | 무작위 데이터 | DataStore.from_random(rows=1000, columns=5) |
run_sql() | Raw SQL | DataStore.run_sql("SELECT * FROM ...") |