redshift

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RSHost     = "host"
	RSPort     = "port"
	RSDbName   = "database"
	RSUserName = "user"
	RSPassword = "password"
)

String constants for redshift destination config

Variables

This section is empty.

Functions

func CheckAndIgnoreColumnAlreadyExistError added in v1.7.0

func CheckAndIgnoreColumnAlreadyExistError(err error) bool

func ColumnsWithDataTypes

func ColumnsWithDataTypes(columns model.TableSchema, prefix string) string

func WithConfig

func WithConfig(h *Redshift, config *config.Config)

Types

type Redshift

type Redshift struct {
	DB             *sqlmiddleware.DB
	Namespace      string
	Warehouse      model.Warehouse
	Uploader       warehouseutils.Uploader
	ConnectTimeout time.Duration
	Logger         logger.Logger

	SlowQueryThreshold time.Duration

	DedupWindow                   bool
	DedupWindowInHours            time.Duration
	SkipDedupDestinationIDs       []string
	SkipComputingUserLatestTraits bool
	EnableDeleteByJobs            bool
	// contains filtered or unexported fields
}

func New added in v1.8.0

func New() *Redshift

func (*Redshift) AddColumns

func (rs *Redshift) AddColumns(tableName string, columnsInfo []warehouseutils.ColumnInfo) error

func (*Redshift) AlterColumn

func (rs *Redshift) AlterColumn(tableName, columnName, columnType string) (model.AlterTableResponse, error)

func (*Redshift) Cleanup

func (rs *Redshift) Cleanup()

func (*Redshift) Connect

func (rs *Redshift) Connect(warehouse model.Warehouse) (client.Client, error)

func (*Redshift) CrashRecover

func (rs *Redshift) CrashRecover()

func (*Redshift) CreateSchema

func (rs *Redshift) CreateSchema() (err error)

func (*Redshift) CreateTable

func (rs *Redshift) CreateTable(tableName string, columns model.TableSchema) (err error)

func (*Redshift) DeleteBy

func (rs *Redshift) DeleteBy(tableNames []string, params warehouseutils.DeleteByParams) (err error)

func (*Redshift) DownloadIdentityRules

func (*Redshift) DownloadIdentityRules(*misc.GZipWriter) (err error)

func (*Redshift) DropTable

func (rs *Redshift) DropTable(tableName string) (err error)

func (*Redshift) ErrorMappings

func (*Redshift) ErrorMappings() []model.JobError

func (*Redshift) FetchSchema

func (rs *Redshift) FetchSchema() (model.Schema, model.Schema, error)

FetchSchema queries redshift and returns the schema associated with provided namespace

func (*Redshift) GetTotalCountInTable

func (rs *Redshift) GetTotalCountInTable(ctx context.Context, tableName string) (int64, error)

func (*Redshift) IsEmpty

func (*Redshift) IsEmpty(_ model.Warehouse) (empty bool, err error)

func (*Redshift) LoadIdentityMappingsTable

func (*Redshift) LoadIdentityMappingsTable() (err error)

func (*Redshift) LoadIdentityMergeRulesTable

func (*Redshift) LoadIdentityMergeRulesTable() (err error)

func (*Redshift) LoadTable

func (rs *Redshift) LoadTable(ctx context.Context, tableName string) error

func (*Redshift) LoadTestTable

func (rs *Redshift) LoadTestTable(location, tableName string, _ map[string]interface{}, format string) (err error)

func (*Redshift) LoadUserTables

func (rs *Redshift) LoadUserTables(ctx context.Context) map[string]error

func (*Redshift) SetConnectionTimeout

func (rs *Redshift) SetConnectionTimeout(timeout time.Duration)

func (*Redshift) Setup

func (rs *Redshift) Setup(warehouse model.Warehouse, uploader warehouseutils.Uploader) (err error)

func (*Redshift) TestConnection

func (rs *Redshift) TestConnection(ctx context.Context, _ model.Warehouse) error

type RedshiftCredentials

type RedshiftCredentials struct {
	Host     string
	Port     string
	DbName   string
	Username string
	Password string

	TunnelInfo *tunnelling.TunnelInfo
	// contains filtered or unexported fields
}

type S3Manifest

type S3Manifest struct {
	Entries []S3ManifestEntry `json:"entries"`
}

type S3ManifestEntry

type S3ManifestEntry struct {
	Url       string                  `json:"url"`
	Mandatory bool                    `json:"mandatory"`
	Metadata  S3ManifestEntryMetadata `json:"meta"`
}

type S3ManifestEntryMetadata

type S3ManifestEntryMetadata struct {
	ContentLength int64 `json:"content_length"`
}

Jump to

Keyboard shortcuts

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