(fpath)
| 130 | |
| 131 | |
| 132 | def get_schema_from_json(fpath): |
| 133 | with open(fpath) as f: |
| 134 | data = json.load(f) |
| 135 | |
| 136 | schema = {} |
| 137 | for entry in data: |
| 138 | table = str(entry['table'].lower()) |
| 139 | cols = [str(col['column_name'].lower()) for col in entry['col_data']] |
| 140 | schema[table] = cols |
| 141 | |
| 142 | return schema |
| 143 | |
| 144 | |
| 145 | def tokenize(string): |