Documentation
¶
Index ¶
- Constants
- func GetDbqCoreLibVersion() string
- type Check
- type ChecksConfig
- type ClickhouseDbqConnector
- func (c *ClickhouseDbqConnector) ImportDatasets(filter string) ([]string, error)
- func (c *ClickhouseDbqConnector) Ping() (string, error)
- func (c *ClickhouseDbqConnector) ProfileDataset(dataset string, sample bool) (*TableMetrics, error)
- func (c *ClickhouseDbqConnector) RunCheck(check *Check, dataset string, defaultWhere string) (bool, string, error)
- type ColumnInfo
- type ColumnMetrics
- type ConfigDetails
- type DataSource
- type DbqConfig
- type DbqConnector
- type OnFailAction
- type ProfileResultOutput
- type TableMetrics
- type Validation
Constants ¶
View Source
const ( OnFailActionError = "error" OnFailActionWarning = "warn" )
View Source
const (
CheckTypeRawQuery = "raw_query"
)
View Source
const (
Version = "0.0.3"
)
Variables ¶
This section is empty.
Functions ¶
func GetDbqCoreLibVersion ¶ added in v0.0.2
func GetDbqCoreLibVersion() string
Types ¶
type Check ¶
type Check struct {
ID string `yaml:"id"`
Description string `yaml:"description,omitempty"` // optional
OnFail OnFailAction `yaml:"on_fail,omitempty"` // optional (error, warn)
Query string `yaml:"query,omitempty"` // optional raw query
}
type ChecksConfig ¶
type ChecksConfig struct {
Version string `yaml:"version"`
Validations []Validation `yaml:"validations"`
}
func LoadChecksConfig ¶
func LoadChecksConfig(fileName string) (*ChecksConfig, error)
type ClickhouseDbqConnector ¶
type ClickhouseDbqConnector struct {
// contains filtered or unexported fields
}
func (*ClickhouseDbqConnector) ImportDatasets ¶
func (c *ClickhouseDbqConnector) ImportDatasets(filter string) ([]string, error)
func (*ClickhouseDbqConnector) Ping ¶
func (c *ClickhouseDbqConnector) Ping() (string, error)
func (*ClickhouseDbqConnector) ProfileDataset ¶
func (c *ClickhouseDbqConnector) ProfileDataset(dataset string, sample bool) (*TableMetrics, error)
type ColumnMetrics ¶
type ColumnMetrics struct {
ColumnName string `json:"col_name"`
ColumnComment string `json:"col_comment"`
ColumnPosition uint `json:"col_position"`
DataType string `json:"data_type"`
NullCount uint64 `json:"null_count"`
BlankCount *int64 `json:"blank_count,omitempty"` // string only
MinValue *float64 `json:"min_value,omitempty"` // numeric only
MaxValue *float64 `json:"max_value,omitempty"` // numeric only
AvgValue *float64 `json:"avg_value,omitempty"` // numeric only
StddevValue *float64 `json:"stddev_value,omitempty"` // numeric only (Population StdDev)
MostFrequentValue *string `json:"most_frequent_value,omitempty"` // pointer to handle NULL as most frequent
ProfilingDurationMs int64 `json:"profiling_duration_ms"`
}
type ConfigDetails ¶
type DataSource ¶
type DataSource struct {
ID string `yaml:"id"`
Type string `yaml:"type"`
Configuration ConfigDetails `yaml:"configuration"`
Datasets []string `yaml:"datasets"`
}
type DbqConfig ¶
type DbqConfig struct {
Version string `yaml:"version"`
DataSources []DataSource `yaml:"datasources"`
}
type DbqConnector ¶
type DbqConnector interface {
Ping() (string, error)
ImportDatasets(filter string) ([]string, error)
ProfileDataset(dataset string, sample bool) (*TableMetrics, error)
RunCheck(check *Check, dataset string, defaultWhere string) (bool, string, error)
}
func NewClickhouseDbqConnector ¶
func NewClickhouseDbqConnector(dataSource DataSource, logger *slog.Logger) (DbqConnector, error)
type OnFailAction ¶
type OnFailAction string
type ProfileResultOutput ¶
type ProfileResultOutput struct {
Profiles map[string]*TableMetrics `json:"profiles"`
}
type TableMetrics ¶
type TableMetrics struct {
ProfiledAt int64 `json:"profiled_at"`
TableName string `json:"table_name"`
DatabaseName string `json:"database_name"`
TotalRows uint64 `json:"total_rows"`
ColumnsMetrics map[string]*ColumnMetrics `json:"columns_metrics"`
RowsSample []map[string]interface{} `json:"rows_sample"`
ProfilingDurationMs int64 `json:"profiling_duration_ms"`
}
type Validation ¶
Click to show internal directories.
Click to hide internal directories.