maxcompute

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CSVHandler = "com.aliyun.odps.CsvStorageHandler"
	TSVHandler = "com.aliyun.odps.TsvStorageHandler"
)
View Source
const (
	CSV         string                  = "CSV"
	TSV         string                  = "TSV"
	JSON        string                  = "JSON"
	TxtFile     string                  = "TEXTFILE"
	RcFile      string                  = "RCFILE"
	ORC         string                  = "ORC"
	OrcFile     string                  = "ORCFILE"
	SeqFile     string                  = "SEQUENCEFILE"
	Parquet     string                  = "PARQUET"
	Avro        string                  = "AVRO"
	GoogleSheet ExternalTableSourceType = "GOOGLE_SHEETS"
	GoogleDrive ExternalTableSourceType = "GOOGLE_DRIVE"
	LarkSheet   ExternalTableSourceType = "LARK_SHEET"
	OSS         ExternalTableSourceType = "OSS"
)
View Source
const (
	EntityProject  = "project"
	EntitySchema   = "schema"
	EntityFunction = "function"

	ProjectSchemaSections = 2
	TableNameSections     = 3
)
View Source
const (
	KindTable               string = "table"
	KindView                string = "view"
	KindSchema              string = "schema"
	KindExternalTable       string = "external_table"
	KindExternalTableGoogle string = "external_table_google"
	KindExternalTableLark   string = "external_table_lark"
	KindFunction            string = "function"
)
View Source
const (
	GsheetCredsKey     = "GOOGLE_SHEETS_ACCOUNT"
	LarkCredentialsKey = "LARK_SHEETS_ACCOUNT"
	OSSCredsKey        = "OSS_CREDS"
	ExtLocation        = "EXT_LOCATION"
	MaxSyncInterval    = 24

	UseQuoteSerde           = "odps.text.option.use.quote"
	AssumeRoleSerde         = "odps.properties.rolearn"
	AssumeRoleProjectConfig = "EXTERNAL_TABLE_ASSUME_RAM_USER"
)
View Source
const (
	EntityExternalTable = "resource_external_table"
)
View Source
const (
	EntityFormatter = "CSVFormatter"
)
View Source
const (
	EntityTable = "resource_table"
)
View Source
const (
	EntityView = "resource_view"
)

Variables

This section is empty.

Functions

func ConvertSpecTo

func ConvertSpecTo[T any](res *resource.Resource) (*T, error)

func ConvertSpecsTo added in v0.20.0

func ConvertSpecsTo[T any](res []*resource.Resource) ([]*T, error)

func ParseBool

func ParseBool(data any) (string, error)

func ParseDateTime

func ParseDateTime(data any, sourceTimeFormats []string, outPutType string) (string, error)

func ParseNum

func ParseNum(data any, precision int) (string, error)

func ParseString

func ParseString(data any) (string, error)

func SyncDriveFileToOSS

func SyncDriveFileToOSS(ctx context.Context, driveClient *gdrive.GDrive, driveFile *drive.File, ossClient *oss.Client, bucketName, objectName string, et *ExternalTable) error

func SyncDriveFolderToOSS

func SyncDriveFolderToOSS(ctx context.Context, driveClient *gdrive.GDrive, ossClient *oss.Client, folderID, bucketName, destination string, et *ExternalTable) error

func ToOtherExternalSQLString

func ToOtherExternalSQLString(projectName, schemaName string, serdeProperties map[string]string, schema tableschema.TableSchema, format string) (string, error)

func URNFor

func URNFor(res *resource.Resource) (resource.URN, error)

Types

type Char

type Char struct {
	Length int `mapstructure:"length"`
}

func (Char) Validate

func (c Char) Validate() error

type Client

type Client interface {
	TableHandleFrom(projectSchema ProjectSchema, maskingPolicyHandle TableMaskingPolicyHandle) TableResourceHandle
	ViewHandleFrom(projectSchema ProjectSchema) TableResourceHandle
	ExternalTableHandleFrom(schema ProjectSchema, getter TenantDetailsGetter, maskingPolicyHandle TableMaskingPolicyHandle) TableResourceHandle
	TableMaskingPolicyHandleFrom(projectSchema ProjectSchema, logger log.Logger) TableMaskingPolicyHandle
	SchemaHandleFrom(projectSchema ProjectSchema) TableResourceHandle
	FunctionHandleFrom(projectSchema ProjectSchema) TableResourceHandle
}

