https://github.com/kanga333/j2h
j2h is a tool to convert json to hive ddl.
https://github.com/kanga333/j2h
golang hive hql json
Last synced: about 1 year ago
JSON representation
j2h is a tool to convert json to hive ddl.
- Host: GitHub
- URL: https://github.com/kanga333/j2h
- Owner: kanga333
- License: mit
- Created: 2017-06-02T07:53:42.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-13T16:45:27.000Z (almost 9 years ago)
- Last Synced: 2025-03-27T11:01:33.156Z (over 1 year ago)
- Topics: golang, hive, hql, json
- Language: Go
- Homepage:
- Size: 57.6 KB
- Stars: 5
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# j2h
j2h is a tool to convert json to hive ddl.
## Installation
```sh
$ go get github.com/kanga333/j2h
```
or
Download the binary directly from the release page.
## Usage
```sh
$ j2h -help
j2h is a tool to convert json to hive ddl
Usage: j2h
-json-path string
Path of json file.
-version
Print version information.
```
## Example
```json:test.json
{
"foo": {
"bar": [
10,
21,
20
],
"baz": [
[
1.1,
1.2
],
[
1.3,
1.4
]
],
"hoge": "string"
},
"piyo": true
}
```
```sh
$ j2h -path test.json
create external table json_data(
foo struct<
bar:array,
baz:array<
array
>,
hoge:string
>,
piyo boolean
)
```
## Restrictions
- Hive Reserved words are output in lowercase letters.
- It does not correspond to the output that converts json to map of hive.
- All integers are output as int type.
- All decimals are output as double type.
- The null type of json is converted to the binary type of hive.
- If the array element type of json is mixed, it is converted to binary type of hive.