Documentation
¶
Index ¶
Constants ¶
View Source
const ( TableTypeOBS = "OBS" TableTypeDLI = "DLI" TableTypeVIEW = "VIEW" )
Variables ¶
View Source
var RequestOpts = golangsdk.RequestOpts{ MoreHeaders: map[string]string{"Content-Type": "application/json", "X-Language": "en-us"}, }
Functions ¶
This section is empty.
Types ¶
type ColumnOpts ¶
type CommonResp ¶
func Create ¶
func Create(c *golangsdk.ServiceClient, databaseName string, opts CreateTableOpts) (*CommonResp, error)
func UpdateOwner ¶
func UpdateOwner(c *golangsdk.ServiceClient, databaseName string, tableName string, opts UpdateOwnerOpts) (*CommonResp, error)
type CreateTableOpts ¶
type CreateTableOpts struct {
TableName string `json:"table_name" required:"true"`
// Data storage location. OBS tables,DLI tables and view are available.
DataLocation string `json:"data_location" required:"true"`
Description string `json:"description,omitempty"`
Columns []ColumnOpts `json:"columns" required:"true"`
SelectStatement string `json:"select_statement,omitempty"`
// Type of the data to be added to the OBS table. The options: Parquet, ORC, CSV, JSON, Carbon, and Avro.
DataType string `json:"data_type,omitempty"`
// Storage path of data in the new OBS table, which must be a path on OBS and must begin with obs. start with s3a
DataPath string `json:"data_path,omitempty"`
// Whether the table header is included in the OBS table data. Only data in CSV files has this attribute.
WithColumnHeader *bool `json:"with_column_header,omitempty"`
// User-defined data delimiter. Only data in CSV files has this attribute.
Delimiter string `json:"delimiter,omitempty"`
// User-defined reference character. Double quotation marks ("\") are used by default. Only data in CSV files
// has this attribute.
QuoteChar string `json:"quote_char,omitempty"`
// User-defined escape character. Backslashes (\\) are used by default. Only data in CSV files has this attribute.
EscapeChar string `json:"escape_char,omitempty"`
// User-defined date type. yyyy-MM-dd is used by default. Only data in CSV and JSON files has this attribute.
DateFormat string `json:"date_format,omitempty"`
// User-defined timestamp type. yyyy-MM-dd HH:mm:ss is used by default. Only data in CSV and JSON files has
// this attribute.
TimestampFormat string `json:"timestamp_format,omitempty"`
}
type DeleteResp ¶
type DeleteResp struct {
CommonResp
JobMode string `json:"job_mode"`
}
func Delete ¶
func Delete(c *golangsdk.ServiceClient, databaseName string, tableName string, asyncFlag bool) (*DeleteResp, error)
type ListResp ¶
type ListResp struct {
IsSuccess bool `json:"is_success"`
Message string `json:"message"`
TableCount int `json:"table_count"`
Tables []Table4List `json:"tables"`
}
type Partition ¶
type Partition struct {
PartitionName string `json:"partition_name"`
CreateTime int `json:"create_time"`
LastAccessTime int `json:"last_access_time"`
Locations []string `json:"locations"`
LastDdlTime int `json:"last_ddl_time"`
NumRows int `json:"num_rows"`
NumFiles int `json:"num_files"`
TotalSize int `json:"total_size"`
}
type PartitionsInfo ¶
type PartitionsOpts ¶
type PartitionsResp ¶
type PartitionsResp struct {
IsSuccess bool `json:"is_success"`
Message string `json:"message"`
Partitions PartitionsInfo `json:"partitions"`
}
func Partitions ¶
func Partitions(c *golangsdk.ServiceClient, databaseName string, tableName string, opts PartitionsOpts) (*PartitionsResp, error)
type Table ¶
type Table struct {
IsSuccess bool `json:"is_success"`
Message string `json:"message"`
ColumnCount int `json:"column_count"`
Columns []Column `json:"columns"`
TableType string `json:"table_type"`
DataType string `json:"data_type"`
DataLocation string `json:"data_location"`
StorageProperties []map[string]interface{} `json:"storage_properties"`
TableComment string `json:"table_comment"`
CreateTableSql string `json:"create_table_sql"`
}
type Table4List ¶
type Table4List struct {
CreateTime int `json:"create_time"`
DataType string `json:"data_type"`
DataLocation string `json:"data_location"`
LastAccessTime int `json:"last_access_time"`
Location string `json:"location"`
Owner string `json:"owner"`
TableName string `json:"table_name"`
TableSize int `json:"table_size"`
PartitionColumns []string `json:"partition_columns"`
PageSize int `json:"page-size"`
CurrentPage int `json:"current-page"`
// Type of a table.
// EXTERNAL: Indicates an OBS table.
// MANAGED: Indicates a DLI table.
// VIEW: Indicates a view.
TableType string `json:"table_type"`
}
If with-detail is set to false in the URI, only values of tables-related parameters data_location, table_name, and table_type are returned.
type UpdateOwnerOpts ¶
type UpdateOwnerOpts struct {
NewOwner string `json:"new_owner" required:"true"`
}
Click to show internal directories.
Click to hide internal directories.