type ClientProvider

type ClientProvider interface {
	Get(account string) (Client, error)
}

type Cluster

type Cluster struct {
	Using   []string     `mapstructure:"using,omitempty"`
	Type    string       `mapstructure:"type,omitempty"`
	SortBy  []SortColumn `mapstructure:"sort_by,omitempty"`
	Buckets int          `mapstructure:"buckets,omitempty"`
}

Cluster configuration Using: define the columns used for clustering

Type: type of clustering to use for table

Hash:  https://www.alibabacloud.com/help/en/maxcompute/use-cases/range-clustering
Range: https://www.alibabacloud.com/help/en/maxcompute/use-cases/hash-clustering

SortBy: columns to use for sorting Buckets: buckets to fill data in

func (Cluster) Validate

func (c Cluster) Validate() error

type ColumnRecord

type ColumnRecord struct {
	// contains filtered or unexported fields
}

type Decimal

type Decimal struct {
	Precision int32 `mapstructure:"precision"`
	Scale     int32 `mapstructure:"scale"`
}

func (Decimal) Validate

func (d Decimal) Validate() error

type ExtTableClients added in v0.20.0

type ExtTableClients struct {
	GSheet *gsheet.GSheets
	OSS    *oss.Client
	GDrive *gdrive.GDrive
	Lark   *lark.Client
}

type ExternalSource

type ExternalSource struct {
	SourceType  ExternalTableSourceType `mapstructure:"type,omitempty"`
	ContentType string                  `mapstructure:"content_type,omitempty"`
	SourceURIs  []string                `mapstructure:"uris,omitempty"`

	// Additional configs for CSV, GoogleSheets, LarkSheets formats.
	SerdeProperties map[string]string `mapstructure:"serde_properties"`
	TableProperties map[string]string `mapstructure:"table_properties"`

	SyncInterval     int64    `mapstructure:"sync_interval_in_hrs,omitempty"`
	GetFormattedDate bool     `mapstructure:"fetch_formatted_datetime,omitempty"`
	GetFormattedData bool     `mapstructure:"fetch_formatted_data,omitempty"`
	CleanGDriveCSV   bool     `mapstructure:"clean_gdrive_csv,omitempty"`
	Jars             []string `mapstructure:"jars,omitempty"`
	Location         string   `mapstructure:"location,omitempty"`
	Range            string   `mapstructure:"range,omitempty"`
}

func (ExternalSource) GetHeaderCount

func (e ExternalSource) GetHeaderCount() (int, error)

func (ExternalSource) Validate

func (e ExternalSource) Validate() error

type ExternalTable

type ExternalTable struct {
	Name     string `mapstructure:"name,omitempty"`
	Project  string `mapstructure:"project,omitempty"`
	Database string `mapstructure:"database,omitempty"`

	Description string          `mapstructure:"description,omitempty"`
	Schema      Schema          `mapstructure:"schema,omitempty"`
	Source      *ExternalSource `mapstructure:"source,omitempty"`

	Hints map[string]string `mapstructure:"hints,omitempty"`
}

func (*ExternalTable) FullName

func (e *ExternalTable) FullName() string

func (*ExternalTable) GetSourceType added in v0.20.0

func (e *ExternalTable) GetSourceType() ExternalTableSourceType

func (*ExternalTable) GetSyncDelayTolerance added in v0.20.5

func (e *ExternalTable) GetSyncDelayTolerance() time.Duration

func (*ExternalTable) Validate

func (e *ExternalTable) Validate() error

type ExternalTableHandle

type ExternalTableHandle struct {
	// contains filtered or unexported fields
}

func NewExternalTableHandle

func NewExternalTableHandle(
	mcSQLExecutor McSQLExecutor,
	mcSchema McSchema,
	mcExternalTable McExternalTable,
	getter TenantDetailsGetter,
	maskingPolicyHandle TableMaskingPolicyHandle,
) *ExternalTableHandle

func (ExternalTableHandle) Create

func (e ExternalTableHandle) Create(res *resource.Resource) error

func (ExternalTableHandle) Exists

func (e ExternalTableHandle) Exists(tableName string) bool

func (ExternalTableHandle) Update

func (e ExternalTableHandle) Update(res *resource.Resource) error

type ExternalTableSourceType added in v0.20.0

type ExternalTableSourceType string

func NewExternalTableSource added in v0.20.0

func NewExternalTableSource(s string) (ExternalTableSourceType, error)

