j2h

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2017 License: MIT Imports: 7 Imported by: 0

README

j2h

j2h is a tool to convert json to hive ddl.

Installation

$ go get github.com/kanga333/j2h

or

Download the binary directly from the release page.

Usage

$ j2h -help
j2h is a tool to convert json to hive ddl

Usage: j2h <option>
  -json-path string
        Path of json file.
  -version
        Print version information.

Example

{
  "foo": {
    "bar": [
      10,
      21,
      20
    ],
    "baz": [
      [
        1.1,
        1.2
      ],
      [
        1.3,
        1.4
      ]
    ],
    "hoge": "string"
  },
  "piyo": true
}
$ j2h -path test.json
create external table json_data(
  foo struct<
    bar:array<int>,
    baz:array<
      array<double>
    >,
    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.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL