hivetype

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package hivetype parses Hive/Athena column type strings into a type tree.

Index

Constants

This section is empty.

Variables

View Source
var ErrSyntax = errors.New("invalid hive type")

ErrSyntax is returned for a type string that does not parse.

Functions

func IsNested

func IsNested(s string) bool

IsNested reports whether the type string names an array, map or struct.

Types

type Field

type Field struct {
	Type *Type
	Name string
}

Field is one member of a struct type.

type Kind

type Kind int

Kind is a Hive type category.

const (
	Boolean Kind = iota
	Tinyint
	Smallint
	Int
	Bigint
	Float
	Double
	String
	Varchar
	Char
	Binary
	Date
	Timestamp
	Decimal
	Array
	Map
	Struct
)

Type kinds.

type Type

type Type struct {
	Elem      *Type
	Key       *Type
	Value     *Type
	Fields    []Field
	Len       int
	Precision int
	Scale     int
	Kind      Kind
}

Type is a parsed column type.

func Parse

func Parse(s string) (*Type, error)

Parse reads a type such as array<struct<a:int,b:map<string,double>>>; Trino spellings (row(a int), array(int), map(k, v)) are accepted too.

func (*Type) Nested

func (t *Type) Nested() bool

Nested reports whether the type is array, map or struct.

Jump to

Keyboard shortcuts

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