func (ExternalTableSourceType) String added in v0.20.0

func (e ExternalTableSourceType) String() string

type ExternalTableSources added in v0.20.0

type ExternalTableSources []ExternalTableSourceType

func (*ExternalTableSources) Append added in v0.20.0

func (es *ExternalTableSources) Append(source ExternalTableSourceType)

func (*ExternalTableSources) Has added in v0.20.0

type Field

type Field struct {
	Name        string `mapstructure:"name,omitempty"`
	Type        string `mapstructure:"type,omitempty"`
	Description string `mapstructure:"description,omitempty"`

	// First label should be the primary label and others as extended
	Labels []string `mapstructure:"labels,omitempty"`

	DefaultValue string `mapstructure:"default_value,omitempty"`
	Required     bool   `mapstructure:"required,omitempty"`

	SourceTimeFormat  string   `mapstructure:"source_time_format,omitempty"`
	SourceTimeFormats []string `mapstructure:"source_time_formats,omitempty"`

	Decimal      *Decimal   `mapstructure:"decimal,omitempty"`
	Char         *Char      `mapstructure:"char,omitempty"`
	VarChar      *VarChar   `mapstructure:"varchar,omitempty"`
	StructSchema []Field    `mapstructure:"struct,omitempty"`
	ArraySchema  *Field     `mapstructure:"array,omitempty"`
	MapSchema    *MapSchema `mapstructure:"map,omitempty"`

	// masking policy fields
	MaskPolicy   string `mapstructure:"mask_policy,omitempty"`
	UnmaskPolicy string `mapstructure:"unmask_policy,omitempty"`
}

func (*Field) ToColumn

func (f *Field) ToColumn() (tableschema.Column, error)

func (*Field) Validate

func (f *Field) Validate() error

type FunctionHandle added in v0.21.8

type FunctionHandle struct {
	// contains filtered or unexported fields
}

func NewFunctionHandle added in v0.21.8

func NewFunctionHandle(mcFunction MCFunction) *FunctionHandle

func (*FunctionHandle) Create added in v0.21.8

func (*FunctionHandle) Create(_ *resource.Resource) error

func (*FunctionHandle) Exists added in v0.21.8

func (fh *FunctionHandle) Exists(tableName string) bool

func (*FunctionHandle) Update added in v0.21.8

func (*FunctionHandle) Update(_ *resource.Resource) error

type MCFunction added in v0.21.8

type MCFunction interface {
	Get(functionName string) (*odps.Function, error)
}

type MapSchema

type MapSchema struct {
	Key   Field `mapstructure:"key"`
	Value Field `mapstructure:"value"`
}

func (*MapSchema) Validate

func (m *MapSchema) Validate() error

type MaskingPolicyHandle

type MaskingPolicyHandle struct {
	// contains filtered or unexported fields
}

func (MaskingPolicyHandle) Process

func (h MaskingPolicyHandle) Process(tableName string, schema Schema) error

type MaxCompute

type MaxCompute struct {
	SyncRepo SyncRepo
	// contains filtered or unexported fields
}

func NewMaxComputeDataStore

func NewMaxComputeDataStore(logger log.Logger, secretProvider SecretProvider, clientProvider ClientProvider, tenantProvider TenantDetailsGetter, syncRepo SyncRepo, maxFileSizeSupported, driveFileCleanupSizeLimit int, maxSyncDelayTolerance time.Duration) *MaxCompute

func (MaxCompute) Backup

func (MaxCompute) BatchUpdate

func (MaxCompute) BatchUpdate(_ context.Context, _ []*resource.Resource) error

func (MaxCompute) Create

func (m MaxCompute) Create(ctx context.Context, res *resource.Resource) error

func (MaxCompute) Exist

func (m MaxCompute) Exist(ctx context.Context, tnnt tenant.Tenant, urn resource.URN) (bool, error)

func (MaxCompute) GetURN

func (MaxCompute) GetURN(res *resource.Resource) (resource.URN, error)

func (MaxCompute) Update

func (m MaxCompute) Update(ctx context.Context, res *resource.Resource) error

func (MaxCompute) Validate

func (MaxCompute) Validate(r *resource.Resource) error

type MaxComputeClient

type MaxComputeClient struct {
	*odps.Odps
}

func NewClient

func NewClient(svcAccount string) (*MaxComputeClient, error)

func (*MaxComputeClient) ExternalTableHandleFrom

