Documentation
¶
Index ¶
- Constants
- Variables
- func CheckDataType(inputModel reflect.StructField, inputVal interface{}, dateFormat string) (output string)
- func DetectDataType(in string, dateFormat string) (res string)
- func InspectJson(ins []string) (out []string)
- func Parse(header []string, in interface{}, m interface{}, outputType string, ...) (e error)
- func QueryBuilder(clause, tablename, input string, TableModel interface{}) (retVal string)
- type DuplexTerm
- type FieldMismatch
- type FnHiveReceive
- type Hive
- func (h *Hive) CheckDataStructure(Tablename string, TableModel interface{}) (isMatch bool, err error)
- func (h *Hive) Exec(query string, fn FnHiveReceive) (e error)
- func (h *Hive) Load(TableName, dateFormat string, TableModel interface{}) (retVal string, err error)
- func (h *Hive) LoadFile(FilePath, TableName, fileType, dateFormat string, TableModel interface{}) (retVal string, err error)
- func (h *Hive) LoadFileWithWorker(FilePath, TableName, fileType string, dateFormat string, ...) (retVal string, err error)
- func (h *Hive) Populate(query string, m interface{}) (e error)
- type HiveManager
- type HiveResult
- type HiveWorker
- type UnsupportedType
Constants ¶
View Source
const ( BEE_CLI_STR = "jdbc:hive2:" CLOSE_SCRIPT = "!quit" BEE_CLOSED = "(closed)>" TEST_CONN_SCRIPT = "show tables;" )
View Source
const ( BEE_TEMPLATE = "%sbeeline -u jdbc:hive2://%s/%s" BEE_USER = " -n %s" BEE_PASSWORD = " -p %s" BEE_QUERY = " -e \"%s\"" PACKAGENAME = "Hive" CSV_FORMAT = " --outputFormat=csv" TSV_FORMAT = " --outputFormat=tsv" DSV_FORMAT = " --outputFormat=dsv --delimiterForDSV=|\t" DSV_DELIMITER = "|\t" TSV = "tsv" CSV = "csv" JSON = "json" )
Variables ¶
View Source
var JsonPart string
Functions ¶
func CheckDataType ¶
func CheckDataType(inputModel reflect.StructField, inputVal interface{}, dateFormat string) (output string)
func DetectDataType ¶
func InspectJson ¶
func QueryBuilder ¶
Types ¶
type DuplexTerm ¶
type DuplexTerm struct {
Writer *bufio.Writer
Reader *bufio.Reader
Cmd *exec.Cmd
CmdStr string
Stdin io.WriteCloser
Stdout io.ReadCloser
FnReceive FnHiveReceive
OutputType string
DateFormat string
}
func (*DuplexTerm) Close ¶
func (d *DuplexTerm) Close()
func (*DuplexTerm) Open ¶
func (d *DuplexTerm) Open() (e error)
func (*DuplexTerm) SendInput ¶
func (d *DuplexTerm) SendInput(input string) (res HiveResult, err error)
func (*DuplexTerm) TestConnection ¶
func (d *DuplexTerm) TestConnection() (e error)
type FieldMismatch ¶
type FieldMismatch struct {
// contains filtered or unexported fields
}
func (*FieldMismatch) Error ¶
func (e *FieldMismatch) Error() string
type FnHiveReceive ¶
type FnHiveReceive func(HiveResult) error
type Hive ¶
type Hive struct {
BeePath string
Server string
User string
Password string
DBName string
Conn *DuplexTerm
OutputType string
DateFormat string
}
func HiveConfig ¶
func (*Hive) CheckDataStructure ¶
type HiveManager ¶
type HiveManager struct {
FreeWorkers chan *HiveWorker
Tasks chan string
Done chan bool
TimeProcess chan int64
LastProcess int64
TotalTimeOut int64
}
manager model
func (*HiveManager) AssignTask ¶
func (m *HiveManager) AssignTask(task string, wg *sync.WaitGroup)
assign task to free worker
func (*HiveManager) DoMonitor ¶
func (m *HiveManager) DoMonitor(wg *sync.WaitGroup)
do monitoring worker thats free or not
func (*HiveManager) EndWorker ¶
func (m *HiveManager) EndWorker()
func (*HiveManager) InProgress ¶
func (m *HiveManager) InProgress(result int64, wg *sync.WaitGroup)
check if a task still in progress to wait it till finish
type HiveResult ¶
type HiveWorker ¶
type HiveWorker struct {
WorkerId int
TimeProcess chan int64
FreeWorkers chan *HiveWorker
Context *Hive
IsConnOpen bool
}
worker model
type UnsupportedType ¶
type UnsupportedType struct {
Type string
}
func (*UnsupportedType) Error ¶
func (e *UnsupportedType) Error() string
Click to show internal directories.
Click to hide internal directories.