https://github.com/ssola/sql-creator
  
  
    Avoid writing "create table...." that's boring! 
    https://github.com/ssola/sql-creator
  
        Last synced: 3 months ago 
        JSON representation
    
Avoid writing "create table...." that's boring!
- Host: GitHub
 - URL: https://github.com/ssola/sql-creator
 - Owner: ssola
 - Created: 2017-01-02T14:36:30.000Z (almost 9 years ago)
 - Default Branch: master
 - Last Pushed: 2017-09-07T13:08:17.000Z (about 8 years ago)
 - Last Synced: 2024-08-13T07:08:25.955Z (about 1 year ago)
 - Language: Python
 - Homepage:
 - Size: 1000 Bytes
 - Stars: 4
 - Watchers: 4
 - Forks: 0
 - Open Issues: 0
 - 
            Metadata Files:
            
- Readme: README.md
 
 
Awesome Lists containing this project
- jimsghstars - ssola/sql-creator - Avoid writing "create table...." that's boring! (Python)
 
README
          # sql-creator
This small script creates a HIVE database given some parameters.
Ex.
```
python sql-creator.py --database database_name --table table_name --fields "country|s inserted_at|i value|bi is_vip_customer|b" --partition-by "day|i" --base-path "/my_company/databases" --output-path "/my_company/queries/"
```
Generates this SQL output:
```sql
CREATE EXTERNAL TABLE database_name.table_name (
    country STRING,
    is_vip_customer BOOLEAN,
    value BIGINT,
    inserted_at INT
    ) PARTITIONED BY (day INT)
STORED AS PARQUET
LOCATION '/my_company/databases/database_name/table_name';
DONE! check here /my_company/queries/database_name/table_name.sql
```