func (c *MaxComputeClient) ExternalTableHandleFrom(projectSchema ProjectSchema, getter TenantDetailsGetter, maskingPolicyHandle TableMaskingPolicyHandle) TableResourceHandle

func (*MaxComputeClient) FunctionHandleFrom added in v0.21.8

func (c *MaxComputeClient) FunctionHandleFrom(projectSchema ProjectSchema) TableResourceHandle

func (*MaxComputeClient) GetDDLView

func (c *MaxComputeClient) GetDDLView(_ context.Context, table string) (string, error)

func (*MaxComputeClient) SchemaHandleFrom added in v0.20.6

func (c *MaxComputeClient) SchemaHandleFrom(projectSchema ProjectSchema) TableResourceHandle

func (*MaxComputeClient) TableHandleFrom

func (c *MaxComputeClient) TableHandleFrom(projectSchema ProjectSchema, maskingPolicyHandle TableMaskingPolicyHandle) TableResourceHandle

func (*MaxComputeClient) TableMaskingPolicyHandleFrom

func (c *MaxComputeClient) TableMaskingPolicyHandleFrom(projectSchema ProjectSchema, logger log.Logger) TableMaskingPolicyHandle

func (*MaxComputeClient) ViewHandleFrom

func (c *MaxComputeClient) ViewHandleFrom(projectSchema ProjectSchema) TableResourceHandle

type MaxComputeClientProvider

type MaxComputeClientProvider struct{}

func NewClientProvider

func NewClientProvider() *MaxComputeClientProvider

func (MaxComputeClientProvider) Get

func (MaxComputeClientProvider) Get(account string) (Client, error)

type McExternalTable

type McExternalTable interface {
	CreateExternal(
		schema tableschema.TableSchema,
		createIfNotExists bool,
		serdeProperties map[string]string,
		jars []string,
		hints, alias map[string]string,
	) error
	BatchLoadTables(tableNames []string) ([]*odps.Table, error)
	Delete(tableName string, ifExists bool) error
}

type McSQLExecutor

type McSQLExecutor interface {
	ExecSQlWithHints(sql string, hints map[string]string) (*odps.Instance, error)
	CurrentSchemaName() string
	SetCurrentSchemaName(schemaName string)
}

type McSchema

type McSchema interface {
	Create(schemaName string, createIfNotExists bool, comment string) error
}

type McTable

type McTable interface {
	Create(schema tableschema.TableSchema, createIfNotExists bool, hints, alias map[string]string) error
	BatchLoadTables(tableNames []string) ([]*odps.Table, error)
}

type McTableInstance

type McTableInstance interface {
	Load() error
	ColumnMaskInfos() ([]odps.ColumnMaskInfo, error)
}

type McTableWrapper

type McTableWrapper struct {
	McTable
}

McTableWrapper is a wrapper for McTable which only implements BatchLoadTables so that the return value satisfies the McTableInstance interface

func (McTableWrapper) BatchLoadTables

func (t McTableWrapper) BatchLoadTables(tableNames []string) ([]McTableInstance, error)

type McTables

type McTables interface {
	BatchLoadTables(tableNames []string) ([]McTableInstance, error)
}

type Partition

type Partition struct {
	Columns []string `mapstructure:"field"`
}

type ProjectSchema

type ProjectSchema struct {
	Project string
	Schema  string
}

func ProjectSchemaFor

func ProjectSchemaFor(name resource.Name) (ProjectSchema, error)

func ProjectSchemaFrom

func ProjectSchemaFrom(project, schemaName string) (ProjectSchema, error)

func (ProjectSchema) FullName

func (ps ProjectSchema) FullName() string

type ResourceHandle

type ResourceHandle interface {
	Create(res *resource.Resource) error
	Update(res *resource.Resource) error
	Exists(tableName string) bool
}

type ResourceURN

type ResourceURN struct {
	Project string `mapstructure:"project"`
	Schema  string `mapstructure:"database"`
	Name    string `mapstructure:"name"`
}

func NewResourceURN

func NewResourceURN(project, schema, name string) (ResourceURN, error)

func NewResourceURNFromResourceName

func NewResourceURNFromResourceName(resourceName string) (ResourceURN, error)

func (ResourceURN) URN

func (n ResourceURN) URN() string

type ResourceURNWithUpstreams

type ResourceURNWithUpstreams struct {
	ResourceURN ResourceURN
	Upstreams   []*ResourceURNWithUpstreams
}

