Versions in this module Expand all Collapse all v0 v0.0.1 Mar 31, 2023 Changes in this version + const DefaultJobPriority + const HostDefault + const ProjectExternalExternal + const ProjectStatusAvailable + const ProjectStatusDeleting + const ProjectStatusFrozen + const ProjectStatusReadOnly + const ProjectStatusUnKnown + const ProjectTypeManaged + const TaskCancelled + const TaskFailed + const TaskRunning + const TaskStatusUnknown + const TaskSuccess + const TaskSuspended + const TaskWaiting + var InstanceFilter = struct{ ... } + var ProjectFilter = struct{ ... } + var TableFilter = struct{ ... } + type Cluster struct + Name string + QuotaId string + Quotas []OptionalQuota + type Config struct + AccessId string + AccessKey string + Endpoint string + HttpTimeout time.Duration + ProjectName string + StsToken string + TcpConnectionTimeout time.Duration + func NewConfig() *Config + func NewConfigFromIni(iniPath string) (*Config, error) + func (c *Config) FormatDsn() string + func (c *Config) GenAccount() account2.Account + func (c *Config) GenOdps() *Odps + func (c *Config) GenRestClient() restclient.RestClient + type InsFilterFunc func(values url.Values) + type Instance struct + func NewInstance(odpsIns *Odps, projectName, instanceId string) Instance + func (instance *Instance) EndTime() time.Time + func (instance *Instance) GetCachedInfo() (string, error) + func (instance *Instance) GetResult() ([]TaskResult, error) + func (instance *Instance) GetTaskDetail(taskName string) ([]byte, error) + func (instance *Instance) GetTaskProgress(taskName string) ([]TaskProgressStage, error) + func (instance *Instance) GetTaskQuotaJson(taskName string) (string, error) + func (instance *Instance) GetTaskSummary(taskName string) (*TaskSummary, error) + func (instance *Instance) GetTasks() ([]TaskInInstance, error) + func (instance *Instance) Id() string + func (instance *Instance) IsAsync() bool + func (instance *Instance) IsLoaded() bool + func (instance *Instance) IsSync() bool + func (instance *Instance) Load() error + func (instance *Instance) Owner() string + func (instance *Instance) ProjectName() string + func (instance *Instance) StartTime() time.Time + func (instance *Instance) Status() InstanceStatus + func (instance *Instance) TaskNameCommitted() string + func (instance *Instance) TaskResults() []TaskResult + func (instance *Instance) Terminate() error + func (instance *Instance) WaitForSuccess() error + type InstanceOrErr struct + Err error + Ins *Instance + type InstanceStatus int + const InstanceRunning + const InstanceStatusUnknown + const InstanceSuspended + const InstanceTerminated + func InstancesStatusFromStr(s string) InstanceStatus + func (status *InstanceStatus) MarshalXML(d *xml.Encoder, start xml.StartElement) error + func (status *InstanceStatus) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + func (status InstanceStatus) String() string + type Instances struct + func NewInstances(odpsIns *Odps, projectName ...string) Instances + func (instances Instances) CreateTask(projectName string, task Task) (*Instance, error) + func (instances Instances) CreateTaskWithPriority(projectName string, task Task, jobPriority int) (*Instance, error) + func (instances Instances) List(f func(*Instance, error), filters ...InsFilterFunc) + func (instances Instances) ListInstancesQueued(filters ...InsFilterFunc) ([]string, error) + type LogView struct + func NewLogView(odpsIns *Odps) *LogView + func (lv *LogView) GenerateLogView(instance *Instance, hours int) (string, error) + func (lv *LogView) LogViewHost() string + func (lv *LogView) SetLogViewHost(logViewHost string) + type MergeTask struct + Comment string + Tables []string + XMLName xml.Name + func (t *MergeTask) AddTask(taskName string) + func (t *MergeTask) TaskType() string + type Odps struct + func NewOdps(account account2.Account, endpoint string) *Odps + func (odps *Odps) Account() account2.Account + func (odps *Odps) DefaultProject() Project + func (odps *Odps) DefaultProjectName() string + func (odps *Odps) ExecSQl(sql string) (*Instance, error) + func (odps *Odps) ExecSQlWithHints(sql string, hints map[string]string) (*Instance, error) + func (odps *Odps) Instance(instanceId string) Instance + func (odps *Odps) Instances() Instances + func (odps *Odps) LogView() LogView + func (odps *Odps) Project(name string) Project + func (odps *Odps) Projects() Projects + func (odps *Odps) RestClient() restclient.RestClient + func (odps *Odps) SetDefaultProjectName(projectName string) + func (odps *Odps) SetHttpTimeout(t time.Duration) + func (odps *Odps) SetTcpConnectTimeout(t time.Duration) + func (odps *Odps) SetUserAgent(userAgent string) + func (odps *Odps) Table(name string) Table + func (odps *Odps) Tables() Tables + type OptionalQuota struct + Properties common.Properties + QuotaId string + XMLName xml.Name + type PFilterFunc func(url.Values) + type Partition struct + func NewPartition(odpsIns *Odps, projectName, tableName string, kv map[string]string) Partition + func (p *Partition) CreatedTime() time.Time + func (p *Partition) FileNumEx() int + func (p *Partition) IsArchivedEx() bool + func (p *Partition) LastDDLTime() time.Time + func (p *Partition) LastModifiedTime() time.Time + func (p *Partition) LifeCycleEx() int + func (p *Partition) Load() error + func (p *Partition) LoadExtended() error + func (p *Partition) Name() string + func (p *Partition) PhysicalSizeEx() int + func (p *Partition) RecordNum() int + func (p *Partition) ReservedEx() string + func (p *Partition) Size() int + type Project struct + func NewProject(name string, odpsIns *Odps) Project + func (p *Project) Comment() string + func (p *Project) CreationTime() time.Time + func (p *Project) Existed() bool + func (p *Project) GetAllProperties() (common.Properties, error) + func (p *Project) GetClusters() ([]Cluster, error) + func (p *Project) GetDefaultCluster() (string, error) + func (p *Project) GetExtendedProperties() (common.Properties, error) + func (p *Project) GetTunnelEndpoint() (string, error) + func (p *Project) IsLoaded() bool + func (p *Project) LastModifiedTime() time.Time + func (p *Project) Load() error + func (p *Project) Name() string + func (p *Project) OdpsIns() *Odps + func (p *Project) Owner() string + func (p *Project) ProjectGroupName() string + func (p *Project) PropertiesHasBeSet() common.Properties + func (p *Project) RestClient() restclient.RestClient + func (p *Project) SecurityManager() security.Manager + func (p *Project) Status() ProjectStatus + func (p *Project) Type() string + func (p *Project) Update(properties map[string]string) error + type ProjectStatus int + func (status *ProjectStatus) FromStr(s string) + func (status *ProjectStatus) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + func (status ProjectStatus) MarshalXML(d *xml.Encoder, start xml.StartElement) error + func (status ProjectStatus) String() string + type Projects struct + func NewProjects(odps *Odps) Projects + func (p *Projects) CreateExternalProject(projectName string) error + func (p *Projects) DeleteExternalProject(projectName string) error + func (p *Projects) Exists(projectName string) (bool, error) + func (p *Projects) Get(projectName string) Project + func (p *Projects) GetDefaultProject() Project + func (p *Projects) List(filters ...PFilterFunc) ([]Project, error) + func (p *Projects) UpdateProject(projectName string) error + type SQLCostTask struct + XMLName xml.Name + func NewSQLCostTask(name string, query string, comment string, hints map[string]string) SQLCostTask + func (t *SQLCostTask) TaskType() string + type SQLPlanTask struct + XMLName xml.Name + func (t *SQLPlanTask) TaskType() string + type SQLRTTask struct + XMLName xml.Name + func (t *SQLRTTask) TaskType() string + type SQLTask struct + Comment string + Query string + XMLName xml.Name + func NewAnonymousSQLTask(query string, comment string, hints map[string]string) SQLTask + func NewSqlTask(name string, query string, comment string, hints map[string]string) SQLTask + func (t *SQLTask) GetSelectResultAsCsv(i *Instance, withColumnName bool) (*csv.Reader, error) + func (t *SQLTask) RunInOdps(odpsIns *Odps, projectName string) (*Instance, error) + func (t *SQLTask) TaskType() string + type TFilterFunc func(url.Values) + type Table struct + func NewTable(odpsIns *Odps, projectName string, tableName string) Table + func (t *Table) AddPartition(ifNotExists bool, partitionKey string) error + func (t *Table) Comment() string + func (t *Table) CreateShards(shardCount int) error + func (t *Table) CreatedTime() time.Time + func (t *Table) CryptoAlgo() string + func (t *Table) DeletePartition(ifExists bool, partitionKey string) error + func (t *Table) ExecSql(taskName, sql string) (*Instance, error) + func (t *Table) ExecSqlWithHints(taskName, sql string, hints map[string]string) (*Instance, error) + func (t *Table) GetPartitions(partitionKey string) ([]Partition, error) + func (t *Table) GetSchema() (*tableschema.TableSchema, error) + func (t *Table) HubLifeCycle() int + func (t *Table) IsLoaded() bool + func (t *Table) LastDDLTime() time.Time + func (t *Table) LastModifiedTime() time.Time + func (t *Table) LifeCycle() int + func (t *Table) Load() error + func (t *Table) LoadExtendedInfo() error + func (t *Table) MaxExtendedLabel() string + func (t *Table) MaxLabel() string + func (t *Table) Name() string + func (t *Table) Owner() string + func (t *Table) PartitionColumns() []tableschema.Column + func (t *Table) ProjectName() string + func (t *Table) Read(partition string, columns []string, limit int, timezone string) (*csv.Reader, error) + func (t *Table) RecordNum() int + func (t *Table) ResourceUrl() string + func (t *Table) Schema() tableschema.TableSchema + func (t *Table) SchemaJson() string + func (t *Table) ShardInfoJson() string + func (t *Table) Size() int + func (t *Table) TableExtendedLabels() []string + func (t *Table) TableID() string + func (t *Table) TableLabel() string + func (t *Table) Type() TableType + func (t *Table) ViewText() string + type TableOrErr struct + Err error + Table *Table + type TableType int + const ExternalTable + const ManagedTable + const TableTypeUnknown + const VirtualView + func TableTypeFromStr(s string) TableType + func (t *TableType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + func (t TableType) MarshalXML(d *xml.Encoder, start xml.StartElement) error + func (t TableType) String() string + type Tables struct + func NewTables(odpsIns *Odps, projectName ...string) Tables + func (ts *Tables) BatchLoadTables(tableNames []string) ([]Table, error) + func (ts *Tables) Create(schema tableschema.TableSchema, createIfNotExists bool, ...) error + func (ts *Tables) CreateExternal(schema tableschema.TableSchema, createIfNotExists bool, ...) error + func (ts *Tables) CreateWithDataHub(schema tableschema.TableSchema, createIfNotExists bool, ...) error + func (ts *Tables) Delete(tableName string, ifExists bool) error + func (ts *Tables) List(f func(*Table, error), filters ...TFilterFunc) + type Task interface + AddProperty func(key, value string) + GetName func() string + TaskType func() string + type TaskConfig struct + Config []common.Property + func (t *TaskConfig) AddProperty(key, value string) + type TaskInInstance struct + EndTime common.GMTTime + Name string + StartTime common.GMTTime + Status TaskStatus + Type string + type TaskName string + func (n TaskName) GetName() string + type TaskProgressStage struct + BackupWorkers string + FinishedPercentage int + ID string + InputRecords int + OutRecords int + RunningWorkers string + Status string + TerminatedWorkers string + TotalWorkers string + type TaskResult struct + Name string + Result string + Status TaskStatus + Type string + type TaskStatus int + func TaskStatusFromStr(s string) TaskStatus + func (status *TaskStatus) MarshalXML(d *xml.Encoder, start xml.StartElement) error + func (status *TaskStatus) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + func (status TaskStatus) String() string + type TaskSummary struct + JsonSummary string + Summary string