delegate

package
v0.0.0-...-4e2fb3a Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLocalFile

func NewLocalFile(name string, fp *os.File) source.ParquetFile

func NewLocalFileReader

func NewLocalFileReader(name string) (source.ParquetFile, error)

func NewLocalFileWriter

func NewLocalFileWriter(name string) (source.ParquetFile, error)

Types

type CommandArguments

type CommandArguments struct {
	WorkspaceName           string
	Client                  string
	Org                     string
	ObjectType              string
	Environment             string
	SessionId               string
	SourcePeriodKey         string
	ProcessName             string
	ReportName              string
	FileKey                 string
	OutputPath              string
	OriginalFileName        string
	ReportScriptPaths       []string
	CurrentReportDirectives *ReportDirectives
	// ComputePipesJson        string
	BucketName string
	RegionName string
}

func (*CommandArguments) DoParquetReport

func (ca *CommandArguments) DoParquetReport(dbpool *pgxpool.Pool, tempDir string, s3FileName *string, name string, sqlStmt *string) error

func (*CommandArguments) DoReport

func (ca *CommandArguments) DoReport(dbpool *pgxpool.Pool, tempDir string, outputFileName *string, sqlStmt *string) (string, error)

The heavy lifting outputFileName is the name in the report sql file, this is mapped to a table name in ReportDirectives.ReportsAsTable

func (*CommandArguments) RunReports

func (ca *CommandArguments) RunReports(dbpool *pgxpool.Pool) (err error)

Main Functions --------------------------------------------------------------------------------------

type LocalFile

type LocalFile struct {
	FilePath string
	File     *os.File
}

func (*LocalFile) Close

func (localFile *LocalFile) Close() error

func (*LocalFile) Create

func (localFile *LocalFile) Create(name string) (source.ParquetFile, error)

func (*LocalFile) Open

func (localFile *LocalFile) Open(name string) (source.ParquetFile, error)

func (*LocalFile) Read

func (localFile *LocalFile) Read(b []byte) (cnt int, err error)

func (*LocalFile) Seek

func (localFile *LocalFile) Seek(offset int64, pos int) (int64, error)

func (*LocalFile) Write

func (localFile *LocalFile) Write(b []byte) (n int, err error)

type ReportDirectives

type ReportDirectives struct {
	// InputPath is original fileKey, unless overriten in config file, used to emit sentinel file
	FilePathSubstitution        []StringSubstitution         `json:"filePathSubstitution"`
	ReportScripts               []string                     `json:"reportScripts"`
	UpdateLookupTables          bool                         `json:"updateLookupTables"`
	EmitSentinelFile            *SentinelConfig              `json:"emitSentinelFile"`
	OutputS3Prefix              string                       `json:"outputS3Prefix"`
	InputPath                   string                       `json:"inputPath"`
	OutputPath                  string                       `json:"outputPath"`
	ReportsAsTable              map[string]string            `json:"reportsAsTable"`
	ReportOrStatementProperties map[string]map[string]string `json:"reportOrStatementProperties"`
	RegisterReport              []map[string]string          `json:"registerReport"`
}

type SentinelConfig

type SentinelConfig struct {
	FilePathSubstitution []StringSubstitution `json:"filePathSubstitution"`
}

type StringSubstitution

type StringSubstitution struct {
	Replace string `json:"replace"`
	With    string `json:"with"`
}

Jump to

Keyboard shortcuts

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