type ResourceURNWithUpstreamsList

type ResourceURNWithUpstreamsList []*ResourceURNWithUpstreams

func (ResourceURNWithUpstreamsList) FlattenUnique

type ResourceURNs

type ResourceURNs []ResourceURN

func (ResourceURNs) GroupByProjectschema

func (n ResourceURNs) GroupByProjectschema() map[ProjectSchema][]string

type Schema

type Schema []*Field

func (Schema) ContainsDateTimeColumns

func (s Schema) ContainsDateTimeColumns() bool

func (Schema) ToMaxComputeColumns

func (s Schema) ToMaxComputeColumns(partitionColumn map[string]struct{}, clusterColumn *Cluster, schemaBuilder *tableschema.SchemaBuilder, tableType string) error

func (Schema) Validate

func (s Schema) Validate() error

type SchemaDetails added in v0.20.6

type SchemaDetails struct {
	Name        resource.Name `mapstructure:"name,omitempty"`
	Project     string        `mapstructure:"project,omitempty"`
	Database    string        `mapstructure:"database,omitempty"`
	Description string        `mapstructure:"description,omitempty"`
}

func ConvertSpecToSchemaDetails added in v0.20.6

func ConvertSpecToSchemaDetails(res *resource.Resource) (*SchemaDetails, error)

func (*SchemaDetails) Validate added in v0.20.6

func (v *SchemaDetails) Validate() error

type SchemaHandle added in v0.20.6

type SchemaHandle struct {
	// contains filtered or unexported fields
}

func NewSchemaHandle added in v0.20.6

func NewSchemaHandle(schema McSchema, schemaInteractor SchemaInteractor) *SchemaHandle

func (SchemaHandle) Create added in v0.20.6

func (sh SchemaHandle) Create(res *resource.Resource) error

func (SchemaHandle) Exists added in v0.20.6

func (sh SchemaHandle) Exists(_ string) bool

func (SchemaHandle) Update added in v0.20.6

func (sh SchemaHandle) Update(res *resource.Resource) error

type SchemaInteractor added in v0.20.6

type SchemaInteractor interface {
	Exists() (bool, error)
}

type SecretProvider

type SecretProvider interface {
	GetSecret(ctx context.Context, tnnt tenant.Tenant, key string) (*tenant.PlainTextSecret, error)
}

type SortColumn

type SortColumn struct {
	Name  string `mapstructure:"name"`
	Order string `mapstructure:"order,omitempty"`
}

type SyncRepo

type SyncRepo interface {
	Upsert(ctx context.Context, projectName tenant.ProjectName, entityType, identifier string, remarks map[string]string, success bool) error
	Touch(ctx context.Context, projectName tenant.ProjectName, identifiers []string) error
	UpsertRevision(ctx context.Context, projectName tenant.ProjectName, entityType, identifier string, remarks map[string]string, revision int, success bool) error
}

type SyncerService

type SyncerService struct {
	SyncRepo              SyncRepo
	MaxSyncDelayTolerance time.Duration
	// contains filtered or unexported fields
}

func NewSyncer

func NewSyncer(log log.Logger, secretProvider SecretProvider, tenantDetailsGetter TenantDetailsGetter,
	syncRepo SyncRepo, maxFileSizeSupported, driveFileCleanupSizeLimit int, maxSyncDelayTolerance time.Duration,
) *SyncerService

func (*SyncerService) GetExternalTablesDueForSync added in v0.20.0

func (s *SyncerService) GetExternalTablesDueForSync(ctx context.Context, tnnt tenant.Tenant, resources []*resource.Resource, lastUpdateMap map[string]*resource.SourceVersioningInfo) ([]*resource.Resource, []*resource.Resource, error)

func (*SyncerService) GetSourceRevisionInfo added in v0.21.14

func (s *SyncerService) GetSourceRevisionInfo(ctx context.Context, tnnt tenant.Tenant, resources []*resource.Resource) ([]*resource.SourceRevisionInfo, error)

func (*SyncerService) GetSyncInterval

func (*SyncerService) GetSyncInterval(res *resource.Resource) (int64, error)

func (*SyncerService) Sync

func (s *SyncerService) Sync(ctx context.Context, res *resource.Resource) error

func (*SyncerService) SyncBatch

func (s *SyncerService) SyncBatch(ctx context.Context, tnnt tenant.Tenant, resources []*resource.Resource) ([]resource.SyncStatus, error)

func (*SyncerService) TouchUnModified

