No description
  • HTML 60%
  • Python 38.3%
  • Shell 1.5%
  • Dockerfile 0.2%
Find a file
2026-07-30 10:15:06 +09:00
app Check SQLite bootstrap file before use 2026-07-30 09:09:15 +09:00
bin Add SQLite fallback for metadata storage 2026-07-30 09:07:31 +09:00
manifests Initial implementation: Impala DDL generator (Kudu/HDFS/Object Storage) 2026-07-23 13:47:21 +09:00
samples Initial implementation: Impala DDL generator (Kudu/HDFS/Object Storage) 2026-07-23 13:47:21 +09:00
scripts Initial implementation: Impala DDL generator (Kudu/HDFS/Object Storage) 2026-07-23 13:47:21 +09:00
templates Preserve first pasted batch editor table 2026-07-30 10:12:08 +09:00
.gitignore Initial implementation: Impala DDL generator (Kudu/HDFS/Object Storage) 2026-07-23 13:47:21 +09:00
codec.md Align runtime baseline with Python 3.11 2026-07-29 13:36:06 +09:00
codeg.md Fix table generator workflow validation 2026-07-23 14:39:20 +09:00
docker-compose.yaml Keep compose port mapping on 8887 2026-07-28 17:00:20 +09:00
Dockerfile Align runtime baseline with Python 3.11 2026-07-29 13:36:06 +09:00
manual.md Sync development_g with latest history and batch editor changes 2026-07-28 09:18:10 +09:00
README.md Align runtime baseline with Python 3.11 2026-07-29 13:36:06 +09:00
requirements.txt Switch metadata storage to PostgreSQL 2026-07-29 16:17:08 +09:00

Table Generator

Impala 테이블 DDL(CREATE TABLE) 생성 웹 도구. 단건/일괄 테이블 생성, 검증, Dry-Run, 실행까지 지원.

Storage Type

Storage DDL 엔진 주요 기능
Kudu Template PK 필수, PARTITION BY HASH/RANGE/HASH+RANGE, STORED AS KUDU, tablet 복제
HDFS Template STORED AS PARQUET/ORC, LOCATION hdfs://, ROW FORMAT, PARTITIONED BY
Object Storage Template STORED AS PARQUET/ORC, LOCATION s3a://cos://gs://abfs://, 프로토콜 선택

기능

단건 생성

  • UI에서 컬럼 정의 (No, 컬럼명, 타입, 길이, 스케일, PK, FK, Null, 코멘트)
  • Storage 선택 시 네이티브 타입 드롭다운 자동 변경 (예: Kudu → UNIXTIME_MICROS (TIMESTAMP))
  • 입력 시 DDL 즉시 갱신 (300ms debounce)
  • 테이블/컬럼 코멘트
  • EXT(외부) 테이블 동시 생성 옵션 (CREATE EXTERNAL TABLE)
  • Export: CSV (#meta 헤더 포함) / JSON / YAML

일괄 생성

  • CSV 파일 업로드 (table_key 컬럼으로 최대 32개 테이블 구분)
  • #table: 헤더로 테이블별 옵션 (schema, partition, replicas 등)
  • 테이블 목록 → 행 확장 시 DDL 표시
  • 존재 여부 확인 → 선택 실행 (CREATE TABLE IF NOT EXISTS)

검증

  • 이름 규칙: 영문/숫자/밑줄, 예약어 경고, 128자 제한
  • DECIMAL: precision 1-38, scale <= precision
  • VARCHAR 1-65535, CHAR 1-255
  • PK/FK 배타적, PK 컬럼 앞쪽 배치 (Kudu)
  • 파티션 상호 조건, HASH 컬럼 ⊆ PK
  • DDL 문법 검증 (sqlglot)
  • 따옴표 자동 정리 (" ` → ')

실행

  • Impala 연결 등록/관리 (SQLite)
  • 연결 테스트 (SELECT version())
  • Dry-Run (EXPLAIN, 실제 생성 없음)
  • 테이블 존재 시: 백업(RENAME table_YYYYMMDD_NNN) 또는 DROP 선택
  • 화이트리스트: CREATE TABLE, DROP TABLE IF EXISTS, ALTER TABLE RENAME만 허용
  • 실행 이력 서버 DB 저장, Diff 뷰

코멘트 딕셔너리

  • 컬럼명 → 코멘트 수동 등록 ([+] 버튼)
  • 컬럼명 입력 시 자동 제안 (등록된 코멘트가 있으면 노란색 배경으로 자동 채움)

CSV 포맷

단건 Export/Import

#meta:storage=kudu
#meta:schema=master
#meta:table=orders
#meta:partition_type=RANGE
#meta:partition_cols=week
#meta:partition_values=202628|202629
name,type,length,scale,pk,nullable,comment
type,STRING,,,Y,N,유형
qty,DECIMAL,22,0,,Y,수량

일괄 Import

#table:orders,schema=master,storage=kudu,partition_type=RANGE,partition_cols=week,partition_values=202628,num_replicas=3,table_comment=주문
#table:items,schema=master,storage=kudu,partition_type=HASH,partition_cols=itemid,hash_partitions=4
table_key,name,type,length,scale,pk,nullable,comment
orders,type,STRING,,,Y,N,유형
orders,qty,DECIMAL,22,0,,Y,수량
items,itemid,STRING,,,Y,N,아이템 ID

로컬 실행

pip3 install -r requirements.txt
bin/build.sh start       # uvicorn 데몬 (port 8889)
bin/build.sh status
bin/build.sh stop

컨테이너 배포

# 빌드
scripts/docker-build.sh

# 실행
docker run -d --name table-generator --restart unless-stopped \
  -p 8889:8889 -v /data/table_generator:/data \
  table-generator:latest

# K8s 배포
scripts/deploy.sh apply development  # NodePort 30089

API

Method Path 설명
GET / Web UI
GET /healthz 헬스체크
GET /docs Swagger UI
Connections
GET /api/connections 연결 목록
POST /api/connections 연결 등록
PUT /api/connections/{id} 연결 수정
DELETE /api/connections/{id} 연결 삭제
POST /api/connections/{id}/test 연결 테스트
Types
GET /api/dialects Storage type 목록 + 옵션 스키마
GET /api/types/{dialect} 네이티브 타입 목록
Import/Export
POST /api/import 단건 Import (CSV/TSV/JSON/YAML)
POST /api/import/batch 일괄 Import (table_key 기반)
Generate/Execute
POST /api/generate DDL 생성 (검증 포함)
POST /api/check/syntax DDL 문법 검증 (sqlglot)
POST /api/check/dryrun DDL Dry-Run (EXPLAIN)
POST /api/check/table 테이블 존재 확인
POST /api/check/backup 테이블 백업 (RENAME)
POST /api/execute DDL 실행
History
GET /api/history 실행 이력
GET /api/history/table/{name} 테이블별 이력
Dictionary
GET /api/dict/comment?name=x 코멘트 조회
POST /api/dict/comment 코멘트 등록

기술 스택

  • Python 3.11 / FastAPI / Uvicorn
  • SQLite (연결 관리, 이력, 코멘트 딕셔너리)
  • sqlglot (DDL 문법 검증)
  • impyla (Impala 연결/실행, 선택적)
  • Vanilla JS SPA (폐쇄망, CDN 없음)
  • Docker / RockyLinux 9

브랜치

브랜치 용도
development 머지 대상
development_c 작업 브랜치 (클린 코드)
development_c_annotated 전체 한국어 주석 포함