func (s *SyncerService) TouchUnModified(ctx context.Context, projectName tenant.ProjectName, resources []*resource.Resource) error

type Table

type Table struct {
	Name     string `mapstructure:"name,omitempty"`
	Project  string `mapstructure:"project,omitempty"`
	Database string `mapstructure:"database,omitempty"`

	Description string     `mapstructure:"description,omitempty"`
	Schema      Schema     `mapstructure:"schema,omitempty"`
	Cluster     *Cluster   `mapstructure:"cluster,omitempty"`
	Partition   *Partition `mapstructure:"partition,omitempty"`
	Lifecycle   int        `mapstructure:"lifecycle,omitempty"`
	Type        string     `mapstructure:"type,omitempty"`

	TableProperties map[string]string      `mapstructure:"table_properties,omitempty"`
	Hints           map[string]string      `mapstructure:"hints,omitempty"`
	ExtraConfig     map[string]interface{} `mapstructure:",remain"`
}

Table defines the spec for max-compute table We are trying to keep the spec similar to bigquery to make maintenance easier Cluster: we accept name of column for clustering, check Cluster for more details Partition: we accept the name of columns for partitioning and provide in config ExtraConfig:

hints: hints to be provided to the table for creation, map<string, string>
alias: alias for table to be passed to table, map<string, string>

func (*Table) FullName

func (t *Table) FullName() string

func (*Table) Validate

func (t *Table) Validate() error

type TableHandle

type TableHandle struct {
	// contains filtered or unexported fields
}

func NewTableHandle

func NewTableHandle(mcSQLExecutor McSQLExecutor, mcSchema McSchema, mcTable McTable, maskingPolicyHandle TableMaskingPolicyHandle) *TableHandle

func (TableHandle) Create

func (t TableHandle) Create(res *resource.Resource) error

func (TableHandle) Exists

func (t TableHandle) Exists(tableName string) bool

func (TableHandle) Update

func (t TableHandle) Update(res *resource.Resource) error

type TableMaskingPolicyHandle

type TableMaskingPolicyHandle interface {
	Process(tableName string, schema Schema) error
}

func NewMaskingPolicyHandle

func NewMaskingPolicyHandle(mcSQLExecutor McSQLExecutor, mcTables McTables, logger log.Logger) TableMaskingPolicyHandle

type TableResourceHandle

type TableResourceHandle interface {
	ResourceHandle
}

type TenantDetailsGetter

type TenantDetailsGetter interface {
	GetDetails(ctx context.Context, tnnt tenant.Tenant) (*tenant.WithDetails, error)
}

type VarChar

type VarChar struct {
	Length int `mapstructure:"length"`
}

func (VarChar) Validate

func (v VarChar) Validate() error

type View

type View struct {
	Name     string `mapstructure:"name,omitempty"`
	Project  string `mapstructure:"project,omitempty"`
	Database string `mapstructure:"database,omitempty"`

	Description string   `mapstructure:"description,omitempty"`
	Columns     []string `mapstructure:"columns,omitempty"`
	ViewQuery   string   `mapstructure:"view_query,omitempty"`
	Lifecycle   int      `mapstructure:"lifecycle,omitempty"`

	Hints map[string]string `mapstructure:"hints,omitempty"`
}

func (*View) FullName

func (v *View) FullName() string

func (*View) Validate

func (v *View) Validate() error

type ViewHandle

type ViewHandle struct {
	// contains filtered or unexported fields
}

func NewViewHandle

func NewViewHandle(viewSQLExecutor ViewSQLExecutor, viewSchema ViewSchema, viewTable ViewTable) *ViewHandle

func (ViewHandle) Create

func (v ViewHandle) Create(res *resource.Resource) error

func (ViewHandle) Exists

func (v ViewHandle) Exists(tableName string) bool

func (ViewHandle) Update

func (v ViewHandle) Update(res *resource.Resource) error

type ViewSQLExecutor

type ViewSQLExecutor interface {
	CurrentSchemaName() string
}

type ViewSchema

type ViewSchema interface {
	Create(schemaName string, createIfNotExists bool, comment string) error
}

type ViewTable

type ViewTable interface {
	CreateViewWithHints(schema tableschema.TableSchema, orReplace, createIfNotExists, buildDeferred bool, hints map[string]string) error
	BatchLoadTables(tableNames []string) ([]*odps.Table, error)
}

Jump to

Keyboard shortcuts

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